CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
MatrixMath.cpp File Reference
#include <string>
#include <sstream>
#include <vector>
#include <numeric>
#include <math.h>
#include "CoolPropTools.h"
#include "CPExceptions.h"
#include "MatrixMath.h"

Go to the source code of this file.

Functions

void swap_rows (std::vector< std::vector< double > > *A, size_t row1, size_t row2)
 
void subtract_row_multiple (std::vector< std::vector< double > > *A, size_t row, double multiple, size_t pivot_row)
 
void divide_row_by (std::vector< std::vector< double > > *A, size_t row, double value)
 
size_t get_pivot_row (std::vector< std::vector< double > > *A, size_t col)
 
std::vector< std::vector
< double > > 
linsolve_Gauss_Jordan (std::vector< std::vector< double > > const &A, std::vector< std::vector< double > > const &B)
 
std::vector< std::vector
< double > > 
linsolve (std::vector< std::vector< double > > const &A, std::vector< std::vector< double > > const &B)
 
std::vector< double > linsolve (std::vector< std::vector< double > > const &A, std::vector< double > const &b)
 Publish the linear algebra solver. More...
 
std::size_t num_rows (std::vector< std::vector< double > > const &in)
 Some shortcuts and regularly needed operations. More...
 
std::size_t num_cols (std::vector< std::vector< double > > const &in)
 
std::size_t max_cols (std::vector< std::vector< double > > const &in)
 
std::vector< double > get_row (std::vector< std::vector< double > > const &in, size_t row)
 
std::vector< double > get_col (std::vector< std::vector< double > > const &in, size_t col)
 
bool is_squared (std::vector< std::vector< double > > const &in)
 
std::vector< std::vector
< double > > 
make_squared (std::vector< std::vector< double > > const &in)
 
double multiply (std::vector< double > const &a, std::vector< double > const &b)
 Define some basic math operations for vectors. More...
 
std::vector< double > multiply (std::vector< std::vector< double > > const &A, std::vector< double > const &b)
 
std::vector< std::vector
< double > > 
multiply (std::vector< std::vector< double > > const &A, std::vector< std::vector< double > > const &B)
 
double dot_product (std::vector< double > const &a, std::vector< double > const &b)
 
std::vector< double > cross_product (std::vector< double > const &a, std::vector< double > const &b)
 
std::vector< std::vector
< double > > 
transpose (std::vector< std::vector< double > > const &in)
 
std::vector< std::vector
< double > > 
invert (std::vector< std::vector< double > > const &in)
 
std::string vec_to_string (double const &a)
 
std::string vec_to_string (std::vector< double > const &a)
 
std::string vec_to_string (std::vector< double > const &a, const char *fmt)
 
std::string vec_to_string (std::vector< std::vector< double > > const &A)
 
std::string vec_to_string (std::vector< std::vector< double > > const &A, const char *fmt)
 

Function Documentation

std::vector<double> cross_product ( std::vector< double > const &  a,
std::vector< double > const &  b 
)

Definition at line 326 of file MatrixMath.cpp.

void divide_row_by ( std::vector< std::vector< double > > *  A,
size_t  row,
double  value 
)

Definition at line 27 of file MatrixMath.cpp.

double dot_product ( std::vector< double > const &  a,
std::vector< double > const &  b 
)

Definition at line 319 of file MatrixMath.cpp.

std::vector<double> get_col ( std::vector< std::vector< double > > const &  in,
size_t  col 
)

Definition at line 226 of file MatrixMath.cpp.

size_t get_pivot_row ( std::vector< std::vector< double > > *  A,
size_t  col 
)

Definition at line 34 of file MatrixMath.cpp.

std::vector<double> get_row ( std::vector< std::vector< double > > const &  in,
size_t  row 
)

Definition at line 225 of file MatrixMath.cpp.

std::vector< std::vector<double> > invert ( std::vector< std::vector< double > > const &  in)

Definition at line 347 of file MatrixMath.cpp.

bool is_squared ( std::vector< std::vector< double > > const &  in)

Definition at line 239 of file MatrixMath.cpp.

std::vector<std::vector<double> > linsolve ( std::vector< std::vector< double > > const &  A,
std::vector< std::vector< double > > const &  B 
)

Definition at line 185 of file MatrixMath.cpp.

std::vector<double> linsolve ( std::vector< std::vector< double > > const &  A,
std::vector< double > const &  b 
)

Publish the linear algebra solver.

Definition at line 189 of file MatrixMath.cpp.

std::vector<std::vector<double> > linsolve_Gauss_Jordan ( std::vector< std::vector< double > > const &  A,
std::vector< std::vector< double > > const &  B 
)

Definition at line 52 of file MatrixMath.cpp.

std::vector<std::vector<double> > make_squared ( std::vector< std::vector< double > > const &  in)

Definition at line 249 of file MatrixMath.cpp.

std::size_t max_cols ( std::vector< std::vector< double > > const &  in)

Definition at line 216 of file MatrixMath.cpp.

double multiply ( std::vector< double > const &  a,
std::vector< double > const &  b 
)

Define some basic math operations for vectors.

Definition at line 278 of file MatrixMath.cpp.

std::vector<double> multiply ( std::vector< std::vector< double > > const &  A,
std::vector< double > const &  b 
)

Definition at line 282 of file MatrixMath.cpp.

std::vector<std::vector<double> > multiply ( std::vector< std::vector< double > > const &  A,
std::vector< std::vector< double > > const &  B 
)

Definition at line 295 of file MatrixMath.cpp.

std::size_t num_cols ( std::vector< std::vector< double > > const &  in)

Definition at line 205 of file MatrixMath.cpp.

std::size_t num_rows ( std::vector< std::vector< double > > const &  in)

Some shortcuts and regularly needed operations.

Definition at line 204 of file MatrixMath.cpp.

void subtract_row_multiple ( std::vector< std::vector< double > > *  A,
size_t  row,
double  multiple,
size_t  pivot_row 
)

Definition at line 21 of file MatrixMath.cpp.

void swap_rows ( std::vector< std::vector< double > > *  A,
size_t  row1,
size_t  row2 
)

Definition at line 15 of file MatrixMath.cpp.

std::vector< std::vector<double> > transpose ( std::vector< std::vector< double > > const &  in)

Definition at line 330 of file MatrixMath.cpp.

std::string vec_to_string ( double const &  a)

Definition at line 359 of file MatrixMath.cpp.

std::string vec_to_string ( std::vector< double > const &  a)

Definition at line 365 of file MatrixMath.cpp.

std::string vec_to_string ( std::vector< double > const &  a,
const char *  fmt 
)

Definition at line 368 of file MatrixMath.cpp.

std::string vec_to_string ( std::vector< std::vector< double > > const &  A)

Definition at line 384 of file MatrixMath.cpp.

std::string vec_to_string ( std::vector< std::vector< double > > const &  A,
const char *  fmt 
)

Definition at line 388 of file MatrixMath.cpp.