Class which collects generic mathematical functions.
在文件Mathematics.h第123行定义。
公有成员 | |
virtual const char * | get_name () const |
template<> | |
void | display_vector (const uint8_t *vector, int32_t n, const char *name) |
template<> | |
void | display_vector (const int32_t *vector, int32_t n, const char *name) |
template<> | |
void | display_vector (const int64_t *vector, int32_t n, const char *name) |
template<> | |
void | display_vector (const float32_t *vector, int32_t n, const char *name) |
template<> | |
void | display_vector (const float64_t *vector, int32_t n, const char *name) |
template<> | |
void | display_matrix (const int32_t *matrix, int32_t rows, int32_t cols, const char *name) |
template<> | |
void | display_matrix (const float64_t *matrix, int32_t rows, int32_t cols, const char *name) |
Constructor/Destructor. | |
CMath () | |
Constructor - initializes log-table. | |
virtual | ~CMath () |
Destructor - frees logtable. | |
静态公有成员 | |
static float64_t | mutual_info (float64_t *p1, float64_t *p2, int32_t len) |
static float64_t | relative_entropy (float64_t *p, float64_t *q, int32_t len) |
static float64_t | entropy (float64_t *p, int32_t len) |
returns entropy of p which is given in logspace | |
static uint32_t | get_seed () |
returns number generator seed | |
static int | is_finite (double f) |
checks whether a float is finite | |
static int | is_infinity (double f) |
checks whether a float is infinity | |
static int | is_nan (double f) |
checks whether a float is nan | |
min/max/abs functions. | |
template<class T > | |
static T | min (T a, T b) |
return the minimum of two integers | |
template<class T > | |
static T | max (T a, T b) |
return the maximum of two integers | |
template<class T > | |
static T | clamp (T value, T lb, T ub) |
return the value clamped to interval [lb,ub] | |
template<class T > | |
static T | abs (T a) |
return the maximum of two integers | |
misc functions | |
static float64_t | round (float64_t d) |
static float64_t | floor (float64_t d) |
static float64_t | ceil (float64_t d) |
template<class T > | |
static T | sign (T a) |
signum of type T variable a | |
template<class T > | |
static void | swap (T &a, T &b) |
swap e.g. floats a and b | |
template<class T > | |
static void | resize (T *&data, int64_t old_size, int64_t new_size) |
template<class T > | |
static T | twonorm (T *x, int32_t len) |
|| x ||_2 | |
template<class T > | |
static T | qsq (T *x, int32_t len, float64_t q) |
|| x ||_q^q | |
template<class T > | |
static T | qnorm (T *x, int32_t len, float64_t q) |
|| x ||_q | |
template<class T > | |
static T | sq (T x) |
x^2 | |
static float32_t | sqrt (float32_t x) |
x^0.5 | |
static float64_t | sqrt (float64_t x) |
x^0.5 | |
static floatmax_t | sqrt (floatmax_t x) |
x^0.5 | |
static floatmax_t | powl (floatmax_t x, floatmax_t n) |
x^n | |
static int32_t | pow (int32_t x, int32_t n) |
static float64_t | pow (float64_t x, int32_t n) |
static float64_t | pow (float64_t x, float64_t n) |
static float64_t | exp (float64_t x) |
static float64_t | log10 (float64_t v) |
static float64_t | log2 (float64_t v) |
static float64_t | log (float64_t v) |
template<class T > | |
static void | transpose_matrix (T *&matrix, int32_t &num_feat, int32_t &num_vec) |
static float64_t * | pinv (float64_t *matrix, int32_t rows, int32_t cols, float64_t *target=NULL) |
static void | dgemm (double alpha, const double *A, int rows, int cols, CBLAS_TRANSPOSE transposeA, double *B, int cols_B, CBLAS_TRANSPOSE transposeB, double beta, double *C) |
static void | dgemv (double alpha, const double *A, int rows, int cols, const CBLAS_TRANSPOSE transposeA, const double *X, double beta, double *Y) |
static int64_t | factorial (int32_t n) |
static void | init_random (uint32_t initseed=0) |
static int64_t | random () |
static int32_t | random (int32_t min_value, int32_t max_value) |
static float32_t | random (float32_t min_value, float32_t max_value) |
static float64_t | random (float64_t min_value, float64_t max_value) |
template<class T > | |
static T * | clone_vector (const T *vec, int32_t len) |
template<class T > | |
static void | fill_vector (T *vec, int32_t len, T value) |
template<class T > | |
static void | range_fill_vector (T *vec, int32_t len, T start=0) |
template<class T > | |
static void | random_vector (T *vec, int32_t len, T min_value, T max_value) |
static int32_t * | randperm (int32_t n) |
static int64_t | nchoosek (int32_t n, int32_t k) |
template<class T > | |
static void | vec1_plus_scalar_times_vec2 (T *vec1, T scalar, const T *vec2, int32_t n) |
x=x+alpha*y | |
static float64_t | dot (const bool *v1, const bool *v2, int32_t n) |
compute dot product between v1 and v2 (blas optimized) | |
static floatmax_t | dot (const floatmax_t *v1, const floatmax_t *v2, int32_t n) |
compute dot product between v1 and v2 (blas optimized) | |
static float64_t | dot (const float64_t *v1, const float64_t *v2, int32_t n) |
compute dot product between v1 and v2 (blas optimized) | |
static float32_t | dot (const float32_t *v1, const float32_t *v2, int32_t n) |
compute dot product between v1 and v2 (blas optimized) | |
static float64_t | dot (const uint64_t *v1, const uint64_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 64bit unsigned ints) | |
static float64_t | dot (const int64_t *v1, const int64_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 64bit ints) | |
static float64_t | dot (const int32_t *v1, const int32_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 32bit ints) | |
static float64_t | dot (const uint32_t *v1, const uint32_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 32bit unsigned ints) | |
static float64_t | dot (const uint16_t *v1, const uint16_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 16bit unsigned ints) | |
static float64_t | dot (const int16_t *v1, const int16_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 16bit unsigned ints) | |
static float64_t | dot (const char *v1, const char *v2, int32_t n) |
compute dot product between v1 and v2 (for 8bit (un)signed ints) | |
static float64_t | dot (const uint8_t *v1, const uint8_t *v2, int32_t n) |
compute dot product between v1 and v2 (for 8bit (un)signed ints) | |
static float64_t | dot (const float64_t *v1, const char *v2, int32_t n) |
compute dot product between v1 and v2 | |
template<class T > | |
static void | add (T *target, T alpha, const T *v1, T beta, const T *v2, int32_t len) |
target=alpha*vec1 + beta*vec2 | |
template<class T > | |
static void | add_scalar (T alpha, T *vec, int32_t len) |
add scalar to vector inplace | |
template<class T > | |
static void | scale_vector (T alpha, T *vec, int32_t len) |
scale vector inplace | |
template<class T > | |
static T | sum (T *vec, int32_t len) |
return sum(vec) | |
template<class T > | |
static T | max (T *vec, int32_t len) |
return max(vec) | |
template<class T > | |
static T | sum_abs (T *vec, int32_t len) |
return sum(abs(vec)) | |
template<class T > | |
static bool | fequal (T x, T y, float64_t precision=1e-6) |
return sum(abs(vec)) | |
static float64_t | mean (float64_t *vec, int32_t len) |
static float64_t | trace (float64_t *mat, int32_t cols, int32_t rows) |
static void | sort (int32_t *a, int32_t cols, int32_t sort_col=0) |
static void | sort (float64_t *a, int32_t *idx, int32_t N) |
template<class T > | |
static void | radix_sort (T *array, int32_t size) |
template<class T > | |
static uint8_t | byte (T word, uint16_t p) |
template<class T > | |
static void | radix_sort_helper (T *array, int32_t size, uint16_t i) |
template<class T > | |
static void | insertion_sort (T *output, int32_t size) |
template<class T > | |
static void | qsort (T *output, int32_t size) |
template<class T > | |
static void | display_bits (T word, int32_t width=8 *sizeof(T)) |
display bits (useful for debugging) | |
template<class T > | |
static void | display_vector (const T *vector, int32_t n, const char *name="vector") |
display vector (useful for debugging) | |
template<class T > | |
static void | display_matrix (const T *matrix, int32_t rows, int32_t cols, const char *name="matrix") |
display matrix (useful for debugging) | |
template<class T1 , class T2 > | |
static void | qsort_index (T1 *output, T2 *index, uint32_t size) |
template<class T1 , class T2 > | |
static void | qsort_backward_index (T1 *output, T2 *index, int32_t size) |
template<class T1 , class T2 > | |
static void | parallel_qsort_index (T1 *output, T2 *index, uint32_t size, int32_t n_threads, int32_t limit=262144) |
template<class T1 , class T2 > | |
static void * | parallel_qsort_index (void *p) |
template<class T > | |
static void | min (float64_t *output, T *index, int32_t size) |
template<class T > | |
static void | nmin (float64_t *output, T *index, int32_t size, int32_t n) |
template<class T > | |
static int32_t | unique (T *output, int32_t size) |
template<class T > | |
static int32_t | binary_search_helper (T *output, int32_t size, T elem) |
template<class T > | |
static int32_t | binary_search (T *output, int32_t size, T elem) |
template<class T > | |
static int32_t | binary_search_max_lower_equal (T *output, int32_t size, T elem) |
static float64_t | Align (char *seq1, char *seq2, int32_t l1, int32_t l2, float64_t gapCost) |
static int32_t | calcroc (float64_t *fp, float64_t *tp, float64_t *output, int32_t *label, int32_t &size, int32_t &possize, int32_t &negsize, float64_t &tresh, FILE *rocfile) |
summing functions | |
static float64_t | logarithmic_sum (float64_t p, float64_t q) |
静态公有属性 | |
constants | |
static const float64_t | INFTY = -log(0.0) |
infinity | |
static const float64_t | ALMOST_INFTY = +1e+20 |
static const float64_t | ALMOST_NEG_INFTY = -1000 |
almost neg (log) infinity | |
static int32_t | LOGRANGE = 0 |
range for logtable: log(1+exp(x)) -LOGRANGE <= x <= 0 | |
static uint32_t | seed = 0 |
random generator seed | |
static char * | rand_state = NULL |
CMath | ( | ) |
Constructor - initializes log-table.
在文件Mathematics.cpp第50行定义。
~CMath | ( | ) | [virtual] |
Destructor - frees logtable.
在文件Mathematics.cpp第70行定义。
static T abs | ( | T | a | ) | [static] |
return the maximum of two integers
在文件Mathematics.h第169行定义。
static void add | ( | T * | target, | |
T | alpha, | |||
const T * | v1, | |||
T | beta, | |||
const T * | v2, | |||
int32_t | len | |||
) | [static] |
target=alpha*vec1 + beta*vec2
在文件Mathematics.h第676行定义。
static void add_scalar | ( | T | alpha, | |
T * | vec, | |||
int32_t | len | |||
) | [static] |
add scalar to vector inplace
在文件Mathematics.h第686行定义。
align two sequences seq1 & seq2 of length l1 and l2 using gapCost return alignment cost
在文件Mathematics.cpp第150行定义。
static int32_t binary_search | ( | T * | output, | |
int32_t | size, | |||
T | elem | |||
) | [static] |
在文件Mathematics.h第1067行定义。
static int32_t binary_search_helper | ( | T * | output, | |
int32_t | size, | |||
T | elem | |||
) | [static] |
在文件Mathematics.h第1041行定义。
static int32_t binary_search_max_lower_equal | ( | T * | output, | |
int32_t | size, | |||
T | elem | |||
) | [static] |
在文件Mathematics.h第1080行定义。
static uint8_t byte | ( | T | word, | |
uint16_t | p | |||
) | [static] |
在文件Mathematics.h第782行定义。
int32_t calcroc | ( | float64_t * | fp, | |
float64_t * | tp, | |||
float64_t * | output, | |||
int32_t * | label, | |||
int32_t & | size, | |||
int32_t & | possize, | |||
int32_t & | negsize, | |||
float64_t & | tresh, | |||
FILE * | rocfile | |||
) | [static] |
calculates ROC into (fp,tp) from output and label of length size returns index with smallest error=fp+fn
在文件Mathematics.cpp第195行定义。
在文件Mathematics.h第195行定义。
static T clamp | ( | T | value, | |
T | lb, | |||
T | ub | |||
) | [static] |
return the value clamped to interval [lb,ub]
在文件Mathematics.h第157行定义。
static T* clone_vector | ( | const T * | vec, | |
int32_t | len | |||
) | [static] |
在文件Mathematics.h第469行定义。
static void dgemm | ( | double | alpha, | |
const double * | A, | |||
int | rows, | |||
int | cols, | |||
CBLAS_TRANSPOSE | transposeA, | |||
double * | B, | |||
int | cols_B, | |||
CBLAS_TRANSPOSE | transposeB, | |||
double | beta, | |||
double * | C | |||
) | [static] |
在文件Mathematics.h第386行定义。
static void dgemv | ( | double | alpha, | |
const double * | A, | |||
int | rows, | |||
int | cols, | |||
const CBLAS_TRANSPOSE | transposeA, | |||
const double * | X, | |||
double | beta, | |||
double * | Y | |||
) | [static] |
在文件Mathematics.h第396行定义。
static void display_bits | ( | T | word, | |
int32_t | width = 8*sizeof(T) | |||
) | [static] |
display bits (useful for debugging)
在文件Mathematics.h第945行定义。
void display_matrix | ( | const float64_t * | matrix, | |
int32_t | rows, | |||
int32_t | cols, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第487行定义。
void display_matrix | ( | const int32_t * | matrix, | |
int32_t | rows, | |||
int32_t | cols, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第470行定义。
static void display_matrix | ( | const T * | matrix, | |
int32_t | rows, | |||
int32_t | cols, | |||
const char * | name = "matrix" | |||
) | [static] |
display matrix (useful for debugging)
void display_vector | ( | const float64_t * | vector, | |
int32_t | n, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第460行定义。
void display_vector | ( | const float32_t * | vector, | |
int32_t | n, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第450行定义。
void display_vector | ( | const int64_t * | vector, | |
int32_t | n, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第440行定义。
void display_vector | ( | const int32_t * | vector, | |
int32_t | n, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第430行定义。
void display_vector | ( | const uint8_t * | vector, | |
int32_t | n, | |||
const char * | name | |||
) |
在文件Mathematics.cpp第420行定义。
static void display_vector | ( | const T * | vector, | |
int32_t | n, | |||
const char * | name = "vector" | |||
) | [static] |
display vector (useful for debugging)
compute dot product between v1 and v2
在文件Mathematics.h第664行定义。
static float64_t dot | ( | const uint8_t * | v1, | |
const uint8_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 8bit (un)signed ints)
在文件Mathematics.h第653行定义。
static float64_t dot | ( | const char * | v1, | |
const char * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 8bit (un)signed ints)
在文件Mathematics.h第642行定义。
static float64_t dot | ( | const int16_t * | v1, | |
const int16_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 16bit unsigned ints)
在文件Mathematics.h第631行定义。
static float64_t dot | ( | const uint16_t * | v1, | |
const uint16_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 16bit unsigned ints)
在文件Mathematics.h第620行定义。
static float64_t dot | ( | const uint32_t * | v1, | |
const uint32_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 32bit unsigned ints)
在文件Mathematics.h第609行定义。
static float64_t dot | ( | const int32_t * | v1, | |
const int32_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 32bit ints)
在文件Mathematics.h第598行定义。
static float64_t dot | ( | const int64_t * | v1, | |
const int64_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 64bit ints)
在文件Mathematics.h第587行定义。
static float64_t dot | ( | const uint64_t * | v1, | |
const uint64_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (for 64bit unsigned ints)
在文件Mathematics.h第577行定义。
compute dot product between v1 and v2 (blas optimized)
在文件Mathematics.h第562行定义。
compute dot product between v1 and v2 (blas optimized)
在文件Mathematics.h第548行定义。
static floatmax_t dot | ( | const floatmax_t * | v1, | |
const floatmax_t * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (blas optimized)
在文件Mathematics.h第539行定义。
static float64_t dot | ( | const bool * | v1, | |
const bool * | v2, | |||
int32_t | n | |||
) | [static] |
compute dot product between v1 and v2 (blas optimized)
在文件Mathematics.h第530行定义。
returns entropy of p which is given in logspace
在文件Mathematics.cpp第358行定义。
在文件Mathematics.h第332行定义。
static int64_t factorial | ( | int32_t | n | ) | [static] |
在文件Mathematics.h第407行定义。
static bool fequal | ( | T | x, | |
T | y, | |||
float64_t | precision = 1e-6 | |||
) | [static] |
return sum(abs(vec))
在文件Mathematics.h第737行定义。
static void fill_vector | ( | T * | vec, | |
int32_t | len, | |||
T | value | |||
) | [static] |
在文件Mathematics.h第478行定义。
在文件Mathematics.h第190行定义。
virtual const char* get_name | ( | ) | const [virtual] |
static uint32_t get_seed | ( | ) | [static] |
returns number generator seed
在文件Mathematics.h第1120行定义。
static void init_random | ( | uint32_t | initseed = 0 |
) | [static] |
在文件Mathematics.h第415行定义。
static void insertion_sort | ( | T * | output, | |
int32_t | size | |||
) | [static] |
performs insertion sort of an array output of length size it is sorted from in ascending (for type T)
在文件Mathematics.h第889行定义。
static int is_finite | ( | double | f | ) | [static] |
checks whether a float is finite
在文件Mathematics.h第1126行定义。
static int is_infinity | ( | double | f | ) | [static] |
checks whether a float is infinity
在文件Mathematics.h第1136行定义。
static int is_nan | ( | double | f | ) | [static] |
checks whether a float is nan
在文件Mathematics.h第1149行定义。
在文件Mathematics.h第354行定义。
在文件Mathematics.h第337行定义。
在文件Mathematics.h第343行定义。
sum logarithmic probabilities. Probability measures are summed up but are now given in logspace where direct summation of exp(operand) is not possible due to numerical problems, i.e. eg. exp(-1000)=0. Therefore we do log( exp(a) + exp(b)) = a + log (1 + exp (b-a)) where a = max(p,q) and b min(p,q).
在文件Mathematics.h第1197行定义。
static T max | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
return max(vec)
在文件Mathematics.h第713行定义。
static T max | ( | T | a, | |
T | b | |||
) | [static] |
return the maximum of two integers
在文件Mathematics.h第150行定义。
在文件Mathematics.h第742行定义。
void min | ( | float64_t * | output, | |
T * | index, | |||
int32_t | size | |||
) | [static] |
在文件Mathematics.h第1471行定义。
static T min | ( | T | a, | |
T | b | |||
) | [static] |
return the minimum of two integers
在文件Mathematics.h第143行定义。
returns the mutual information of p which is given in logspace where p,q are given in logspace
在文件Mathematics.cpp第337行定义。
static int64_t nchoosek | ( | int32_t | n, | |
int32_t | k | |||
) | [static] |
在文件Mathematics.h第510行定义。
void nmin | ( | float64_t * | output, | |
T * | index, | |||
int32_t | size, | |||
int32_t | n | |||
) | [static] |
在文件Mathematics.h第1460行定义。
void * parallel_qsort_index | ( | void * | p | ) | [static] |
在文件Mathematics.h第1273行定义。
static void parallel_qsort_index | ( | T1 * | output, | |
T2 * | index, | |||
uint32_t | size, | |||
int32_t | n_threads, | |||
int32_t | limit = 262144 | |||
) | [static] |
performs a quicksort on an array output of length size it is sorted in ascending order (for type T1) and returns the index (type T2) matlab alike [sorted,index]=sort(output)
parallel version
在文件Mathematics.h第996行定义。
float64_t * pinv | ( | float64_t * | matrix, | |
int32_t | rows, | |||
int32_t | cols, | |||
float64_t * | target = NULL | |||
) | [static] |
return the pseudo inverse for matrix when matrix has shape (rows, cols) the pseudo inverse has (cols, rows)
在文件Mathematics.cpp第379行定义。
在文件Mathematics.h第327行定义。
在文件Mathematics.h第317行定义。
static int32_t pow | ( | int32_t | x, | |
int32_t | n | |||
) | [static] |
在文件Mathematics.h第307行定义。
static floatmax_t powl | ( | floatmax_t | x, | |
floatmax_t | n | |||
) | [static] |
x^n
在文件Mathematics.h第296行定义。
static T qnorm | ( | T * | x, | |
int32_t | len, | |||
float64_t | q | |||
) | [static] |
|| x ||_q
在文件Mathematics.h第257行定义。
static void qsort | ( | T * | output, | |
int32_t | size | |||
) | [static] |
performs a quicksort on an array output of length size it is sorted from in ascending (for type T)
在文件Mathematics.h第908行定义。
void qsort_backward_index | ( | T1 * | output, | |
T2 * | index, | |||
int32_t | size | |||
) | [static] |
performs a quicksort on an array output of length size it is sorted in ascending order (for type T1) and returns the index (type T2) matlab alike [sorted,index]=sort(output)
在文件Mathematics.h第1418行定义。
void qsort_index | ( | T1 * | output, | |
T2 * | index, | |||
uint32_t | size | |||
) | [static] |
performs a quicksort on an array output of length size it is sorted in ascending order (for type T1) and returns the index (type T2) matlab alike [sorted,index]=sort(output)
在文件Mathematics.h第1377行定义。
static T qsq | ( | T * | x, | |
int32_t | len, | |||
float64_t | q | |||
) | [static] |
|| x ||_q^q
在文件Mathematics.h第246行定义。
static void radix_sort | ( | T * | array, | |
int32_t | size | |||
) | [static] |
performs a in-place radix sort in ascending order
在文件Mathematics.h第776行定义。
static void radix_sort_helper | ( | T * | array, | |
int32_t | size, | |||
uint16_t | i | |||
) | [static] |
在文件Mathematics.h第788行定义。
在文件Mathematics.h第458行定义。
在文件Mathematics.h第448行定义。
static int32_t random | ( | int32_t | min_value, | |
int32_t | max_value | |||
) | [static] |
在文件Mathematics.h第441行定义。
static int64_t random | ( | ) | [static] |
在文件Mathematics.h第432行定义。
static void random_vector | ( | T * | vec, | |
int32_t | len, | |||
T | min_value, | |||
T | max_value | |||
) | [static] |
在文件Mathematics.h第491行定义。
static int32_t* randperm | ( | int32_t | n | ) | [static] |
在文件Mathematics.h第497行定义。
static void range_fill_vector | ( | T * | vec, | |
int32_t | len, | |||
T | start = 0 | |||
) | [static] |
在文件Mathematics.h第484行定义。
returns the relative entropy H(P||Q), where p,q are given in logspace
在文件Mathematics.cpp第348行定义。
static void resize | ( | T *& | data, | |
int64_t | old_size, | |||
int64_t | new_size | |||
) | [static] |
resize array from old_size to new_size (keeping as much array content as possible intact)
在文件Mathematics.h第222行定义。
在文件Mathematics.h第185行定义。
static void scale_vector | ( | T | alpha, | |
T * | vec, | |||
int32_t | len | |||
) | [static] |
scale vector inplace
在文件Mathematics.h第694行定义。
static T sign | ( | T | a | ) | [static] |
signum of type T variable a
在文件Mathematics.h第202行定义。
void sort | ( | float64_t * | a, | |
int32_t * | idx, | |||
int32_t | N | |||
) | [static] |
在文件Mathematics.cpp第131行定义。
void sort | ( | int32_t * | a, | |
int32_t | cols, | |||
int32_t | sort_col = 0 | |||
) | [static] |
performs a bubblesort on a given matrix a. it is sorted in ascending order from top to bottom and left to right
在文件Mathematics.cpp第111行定义。
static T sq | ( | T | x | ) | [static] |
x^2
在文件Mathematics.h第265行定义。
static floatmax_t sqrt | ( | floatmax_t | x | ) | [static] |
x^0.5
在文件Mathematics.h第283行定义。
x^0.5
在文件Mathematics.h第277行定义。
x^0.5
在文件Mathematics.h第271行定义。
static T sum | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
return sum(vec)
在文件Mathematics.h第702行定义。
static T sum_abs | ( | T * | vec, | |
int32_t | len | |||
) | [static] |
return sum(abs(vec))
在文件Mathematics.h第726行定义。
static void swap | ( | T & | a, | |
T & | b | |||
) | [static] |
swap e.g. floats a and b
在文件Mathematics.h第211行定义。
在文件Mathematics.h第753行定义。
static void transpose_matrix | ( | T *& | matrix, | |
int32_t & | num_feat, | |||
int32_t & | num_vec | |||
) | [static] |
在文件Mathematics.h第360行定义。
static T twonorm | ( | T * | x, | |
int32_t | len | |||
) | [static] |
|| x ||_2
在文件Mathematics.h第235行定义。
static int32_t unique | ( | T * | output, | |
int32_t | size | |||
) | [static] |
在文件Mathematics.h第1028行定义。
static void vec1_plus_scalar_times_vec2 | ( | T * | vec1, | |
T | scalar, | |||
const T * | vec2, | |||
int32_t | n | |||
) | [static] |
x=x+alpha*y
在文件Mathematics.h第522行定义。
const float64_t ALMOST_INFTY = +1e+20 [static] |
在文件Mathematics.h第1248行定义。
const float64_t ALMOST_NEG_INFTY = -1000 [static] |
almost neg (log) infinity
在文件Mathematics.h第1251行定义。
infinity
在文件Mathematics.h第1247行定义。
int32_t LOGRANGE = 0 [static] |
range for logtable: log(1+exp(x)) -LOGRANGE <= x <= 0
在文件Mathematics.h第1254行定义。
char * rand_state = NULL [static] |
在文件Mathematics.h第1258行定义。
uint32_t seed = 0 [static] |
random generator seed
在文件Mathematics.h第1257行定义。