Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

hippodraw::Numeric Namespace Reference


Detailed Description

Collection of linear algebra functions.


Functions

int allocateMatrix (std::vector< std::vector< double > > &A, int m, int n)
 Allocates a matrix of size m x n.
int allocateVector (std::vector< double > &x, int n)
 Allocates a vector of size n.
int cholBackSolve (const std::vector< std::vector< double > > &L, std::vector< double > &x, const std::vector< double > &b)
 Solves the equation LL'x = b where L is lower triangular matrix.
int cholFactor (std::vector< std::vector< double > > &A)
 The subroutine which does cholesky factorization of a given Symmetric positive definite matrix (say) A.
int eye (std::vector< std::vector< double > > &I, int n)
 Creates an n x n identity matrix for M.
double gammln (double xx)
 Calculates natural log of a gamma function.
double gammq (double a, double x)
 Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance.
void gcf (double *gammcf, double a, double x, double *gln)
 Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance, by using continued fractions.
void gser (double *gamser, double a, double x, double *gln)
 Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance, by using series approximation.
double innerProduct (const std::vector< double > &a, const std::vector< double > &b)
 Computes the dot or the inner product of two vectors(i.e.
int invertMatrix (const std::vector< std::vector< double > > &A, std::vector< std::vector< double > > &Ainv)
 Inverts a SPD matrix a to get inverse Ainv using the cholesky factorization.
double norm (const std::vector< double > &a)
 Computes the two norm of the vector.
std::vector< double > operator * (const std::vector< std::vector< double > > &A, const std::vector< double > &x)
 Computes the Matrix vector product y = Ax.
std::vector< double > operator * (double a, const std::vector< double > &x)
 Given a scalar a and a vector x this function performs operation y = ax.
std::vector< double > operator+ (const std::vector< double > &x, const std::vector< double > &y)
 Given two vectors x and y this function performs operation z = x + y.
std::vector< double > operator- (const std::vector< double > &y)
 Given a vector y this function performs operation z = - y.
std::vector< double > operator- (const std::vector< double > &x, const std::vector< double > &y)
 Given two vectors x and y this function performs operation z = x - y.
std::vector< double > operator/ (const std::vector< double > &x, double a)
 Given a scalar and a vector x this function performs operation y = x/a.
vector< vector< double > > outerProduct (const std::vector< double > &a, const std::vector< double > &b)
 Computes the outer product of two vectors (i.e.
double quadraticProduct (const std::vector< std::vector< double > > &A, const std::vector< double > x)
 Calculates the vector-matrix-vector product x'*A*x.
int write (const std::vector< double > &a)
 Given the vector it writes it to std stream.


Function Documentation

int hippodraw::Numeric::allocateMatrix std::vector< std::vector< double > > &  A,
int  m,
int  n
 

Allocates a matrix of size m x n.

Definition at line 450 of file NumLinAlg.cxx.

int hippodraw::Numeric::allocateVector std::vector< double > &  x,
int  n
 

Allocates a vector of size n.

Definition at line 465 of file NumLinAlg.cxx.

int hippodraw::Numeric::cholBackSolve const std::vector< std::vector< double > > &  L,
std::vector< double > &  x,
const std::vector< double > &  b
 

Solves the equation LL'x = b where L is lower triangular matrix.

Definition at line 323 of file NumLinAlg.cxx.

Referenced by invertMatrix().

int hippodraw::Numeric::cholFactor std::vector< std::vector< double > > &  A  ) 
 

The subroutine which does cholesky factorization of a given Symmetric positive definite matrix (say) A.

It over-writes A by resulting lower triangular matrix

Definition at line 290 of file NumLinAlg.cxx.

References std::sqrt().

Referenced by BFGSFitter::calcCovariance(), and invertMatrix().

int hippodraw::Numeric::eye std::vector< std::vector< double > > &  M,
int  n
 

Creates an n x n identity matrix for M.

Definition at line 403 of file NumLinAlg.cxx.

Referenced by BFGSFitter::calcBestFit().

double hippodraw::Numeric::gammln double  xx  ) 
 

Calculates natural log of a gamma function.

Definition at line 19 of file Gammaq.cxx.

References std::log().

Referenced by gcf(), and gser().

double hippodraw::Numeric::gammq double  a,
double  x
 

Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance.

It internally calls gser and gcf depending on the input range.

Definition at line 111 of file Gammaq.cxx.

References gcf(), and gser().

Referenced by FunctionController::ellipsoidNTuple().

void hippodraw::Numeric::gcf double *  gammcf,
double  a,
double  x,
double *  gln
 

Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance, by using continued fractions.

Definition at line 73 of file Gammaq.cxx.

References std::abs(), EPS, std::exp(), FPMIN, gammln(), ITMAX, and std::log().

Referenced by gammq().

void hippodraw::Numeric::gser double *  gamser,
double  a,
double  x,
double *  gln
 

Calculates Q, the probability that the chi2 should exceed a particilar chi2 (input) by chance, by using series approximation.

Definition at line 38 of file Gammaq.cxx.

References std::abs(), EPS, std::exp(), gammln(), ITMAX, and std::log().

Referenced by gammq().

double hippodraw::Numeric::innerProduct const std::vector< double > &  a,
const std::vector< double > &  b
 

Computes the dot or the inner product of two vectors(i.e.

a'b)

Definition at line 237 of file NumLinAlg.cxx.

Referenced by BFGSFitter::calcBestFit(), and norm().

int hippodraw::Numeric::invertMatrix const std::vector< std::vector< double > > &  A,
std::vector< std::vector< double > > &  Ainv
 

Inverts a SPD matrix a to get inverse Ainv using the cholesky factorization.

It inverts the matrix by repeatedly solving Ax = ei

Definition at line 354 of file NumLinAlg.cxx.

References cholBackSolve(), and cholFactor().

Referenced by LMFitter::calcCovariance(), and FunctionController::ellipsoidNTuple().

double hippodraw::Numeric::norm const std::vector< double > &  a  ) 
 

Computes the two norm of the vector.

Definition at line 283 of file NumLinAlg.cxx.

References innerProduct(), and std::sqrt().

std::vector< double > hippodraw::Numeric::operator * const std::vector< std::vector< double > > &  A,
const std::vector< double > &  x
 

Computes the Matrix vector product y = Ax.

Definition at line 183 of file NumLinAlg.cxx.

std::vector< double > hippodraw::Numeric::operator * double  a,
const std::vector< double > &  x
 

Given a scalar a and a vector x this function performs operation y = ax.

Definition at line 117 of file NumLinAlg.cxx.

std::vector< double > hippodraw::Numeric::operator+ const std::vector< double > &  x,
const std::vector< double > &  y
 

Given two vectors x and y this function performs operation z = x + y.

Definition at line 36 of file NumLinAlg.cxx.

std::vector< double > hippodraw::Numeric::operator- const std::vector< double > &  y  ) 
 

Given a vector y this function performs operation z = - y.

Definition at line 66 of file NumLinAlg.cxx.

std::vector< double > hippodraw::Numeric::operator- const std::vector< double > &  x,
const std::vector< double > &  y
 

Given two vectors x and y this function performs operation z = x - y.

Definition at line 51 of file NumLinAlg.cxx.

std::vector< double > hippodraw::Numeric::operator/ const std::vector< double > &  x,
double  a
 

Given a scalar and a vector x this function performs operation y = x/a.

Definition at line 131 of file NumLinAlg.cxx.

References std::abs().

std::vector< std::vector< double > > hippodraw::Numeric::outerProduct const std::vector< double > &  a,
const std::vector< double > &  b
 

Computes the outer product of two vectors (i.e.

C = ab')

Definition at line 250 of file NumLinAlg.cxx.

Referenced by BFGSFitter::calcBestFit().

double hippodraw::Numeric::quadraticProduct const std::vector< std::vector< double > > &  A,
const std::vector< double >  x
 

Calculates the vector-matrix-vector product x'*A*x.

Definition at line 266 of file NumLinAlg.cxx.

Referenced by FunctionController::ellipsoidNTuple().

int hippodraw::Numeric::write const std::vector< double > &  x  ) 
 

Given the vector it writes it to std stream.

Definition at line 419 of file NumLinAlg.cxx.


Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3