Rosetta  2021.16
util.hh File Reference

small bundle of utilities for dealing with numbers. More...

`#include <numeric/types.hh>`
`#include <numeric/numeric.functions.hh>`
`#include <utility/vector1.hh>`
`#include <utility/numbers.hh>`
`#include <numeric/MathNTensorBase.fwd.hh>`
`#include <limits>`
`#include <cmath>`
`#include <algorithm>`
`#include <map>`

numeric

## Functions

template<typename Number >
Number numeric::clamp (Number value, Number lower_bound, Number upper_bound)
Clamps to the closed interval [lower_bound, upper_bound]. Templated type must implement operator<. More...

double numeric::log (double x, double base)
Computes log(x) in the given base. More...

bool numeric::equal_by_epsilon (numeric::Real value1, numeric::Real value2, numeric::Real epsilon)
are two Real values are equal up to some epsilon More...

numeric::Real numeric::median (utility::vector1< numeric::Real > const &values)
Returns the median from a vector1 of Real values. More...

numeric::Real numeric::mean (utility::vector1< numeric::Real > const &values)

template<typename T >
T numeric::max (utility::vector1< T > const &values)

template<typename T >
T numeric::min (utility::vector1< T > const &values)

Real numeric::boltzmann_accept_probability (Real const score_before, Real const score_after, Real const temperature)
Calculates the acceptance probability of a given score-change at the given temperature, generally used in simulated annealing algorithms. Returns a value in the range (0-1). More...

template<typename T >
T numeric::find_nearest_value (typename utility::vector1< T > const &input_list, T key, platform::Size min_index, platform::Size max_index)
recursive binary search that finds the value closest to key. Call find_nearest_value(input_list,value) instead. It's the driver function for this function. This fails miserably (and silently!) on a non-sorted vector, so don't do that!. More...

template<typename T >
T numeric::find_nearest_value (typename utility::vector1< T > const &input_list, T key)
given a vector and an input value, return the value in the vector that is closest to the input This is a wrapper for find_nearest_value(input_list,key,min,max) and insures that you're sorted. More...

Real & numeric::access_Real_MathNTensor (MathNTensorBaseOP< Real > tensorbase, utility::vector1< Size > const &position)
Utility function to access an entry in a MathNTensor of arbitrary dimensionality unknown at compile time, given a MathNTensorBaseOP. More...

Real const & numeric::const_access_Real_MathNTensor (MathNTensorBaseCOP< Real > tensorbase, utility::vector1< Size > const &position)
Utility function to access an entry in a MathNTensor of arbitrary dimensionality unknown at compile time, given a MathNTensorBaseCOP. More...

Size numeric::get_Real_MathNTensor_dimension_size (MathNTensorBaseCOP< Real > tensorbase, Size const dimension_index)
Given a MathNTensorBaseCOP, get the size along one dimension. More...

## Detailed Description

small bundle of utilities for dealing with numbers.

small bundle of utilities for dealing with zscores.