31 operator + (
const std::vector< double >& x,
const std::vector< double >& y );
36 operator - (
const std::vector< double >& x,
const std::vector< double >& y );
45 std::vector< std::vector< double > >
46 operator + (
const std::vector< std::vector< double > >&A,
47 const std::vector< std::vector< double > >&B );
51 std::vector< std::vector< double > >
52 operator - (
const std::vector< std::vector< double > >&A,
53 const std::vector< std::vector< double > >&B );
58 operator * (
double a,
const std::vector< double >& x );
63 operator / (
const std::vector< double >& x,
double a );
66 std::vector< std::vector< double > >
67 operator * (
double a,
const std::vector< std::vector< double > > & A ) ;
70 std::vector< std::vector< double> >
71 operator / (
const std::vector< std::vector< double> > & A,
double a );
75 operator * (
const std::vector< std::vector< double > > & A,
76 const std::vector< double > & x );
81 const std::vector< std::vector< double > > & A );
84 std::vector< std::vector< double > >
85 operator * (
const std::vector< std::vector< double > >&A,
86 const std::vector< std::vector< double > >&B );
90 const std::vector< double > & b );
93 std::vector< std::vector< double > >
95 const std::vector< double > & b );
99 const std::vector< double > x );
102 double norm(
const std::vector< double > & a );
107 int cholFactor( std::vector< std::vector< double > > & A );
110 int cholBackSolve(
const std::vector< std::vector< double > > & L,
111 std::vector< double > & x,
112 const std::vector< double > & b );
116 int invertMatrix(
const std::vector< std::vector< double > > & A,
117 std::vector< std::vector< double > > & Ainv );
120 int eye( std::vector< std::vector< double > > & M,
int n );
123 int write(
const std::vector< double > & x );
126 int write(
const std::vector< std::vector< double > > & A );
129 int allocateMatrix( std::vector< std::vector< double > >& A,
int m,
int n );
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, const std::vector< double > &y)
Given two vectors x and y this function performs operation z = x + y.
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 allocateMatrix(std::vector< std::vector< double > > &A, int m, int n)
Allocates a matrix of size m x n.
int cholFactor(std::vector< std::vector< double > > &A)
The subroutine which does cholesky factorization of a given Symmetric positive definite matrix (say) ...
vector< vector< double > > outerProduct(const std::vector< double > &a, const std::vector< double > &b)
Computes the outer product of two vectors (i.e.
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 eye(std::vector< std::vector< double > > &I, int n)
Creates an n x n identity matrix for M.
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.
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 quadraticProduct(const std::vector< std::vector< double > > &A, const std::vector< double > x)
Calculates the vector-matrix-vector product x'*A*x.
double norm(const std::vector< double > &a)
Computes the two norm of the vector.
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.
int write(const std::vector< double > &a)
Given the vector it writes it to std stream.
int allocateVector(std::vector< double > &x, int n)
Allocates a vector of size n.