Bsoft  2.1.0
Bernard's software package
Matrix3.cpp
Go to the documentation of this file.
1 
9 #include "Matrix3.h"
10 #include "utilities.h"
11 
12 // Declaration of global variables
13 extern int verbose; // Level of output to the screen
14 
15 ostream& operator<<(ostream& output, Matrix3& m) {
16  output.setf(ios::fixed, ios::floatfield);
17 // output.precision(4);
18  for ( long i=0; i<3; i++ )
19  output << m[i] << endl;
20  return output;
21 }
22 
32 {
33  cout << "Matrix:" << endl;
34  cout << mat[0][0] << "," << mat[0][1] << "," << mat[0][2] << " (" <<
35  sqrt(mat[0][0]*mat[0][0]+mat[0][1]*mat[0][1]+mat[0][2]*mat[0][2]) << ")" << endl;
36  cout << mat[1][0] << "," << mat[1][1] << "," << mat[1][2] << " (" <<
37  sqrt(mat[1][0]*mat[1][0]+mat[1][1]*mat[1][1]+mat[1][2]*mat[1][2]) << ")" << endl;
38  cout << mat[2][0] << "," << mat[2][1] << "," << mat[2][2] << " (" <<
39  sqrt(mat[2][0]*mat[2][0]+mat[2][1]*mat[2][1]+mat[2][2]*mat[2][2]) << ")" << endl;
40  cout << " (" << sqrt(mat[0][0]*mat[0][0]+mat[1][0]*mat[1][0]+mat[2][0]*mat[2][0]) << "," <<
41  sqrt(mat[0][1]*mat[0][1]+mat[1][1]*mat[1][1]+mat[2][1]*mat[2][1]) << "," <<
42  sqrt(mat[0][2]*mat[0][2]+mat[1][2]*mat[1][2]+mat[2][2]*mat[2][2]) << ")" << endl;
43 
44  cout << "Determinant = " << mat.determinant() << endl << endl;
45 
46  return 0;
47 }
48 
Matrix3.h
3x3 Matrix manipulation functions
operator<<
ostream & operator<<(ostream &output, Matrix3 &m)
Definition: Matrix3.cpp:15
Matrix3
Definition: Matrix3.h:18
matrix3_show_hp
int matrix3_show_hp(Matrix3 &mat)
Print out a matrix.
Definition: Matrix3.cpp:31
utilities.h
Header file for general utilities.
verbose
int verbose
Matrix3::determinant
double determinant()
Definition: Matrix3.h:260