COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
matrix.cpp File Reference
#include "matrix.h"
Include dependency graph for matrix.cpp:

Namespaces

 Cosmos
 
 Cosmos::Math
 
 Cosmos::Math::Matrices
 

Functions

rvector rv_mmult (rmatrix m, rvector v)
 Multiply rmatrix by rvector. More...
 
rvector operator* (rmatrix m, rvector v)
 
rvector rv_diag (rmatrix a)
 Matrix diagonal. More...
 
cvector cv_mmult (cmatrix m, cvector v)
 Multiply cartesian vector by cartesian matrix. More...
 
rmatrix rm_diag (rvector a)
 Diagonal rmatrix Creates an rmatrix whose diagonal is filled with the supplied rvector. More...
 
rmatrix rm_eye ()
 Identity rmatrix. More...
 
rmatrix rm_zero ()
 Zero filled rmatrix. More...
 
double norm_rm (rmatrix mat)
 rmatrix norm. Calculates the Norm of the supplied rmatrix More...
 
double trace_rm (rmatrix mat)
 rmatrix Trace Calculates the trace of the supplied rmatrix. More...
 
rmatrix rm_transpose (rmatrix a)
 rmatrix Transpose. Calculate the transpose of the supplied rmatrix. More...
 
rmatrix rm_mmult (rmatrix a, rmatrix b)
 rmatrix Matrix Product More...
 
rmatrix rm_mult (rmatrix a, rmatrix b)
 Element-wise rmatrix multiplication. More...
 
rmatrix rm_smult (double a, rmatrix b)
 Scalar rmatrix multiplication. More...
 
rmatrix rm_add (rmatrix a, rmatrix b)
 rmatrix addition. Sum of two rmatrix values. More...
 
rmatrix rm_sub (rmatrix a, rmatrix b)
 rmatrix subtraction. Subtract two rmatrix values. More...
 
rmatrix rm_square (rmatrix a)
 Square rmatrix. More...
 
rmatrix rm_change_around_x (double angle)
 Rotation matrix for X axis. More...
 
rmatrix rm_change_around_y (double angle)
 Rotation matrix for Y axis. More...
 
rmatrix rm_change_around_z (double angle)
 Rotation matrix for Z axis. More...
 
rmatrix rm_change_around (int axis, double angle)
 Rotation matrix for indicated axis. More...
 
cmatrix cm_from_rm (rmatrix matrix)
 cmatrix from rmatrix More...
 
cmatrix cm_diag (cvector a)
 Diagonal cmatrix Creates an cmatrix whose diagonal is filled with the supplied cvector. More...
 
cmatrix cm_eye ()
 Identity cmatrix. More...
 
cmatrix cm_zero ()
 Zero filled cmatrix. More...
 
double norm_cm (cmatrix mat)
 cmatrix norm. Calculates the Norm of the supplied cmatrix More...
 
double trace_cm (cmatrix mat)
 cmatrix Trace Calculates the trace of the supplied cmatrix. More...
 
cmatrix cm_transpose (cmatrix a)
 cmatrix Transpose. Calculate the transpose of the supplied cmatrix. More...
 
cvector cv_diag (cmatrix a)
 Matrix diagonal. More...
 
cmatrix cm_mmult (cmatrix a, cmatrix b)
 cmatrix Matrix Product More...
 
cmatrix cm_mult (cmatrix a, cmatrix b)
 Element-wise cmatrix multiplication. More...
 
cmatrix cm_smult (double a, cmatrix b)
 Scalar cmatrix multiplication. More...
 
cmatrix cm_add (cmatrix a, cmatrix b)
 cmatrix addition. Sum of two cmatrix values. More...
 
cmatrix cm_sub (cmatrix a, cmatrix b)
 cmatrix subtraction. Subtract two cmatrix values. More...
 
cmatrix cm_square (cmatrix a)
 Square cmatrix. More...
 
cmatrix cm_change_around_x (double angle)
 Rotation matrix for X axis. More...
 
cmatrix cm_change_around_y (double angle)
 Rotation matrix for Y axis. More...
 
cmatrix cm_change_around_z (double angle)
 Rotation matrix for Z axis. More...
 
cmatrix cm_change_around (int axis, double angle)
 Rotation matrix for indicated axis. More...
 
rmatrix rm_from_cm (cmatrix matrix)
 rmatrix from cmatrix More...
 
rmatrix rm_from_rv (rvector vector, int direction)
 rvector to rmatrix. More...
 
rmatrix rm_skew (rvector row)
 Create skew symmetric rmatrix from rvector. More...
 
rvector rv_unskew (rmatrix matrix)
 Unskew 3x3 row matrix. More...
 
rmatrix rm_inverse (rmatrix m)
 Inverse of rmatrix. More...
 
rmatrix rm_from_m2 (matrix2d matrix)
 rmatrix from matrix2d More...
 
double determinant_rm (rmatrix m)
 Determinant of row column matrix. More...
 
matrix1d m1_zero (uint16_t cols)
 Fill 1D matrix with zeros. More...
 
matrix1d m1_smult (double number, matrix1d row)
 Multiply 1D matrix by a scalar. More...
 
matrix1d m1_add (matrix1d row1, matrix1d row2)
 Add one 1D matrix to another. More...
 
matrix1d m1_sub (matrix1d row1, matrix1d row2)
 Subtract one 1D matrix from another. More...
 
matrix1d m1_mmult (matrix2d Matrix, matrix1d Vector)
 Multiply matrix1d by matrix2d. More...
 
matrix1d m1_cross (matrix1d Vector1, matrix1d Vector2)
 matrix1d cross product More...
 
double m1_dot (matrix1d a, matrix1d b)
 matrix1d dot product More...
 
matrix2d m2_skew (matrix1d row)
 Create skew symmetric matrix2d from matrix1d. More...
 
matrix2d m2_diag (matrix1d row)
 Create diagonal matrix2d from matrix1d. More...
 
matrix2d m2_inverse (matrix2d m)
 Inverse of matrix2d. More...
 
double m2_determinant (matrix2d m)
 Determinant of a 2D matrix. More...
 
double m1_norm (matrix1d row)
 Compute the Euclidean norm of a 1D matrix. More...
 
matrix2d m2_zero (uint16_t rows, uint16_t cols)
 Create 2D zero matrix. More...
 
matrix2d m2_eye (uint16_t rows)
 Create 2D identity matrix. More...
 
matrix2d m2_smult (double number, matrix2d matrix)
 Multiply 2D matrix by a scalar. More...
 
matrix2d m2_add (matrix2d matrix1, matrix2d matrix2)
 Add one matrix2d to another. More...
 
matrix2d m2_sub (matrix2d matrix1, matrix2d matrix2)
 Subtract one matrix2d from another. More...
 
matrix2d m2_transpose (matrix2d matrix)
 Return transpose of a 2D matrix. More...
 
matrix1d m2_unskew (matrix2d matrix)
 Unskew 3x3 2D matrix. More...
 
double m2_trace (matrix2d matrix)
 Calculate the trace of a 2D matrix. More...
 
matrix2d m2_mmult (matrix2d matrix1, matrix2d matrix2)
 Matrix product. More...
 
matrix2d m2_from_rm (rmatrix matrix)
 rmatrix from rmatrix More...
 
matrix2d cm3x3_to_m2 (cmatrix matrix)
 
matrix1d cv_to_m1 (cvector vector)
 
matrix2d cv_to_m2 (cvector vector, int direction)
 
matrix2d m1_to_m2 (matrix1d vector, int direction)
 Matrix1d to matrix2d. More...
 
matrix1d m2_eig2x2 (matrix2d matrix)
 Eigen values of a 2x2 square matrix. More...
 
double m2_snorm2x2 (matrix2d matrix)
 Spectral norm of a 2x2 matrix. More...
 
std::ostream & operator<< (std::ostream &out, const rmatrix &a)
 
std::ostream & operator<< (std::ostream &out, const vector< rmatrix > &a)
 
std::istream & operator>> (std::istream &in, rmatrix &a)
 
std::ostream & operator<< (std::ostream &out, const cmatrix &a)
 
std::istream & operator>> (std::istream &in, cmatrix &a)
 
Matrix Cosmos::Math::Matrices::operator* (const double scale, const Matrix &m)
 Reverse scalar product. More...
 
Matrix Cosmos::Math::Matrices::eye (double scale)
 Scaled Identity ::Matrix. More...
 

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const rmatrix a 
)
1633 {
1634  out.precision(15);
1635  out << "[" << a.row[0].col[0] << "," << a.row[0].col[1] << "," << a.row[0].col[2] << ";";
1636  out << a.row[1].col[0] << "," << a.row[1].col[1] << "," << a.row[1].col[2] << ";";
1637  out << a.row[2].col[0] << "," << a.row[2].col[1] << "," << a.row[2].col[2] << "]";
1638  return out;
1639 }
double col[3]
Definition: vector.h:55
rvector row[3]
Definition: matrix.h:43
std::ostream& operator<< ( std::ostream &  out,
const vector< rmatrix > &  a 
)
1642 {
1643  for(vector<rmatrix>::const_iterator I = a.begin(); I != a.end(); ++I)
1644  out<<*I<<"\t";
1645  return out;
1646 }
Definition: eci2kep_test.cpp:33
std::istream& operator>> ( std::istream &  in,
rmatrix a 
)
1649 {
1650  char junk;
1651  in >> junk >> a.row[0].col[0] >> junk >> a.row[0].col[1] >> junk >> a.row[0].col[2] >> junk
1652  >> a.row[1].col[0] >> junk >> a.row[1].col[1] >> junk >> a.row[1].col[2] >> junk
1653  >> a.row[2].col[0] >> junk >> a.row[2].col[1] >> junk >> a.row[2].col[2] >> junk;
1654  return in;
1655 }
double col[3]
Definition: vector.h:55
rvector row[3]
Definition: matrix.h:43
std::ostream& operator<< ( std::ostream &  out,
const cmatrix a 
)
1660 {
1661  out << "[" << a.r1.x << "," << a.r1.y << "," << a.r1.z << ";\n"
1662  << a.r2.x << "," << a.r2.y << "," << a.r2.z << ";\n"
1663  << a.r3.x << "," << a.r3.y << "," << a.r3.z << "]";
1664  return out;
1665 }
double y
Y value.
Definition: vector.h:114
cvector r1
Row 1.
Definition: matrix.h:99
double x
X value.
Definition: vector.h:112
double z
Z value.
Definition: vector.h:116
cvector r3
Row 3.
Definition: matrix.h:103
cvector r2
Row 2.
Definition: matrix.h:101
std::istream& operator>> ( std::istream &  in,
cmatrix a 
)
1668 {
1669  char junk;
1670  in >> junk >> a.r1.x >> junk >> a.r1.y >> junk >> a.r1.z >> junk
1671  >> a.r2.x >> junk >> a.r2.y >> junk >> a.r2.z >> junk
1672  >> a.r3.x >> junk >> a.r3.y >> junk >> a.r3.z >> junk;
1673  return in;
1674 }
double y
Y value.
Definition: vector.h:114
cvector r1
Row 1.
Definition: matrix.h:99
double x
X value.
Definition: vector.h:112
double z
Z value.
Definition: vector.h:116
cvector r3
Row 3.
Definition: matrix.h:103
cvector r2
Row 2.
Definition: matrix.h:101