#include <assert.h>
#include <omp.h>
#include <stdio.h>
#include <chrono>
#include <ctime>
#include <stack>
#include <typeinfo>
#include <vector>
#include "common/utils.h"
#include <cblas.h>
Go to the source code of this file.
|
void | tic () |
| start the timer. easy to call as tic(); some code; double t=toc(); More...
|
|
double | toc () |
|
template<class T > |
void | fixNumericalError (T *X, const double prec=EPSILON_1EMINUS16) |
|
template<class T > |
void | fixDecimalPlaces (T *X, const int places=NUMBEROF_DECIMAL_PLACES) |
|
int | random_sieve (const int nthprime) |
|
template<class T > |
void | absmat (T *X) |
|
template<class T > |
void | makeSparse (const double sparsity, T(*X)) |
|
template<class T > |
void | randNMF (const UWORD m, const UWORD n, const UWORD k, const double sparsity, T *A) |
|
template<class T > |
void | printVector (const std::vector< T > &x) |
|
std::vector< std::vector< size_t > > | cartesian_product (const std::vector< std::vector< size_t >> &v) |
|
template<class INPUTTYPE , class LRTYPE > |
double | computeObjectiveError (const INPUTTYPE &A, const LRTYPE &W, const LRTYPE &H) |
|
void | cblas_sgemm (const MAT &A, const MAT &B, double *C) |
|
◆ absmat()
◆ cartesian_product()
std::vector<std::vector<size_t> > cartesian_product |
( |
const std::vector< std::vector< size_t >> & |
v | ) |
|
◆ cblas_sgemm()
void cblas_sgemm |
( |
const MAT & |
A, |
|
|
const MAT & |
B, |
|
|
double * |
C |
|
) |
| |
◆ computeObjectiveError()
template<class INPUTTYPE , class LRTYPE >
double computeObjectiveError |
( |
const INPUTTYPE & |
A, |
|
|
const LRTYPE & |
W, |
|
|
const LRTYPE & |
H |
|
) |
| |
◆ fixDecimalPlaces()
◆ fixNumericalError()
◆ makeSparse()
template<class T >
void makeSparse |
( |
const double |
sparsity, |
|
|
T * |
X |
|
) |
| |
◆ printVector()
template<class T >
void printVector |
( |
const std::vector< T > & |
x | ) |
|
◆ randNMF()
template<class T >
void randNMF |
( |
const UWORD |
m, |
|
|
const UWORD |
n, |
|
|
const UWORD |
k, |
|
|
const double |
sparsity, |
|
|
T * |
A |
|
) |
| |
◆ random_sieve()
int random_sieve |
( |
const int |
nthprime | ) |
|
◆ tic()
start the timer. easy to call as tic(); some code; double t=toc();
Definition at line 42 of file utils.hpp.
◆ toc()
◆ powersof10
Initial value:= {1,
10,
100,
1000,
10000,
100000,
1000000,
10000000,
100000000,
1000000000,
10000000000,
100000000000,
1000000000000,
10000000000000,
100000000000000,
1000000000000000}
Definition at line 20 of file utils.hpp.
◆ tictoc_stack
std::stack<std::chrono::steady_clock::time_point> tictoc_stack |
|
static |
◆ tictoc_stack_omp_clock
std::stack<double> tictoc_stack_omp_clock |
|
static |