|
void | HandleErrorThrow (string err, const char *file, int line) |
| prints error and throws an exception
|
|
void | HandleErrorNoThrow (string err, const char *file, int line) |
| prints error to stderr and returns
|
|
void | clean (ArrayXf &x) |
| limits node output to be between MIN_FLT and MAX_FLT
|
|
std::string | ltrim (std::string str, const std::string &chars) |
|
std::string | rtrim (std::string str, const std::string &chars) |
|
std::string | trim (std::string str, const std::string &chars) |
|
vector< type_index > | get_dtypes (MatrixXf &X) |
| calculates data types for each column of X
|
|
float | condition_number (const MatrixXf &X) |
| returns true for elements of x that are infinite
|
|
MatrixXf | corrcoef (const MatrixXf &X) |
| returns the pearson correlation coefficients of matrix.
|
|
float | mean_square_corrcoef (const MatrixXf &X) |
|
int | argmiddle (vector< float > &v) |
| returns the (first) index of the element with the middlest value in v
|
|
float | variance (const ArrayXf &v) |
| calculate variance
|
|
float | skew (const ArrayXf &v) |
| calculate skew
|
|
float | kurtosis (const ArrayXf &v) |
| calculate kurtosis
|
|
float | covariance (const ArrayXf &x, const ArrayXf &y) |
| covariance of x and y
|
|
float | slope (const ArrayXf &x, const ArrayXf &y) |
| slope of x/y
|
|
float | pearson_correlation (const ArrayXf &x, const ArrayXf &y) |
| the normalized covariance of x and y
|
|
float | mad (const ArrayXf &x) |
| median absolute deviation
|
|
std::string | ReplaceString (std::string subject, const std::string &search, const std::string &replace) |
| find and replace string
|
|
void | ReplaceStringInPlace (std::string &subject, const std::string &search, const std::string &replace) |
| string find and replace in place
|
|
vector< size_t > | mask_to_index (const ArrayXb &mask) |
| convert a boolean mask to an index array
|
|
tuple< vector< size_t >, vector< size_t > > | mask_to_indices (const ArrayXb &mask) |
| returns 2 indices: first where mask is true, and second where mask is false.
|
|
template<typename V , typename T > |
bool | in (const V &v, const T &i) |
| check if element is in vector.
|
|
template<typename T , typename Scalar = T::Scalar> |
Scalar | median (const T &v) |
| calculate median
|
|
float | variance (const ArrayXf &v, float mean) |
| calculate variance when mean provided
|
|
template<typename T > |
vector< size_t > | argsort (const vector< T > &v, bool ascending=true) |
| return indices that sort a vector
|
|
template<typename T > |
vector< T > | softmax (const vector< T > &w) |
| return the softmax transformation of a vector.
|
|
template<typename T > |
vector< T > | unique (vector< T > w) |
| returns unique elements in vector
|
|
template<typename T > |
vector< T > | unique (Matrix< T, -1, -1 > w) |
| returns unique elements in Eigen matrix of variable rows/cols
|
|
template<typename T > |
vector< T > | unique (Matrix< T, -1, 1 > w) |
| returns unique elements in Eigen vector
|
|
template<typename T > |
vector< T > | unique (Array< T, -1, 1 > w) |
| returns unique elements in 1d Eigen array
|
|
template<typename T > |
string | to_string (const T &value) |
| template function to convert objects to string for logging
|
|
| NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE (Log_Stats, generation, time, best_score, best_score_v, med_score, med_score_v, med_size, med_complexity, max_size, max_complexity) |
|
template<typename T > |
std::enable_if_t< std::is_scalar_v< T >, T > | limited (T x) |
| limits the output to finite real numbers
|
|
template<typename T > |
std::enable_if_t< std::is_base_of_v< Eigen::ArrayBase< T >, T >, T > | limited (T x) |
|
template<typename T > |
void | reorder (vector< T > &v, vector< int > const &order) |
|
template<typename T > |
array< Array< T,-1, 1 >, 2 > | split (const Array< T,-1, 1 > &v, const ArrayXb &mask) |
| split Eigen matrix or array into two by mask
|
|
template<std::ranges::range T> |
void | print (T t) |
| prints comma delimited container contents.
|
|
template<class Vector , class T > |
void | unique_insert (Vector &v, const T &t) |
| unique insertion into a vector. allows a vector to be used like a set. source: http://www.lafstern.org/matt/col1.pdf
|
|
template<typename T , std::size_t... Indices> |
auto | vectorToTupleHelper (const std::vector< T > &v, std::index_sequence< Indices... >) |
|
template<std::size_t N, typename T > |
auto | vectorToTuple (const std::vector< T > &v) |
|
template<typename R , typename Arg , typename... Args> |
R | apply (const std::function< R(Args...)> &f, const vector< Arg > &inputs) |
|
template<class T , class U > |
std::vector< T > | slice (const vector< T > &v, const U &idx) |
|
template<typename K , typename V > |
static map< V, K > | reverse_map (const map< K, V > &m) |
| Given a map from keys to values, creates a new map from values to keys.
|
|
template<typename T > |
ostream & | operator<< (ostream &os, const vector< T > &v) |
|
namespace containing various utility functions