LRAUV  revA
Matrix3x3.h
Go to the documentation of this file.
1 
10 #ifndef MATRIX3X3_H_
11 #define MATRIX3X3_H_
12 
13 #include "I2D.h"
14 #include "Point3D.h"
15 #include "Point6D.h"
16 
27 class Matrix3x3 : public I2D<double>
28 {
29 public:
31  Matrix3x3();
32 
34  Matrix3x3( const double& init );
35 
37  Matrix3x3( const double value11, const double value12, const double value13,
38  const double value21, const double value22, const double value23,
39  const double value31, const double value32, const double value33 );
40 
42  Matrix3x3( Point6D pos );
43 
45  Str toString() const;
46 
48  void transpose();
49 
51  void invert();
52 
54  void decomposeLU();
55 
56  // Solve for x in Ax = b, where this is the LU decompostion of
57  // M and b is supplied here.
58  void solveLU( Point3D& b, Point3D& x ) const;
59 
61  const void mult( Point3D& lhs, Point3D& rhs ) const;
62 
63  bool operator==( const Matrix3x3& rhs );
64 
65  Matrix3x3& operator=( const Matrix3x3& rhs );
66 
67  Matrix3x3& operator=( const double rhs );
68 
69  Matrix3x3& operator+=( const Matrix3x3& rhs );
70 
71  Matrix3x3& operator-=( const Matrix3x3& rhs );
72 
73  Matrix3x3& operator*=( const double rhs );
74 
75  void set( int index1, int index2, const double value );
76 
77  double& operator()( int index1, int index2 );
78 
80  virtual double** getPtr2d()
81  {
82  return value2d_;
83  }
84 
86  virtual double* getPtr1d()
87  {
88  return value_;
89  }
90 
92  virtual int getM() const
93  {
94  return 3;
95  }
96 
98  virtual int getN() const
99  {
100  return 3;
101  }
102 
103 protected:
104 
105  // The actual data
106  double value_[9];
107  double* value2d_[3];
108 };
109 
110 #endif /*MATRIX3X3_H_*/
double * value2d_[3]
Definition: Matrix3x3.h:107
Contains a 3x3 array of double precision floating point numbers, along with methods for performing co...
Definition: Matrix3x3.h:27
Matrix3x3 & operator=(const Matrix3x3 &rhs)
Definition: Matrix3x3.cpp:269
Matrix3x3()
Empty constructior.
Definition: Matrix3x3.cpp:17
void decomposeLU()
Obtain the LU decompostion of this matrix.
Definition: Matrix3x3.cpp:191
void transpose()
Transpose the matrix.
Definition: Matrix3x3.cpp:107
Matrix3x3 & operator-=(const Matrix3x3 &rhs)
Definition: Matrix3x3.cpp:296
Wraps six double precision (8-byte) floating point numbers.
Definition: Point6D.h:31
Contains the Point3D class definition.
Matrix3x3 & operator*=(const double rhs)
Definition: Matrix3x3.cpp:305
void set(int index1, int index2, const double value)
Definition: Matrix3x3.cpp:314
bool operator==(const Matrix3x3 &rhs)
Definition: Matrix3x3.cpp:257
Wraps three double precision (8-byte) floating point numbers.
Definition: Point3D.h:28
void invert()
Invert the matrix.
Definition: Matrix3x3.cpp:114
virtual int getN() const
Implement abstract I2D method.
Definition: Matrix3x3.h:98
Str toString() const
as a Str
Definition: Matrix3x3.cpp:84
Replacement for standard template class string.
Definition: Str.h:12
virtual int getM() const
Implement abstract I2D method.
Definition: Matrix3x3.h:92
Definition: I2D.h:17
virtual double ** getPtr2d()
Implement abstract I2D method.
Definition: Matrix3x3.h:80
double value_[9]
Definition: Matrix3x3.h:106
void solveLU(Point3D &b, Point3D &x) const
Definition: Matrix3x3.cpp:218
double & operator()(int index1, int index2)
Definition: Matrix3x3.cpp:327
Matrix3x3 & operator+=(const Matrix3x3 &rhs)
Definition: Matrix3x3.cpp:287
const void mult(Point3D &lhs, Point3D &rhs) const
Cross-Multiplies two Point3D values and stores the value here.
Definition: Matrix3x3.cpp:249
virtual double * getPtr1d()
Implement abstract I2D method.
Definition: Matrix3x3.h:86
Contains the Point6D class definition.