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

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

please refer to examples/math/myMatrxi2D.cpp

37 {
38 
39  // different types
40  rvector vec1;
41 
42  // different ways to initialize vectors and matrices
43 
44  vec1.col[0] = 1.;
45  vec1.col[1] = 0.;
46  vec1.col[2] = 0.;
47 
48  //vec1 = rv_zero(); // initialize with zeros
49 
50  rvector vector1 = {{3.,3.,0.}};
51  rmatrix matrix1 = {{{{11,12,13}},
52  {{21,22,23}},
53  {{31,32,33}}}};
54 
55 
56  //vector1.col[0] = 1.;
57 
58  // multiply matrix by vector
59  //rv_mult()
60 
61  vec1 = rv_mmult(matrix1,vector1);
62 
63  printf("[%11f %11f %11f] \n",vector1.col[0],vector1.col[1],vector1.col[2]);
64 
65  printf("[%11f %11f %11f] \n",vec1.col[0],vec1.col[1],vec1.col[2]);
66 
67  printf("test\n");
68 
70 
71 }
3 element generic row vector
Definition: vector.h:53
3x3 element generic matrix
Definition: matrix.h:41
double col[3]
Definition: vector.h:55
rvector rv_mmult(rmatrix m, rvector v)
Multiply rmatrix by rvector.
Definition: matrix.cpp:41