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
MatrixMath.h
Go to the documentation of this file.
1 #ifndef MATRIXMATH_H
2 #define MATRIXMATH_H
3 
4 #include <vector>
5 #include <string>
6 
8  std::vector<double> linsolve(std::vector<std::vector<double> > const& A, std::vector<double> const& b);
9 std::vector<std::vector<double> > linsolve(std::vector<std::vector<double> > const& A, std::vector<std::vector<double> > const& B);
10 
12 std::size_t num_rows (std::vector<std::vector<double> > const& in);
13 std::size_t num_cols (std::vector<std::vector<double> > const& in);
14 std::size_t max_cols (std::vector<std::vector<double> > const& in);
15 std::vector<double> get_row (std::vector<std::vector<double> > const& in, size_t row);
16 std::vector<double> get_col (std::vector<std::vector<double> > const& in, size_t col);
17 bool is_squared(std::vector<std::vector<double> > const& in);
18 std::vector<std::vector<double> > make_squared(std::vector<std::vector<double> > const& in);
19 
21  double multiply( std::vector<double> const& A, std::vector<double> const& B);
22  std::vector<double> multiply(std::vector<std::vector<double> > const& A, std::vector<double> const& B);
23 std::vector<std::vector<double> > multiply(std::vector<std::vector<double> > const& A, std::vector<std::vector<double> > const& B);
24 
25 double dot_product(std::vector<double> const& a, std::vector<double> const& b);
26 std::vector<double> cross_product(std::vector<double> const& a, std::vector<double> const& b);
27 
28 std::vector<std::vector<double> > transpose(std::vector<std::vector<double> > const& in);
29 std::vector<std::vector<double> > invert(std::vector<std::vector<double> > const& in);
30 
31 std::string vec_to_string( double const& a);
32 std::string vec_to_string( std::vector<double> const& a);
33 std::string vec_to_string(std::vector<std::vector<double> > const& A);
34 
35 std::string vec_to_string( std::vector<double> const& a, const char *fmt);
36 std::string vec_to_string(std::vector<std::vector<double> > const& A, const char *fmt);
37 #endif
std::vector< double > linsolve(std::vector< std::vector< double > > const &A, std::vector< double > const &b)
Publish the linear algebra solver.
Definition: MatrixMath.cpp:189
double dot_product(std::vector< double > const &a, std::vector< double > const &b)
Definition: MatrixMath.cpp:319
std::size_t num_rows(std::vector< std::vector< double > > const &in)
Some shortcuts and regularly needed operations.
Definition: MatrixMath.cpp:204
std::string vec_to_string(double const &a)
Definition: MatrixMath.cpp:359
std::vector< std::vector< double > > transpose(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:330
std::vector< std::vector< double > > invert(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:347
std::size_t max_cols(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:216
bool is_squared(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:239
std::vector< std::vector< double > > make_squared(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:249
std::vector< double > get_row(std::vector< std::vector< double > > const &in, size_t row)
Definition: MatrixMath.cpp:225
double multiply(std::vector< double > const &A, std::vector< double > const &B)
Define some basic math operations for vectors.
Definition: MatrixMath.cpp:278
std::vector< double > cross_product(std::vector< double > const &a, std::vector< double > const &b)
Definition: MatrixMath.cpp:326
std::vector< double > get_col(std::vector< std::vector< double > > const &in, size_t col)
Definition: MatrixMath.cpp:226
std::size_t num_cols(std::vector< std::vector< double > > const &in)
Definition: MatrixMath.cpp:205