planc
Parallel Lowrank Approximation with Non-negativity Constraints
Macros | Typedefs | Enumerations | Functions
utils.h File Reference
#include <armadillo>
#include <cmath>
#include <iostream>
#include <vector>

Go to the source code of this file.

Macros

#define ARMA_DONT_USE_WRAPPER
 
#define ARMA_USE_BLAS
 
#define ARMA_USE_LAPACK
 
#define ERR   std::cerr
 
#define WARN   std::cerr
 
#define INFO   std::cout
 
#define OUTPUT   std::cout
 
#define EPSILON_1EMINUS16   0.00000000000000001
 
#define EPSILON   0.000001
 
#define EPSILON_1EMINUS12   1e-12
 
#define NUMBEROF_DECIMAL_PLACES   12
 
#define RAND_SEED   100
 
#define RAND_SEED_SPARSE   100
 
#define FMAT   arma::fmat
 
#define MAT   arma::mat
 
#define FROWVEC   arma::frowvec
 
#define ROWVEC   arma::rowvec
 
#define FVEC   arma::fvec
 
#define SP_FMAT   arma::sp_fmat
 
#define SP_MAT   arma::sp_mat
 
#define UVEC   arma::uvec
 
#define IVEC   arma::ivec
 
#define UWORD   arma::uword
 
#define VEC   arma::vec
 
#define PRINTMATINFO(A)   "::" #A "::" << (A).n_rows << "x" << (A).n_cols
 
#define PRINTMAT(A)   PRINTMATINFO((A)) << endl << (A)
 

Typedefs

typedef std::vector< int > STDVEC
 
typedef unsigned int UINT
 
typedef unsigned long ULONG
 

Enumerations

enum  algotype {
  MU, HALS, ANLSBPP, NAIVEANLSBPP,
  AOADMM, NESTEROV, CPALS
}
 
enum  normtype { NONE, L2NORM, MAXNORM }
 

Functions

void absmat (const FMAT *X)
 
void tic ()
 start the timer. easy to call as tic(); some code; double t=toc(); More...
 
double toc ()
 
int random_sieve (const int)
 
template<typename FVT >
void fillVector (const FVT value, std::vector< FVT > *a)
 

Macro Definition Documentation

◆ ARMA_DONT_USE_WRAPPER

#define ARMA_DONT_USE_WRAPPER

Definition at line 16 of file utils.h.

◆ ARMA_USE_BLAS

#define ARMA_USE_BLAS

Definition at line 17 of file utils.h.

◆ ARMA_USE_LAPACK

#define ARMA_USE_LAPACK

Definition at line 18 of file utils.h.

◆ EPSILON

#define EPSILON   0.000001

Definition at line 44 of file utils.h.

◆ EPSILON_1EMINUS12

#define EPSILON_1EMINUS12   1e-12

Definition at line 45 of file utils.h.

◆ EPSILON_1EMINUS16

#define EPSILON_1EMINUS16   0.00000000000000001

Definition at line 43 of file utils.h.

◆ ERR

#define ERR   std::cerr

Definition at line 28 of file utils.h.

◆ FMAT

#define FMAT   arma::fmat

Definition at line 51 of file utils.h.

◆ FROWVEC

#define FROWVEC   arma::frowvec

Definition at line 53 of file utils.h.

◆ FVEC

#define FVEC   arma::fvec

Definition at line 55 of file utils.h.

◆ INFO

#define INFO   std::cout

Definition at line 36 of file utils.h.

◆ IVEC

#define IVEC   arma::ivec

Definition at line 59 of file utils.h.

◆ MAT

#define MAT   arma::mat

Definition at line 52 of file utils.h.

◆ NUMBEROF_DECIMAL_PLACES

#define NUMBEROF_DECIMAL_PLACES   12

Definition at line 46 of file utils.h.

◆ OUTPUT

#define OUTPUT   std::cout

Definition at line 40 of file utils.h.

◆ PRINTMAT

#define PRINTMAT (   A)    PRINTMATINFO((A)) << endl << (A)

Definition at line 65 of file utils.h.

◆ PRINTMATINFO

#define PRINTMATINFO (   A)    "::" #A "::" << (A).n_rows << "x" << (A).n_cols

Definition at line 63 of file utils.h.

◆ RAND_SEED

#define RAND_SEED   100

Definition at line 47 of file utils.h.

◆ RAND_SEED_SPARSE

#define RAND_SEED_SPARSE   100

Definition at line 48 of file utils.h.

◆ ROWVEC

#define ROWVEC   arma::rowvec

Definition at line 54 of file utils.h.

◆ SP_FMAT

#define SP_FMAT   arma::sp_fmat

Definition at line 56 of file utils.h.

◆ SP_MAT

#define SP_MAT   arma::sp_mat

Definition at line 57 of file utils.h.

◆ UVEC

#define UVEC   arma::uvec

Definition at line 58 of file utils.h.

◆ UWORD

#define UWORD   arma::uword

Definition at line 60 of file utils.h.

◆ VEC

#define VEC   arma::vec

Definition at line 61 of file utils.h.

◆ WARN

#define WARN   std::cerr

Definition at line 32 of file utils.h.

Typedef Documentation

◆ STDVEC

typedef std::vector<int> STDVEC

Definition at line 67 of file utils.h.

◆ UINT

typedef unsigned int UINT

Definition at line 68 of file utils.h.

◆ ULONG

typedef unsigned long ULONG

Definition at line 69 of file utils.h.

Enumeration Type Documentation

◆ algotype

enum algotype
Enumerator
MU 
HALS 
ANLSBPP 
NAIVEANLSBPP 
AOADMM 
NESTEROV 
CPALS 

Definition at line 10 of file utils.h.

◆ normtype

enum normtype
Enumerator
NONE 
L2NORM 
MAXNORM 

Definition at line 12 of file utils.h.

Function Documentation

◆ absmat()

void absmat ( const FMAT X)

◆ fillVector()

template<typename FVT >
void fillVector ( const FVT  value,
std::vector< FVT > *  a 
)
inline

Definition at line 79 of file utils.h.

◆ random_sieve()

int random_sieve ( const int  )

Definition at line 74 of file utils.hpp.

◆ tic()

void tic ( )
inline

start the timer. easy to call as tic(); some code; double t=toc();

Definition at line 42 of file utils.hpp.

◆ toc()

double toc ( )
inline

Definition at line 48 of file utils.hpp.