JSBSim Flight Dynamics Model
1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
|
Handles matrix math operations. More...
#include <FGMatrix33.h>
Public Types | |
enum | { eRows = 3, eColumns = 3 } |
Public Member Functions | |
FGMatrix33 (void) | |
Default initializer. More... | |
FGMatrix33 (const FGMatrix33 &M) | |
Copy constructor. More... | |
FGMatrix33 (const double m11, const double m12, const double m13, const double m21, const double m22, const double m23, const double m31, const double m32, const double m33) | |
Initialization by given values. More... | |
~FGMatrix33 (void) | |
Destructor. | |
unsigned int | Cols (void) const |
Number of cloumns in the matrix. More... | |
double | Determinant (void) const |
Determinant of the matrix. More... | |
std::string | Dump (const std::string &delimeter) const |
Prints the contents of the matrix. More... | |
std::string | Dump (const std::string &delimiter, const std::string &prefix) const |
Prints the contents of the matrix. More... | |
double | Entry (unsigned int row, unsigned int col) const |
Read access the entries of the matrix. More... | |
double & | Entry (unsigned int row, unsigned int col) |
Write access the entries of the matrix. More... | |
FGColumnVector3 | GetEuler () const |
Returns the Euler angle column vector associated with this matrix. | |
FGQuaternion | GetQuaternion (void) const |
Returns the quaternion associated with this direction cosine (rotation) matrix. | |
void | InitMatrix (void) |
Initialize the matrix. More... | |
void | InitMatrix (const double m11, const double m12, const double m13, const double m21, const double m22, const double m23, const double m31, const double m32, const double m33) |
Initialize the matrix. More... | |
FGMatrix33 | Inverse (void) const |
Return the inverse of the matrix. More... | |
bool | Invertible (void) const |
Return if the matrix is invertible. More... | |
double | operator() (unsigned int row, unsigned int col) const |
Read access the entries of the matrix. More... | |
double & | operator() (unsigned int row, unsigned int col) |
Write access the entries of the matrix. More... | |
FGColumnVector3 | operator* (const FGColumnVector3 &v) const |
Matrix vector multiplication. More... | |
FGMatrix33 | operator* (const FGMatrix33 &B) const |
Matrix product. More... | |
FGMatrix33 | operator* (const double scalar) const |
Multiply the matrix with a scalar. More... | |
FGMatrix33 & | operator*= (const FGMatrix33 &B) |
In place matrix multiplication. More... | |
FGMatrix33 & | operator*= (const double scalar) |
In place matrix scale. More... | |
FGMatrix33 | operator+ (const FGMatrix33 &B) const |
Matrix addition. More... | |
FGMatrix33 & | operator+= (const FGMatrix33 &B) |
In place matrix addition. More... | |
FGMatrix33 | operator- (const FGMatrix33 &B) const |
Matrix subtraction. More... | |
FGMatrix33 & | operator-= (const FGMatrix33 &B) |
In place matrix subtraction. More... | |
FGMatrix33 | operator/ (const double scalar) const |
Multiply the matrix with 1.0/scalar. More... | |
FGMatrix33 & | operator/= (const double scalar) |
In place matrix scale. More... | |
FGMatrix33 & | operator= (const FGMatrix33 &A) |
Assignment operator. More... | |
unsigned int | Rows (void) const |
Number of rows in the matrix. More... | |
void | T (void) |
Transposes this matrix. More... | |
FGMatrix33 | Transposed (void) const |
Transposed matrix. More... | |
Handles matrix math operations.
Definition at line 92 of file FGMatrix33.h.
FGMatrix33 | ( | void | ) |
|
inline |
Copy constructor.
M | Matrix which is used for initialization. |
Create copy of the matrix given in the argument.
Definition at line 113 of file FGMatrix33.h.
|
inline |
Initialization by given values.
m11 | value of the 1,1 Matrix element. |
m12 | value of the 1,2 Matrix element. |
m13 | value of the 1,3 Matrix element. |
m21 | value of the 2,1 Matrix element. |
m22 | value of the 2,2 Matrix element. |
m23 | value of the 2,3 Matrix element. |
m31 | value of the 3,1 Matrix element. |
m32 | value of the 3,2 Matrix element. |
m33 | value of the 3,3 Matrix element. |
Create a matrix from the doubles given in the arguments.
Definition at line 140 of file FGMatrix33.h.
|
inline |
Number of cloumns in the matrix.
Definition at line 236 of file FGMatrix33.h.
double Determinant | ( | void | ) | const |
Determinant of the matrix.
Definition at line 219 of file FGMatrix33.cpp.
string Dump | ( | const std::string & | delimeter | ) | const |
Prints the contents of the matrix.
delimeter | the item separator (tab or comma) |
Definition at line 69 of file FGMatrix33.cpp.
string Dump | ( | const std::string & | delimiter, |
const std::string & | prefix | ||
) | const |
Prints the contents of the matrix.
delimeter | the item separator (tab or comma, etc.) |
prefix | an additional prefix that is used to indent the 3X3 matrix printout |
Definition at line 86 of file FGMatrix33.cpp.
|
inline |
Read access the entries of the matrix.
This function is just a shortcut for the double& operator()(unsigned int row, unsigned int col)
function. It is used internally to access the elements in a more convenient way.
Note that the indices given in the arguments are unchecked.
row | Row index. |
col | Column index. |
Definition at line 207 of file FGMatrix33.h.
|
inline |
Write access the entries of the matrix.
This function is just a shortcut for the double& operator()(unsigned int row, unsigned int col)
function. It is used internally to access the elements in a more convenient way.
Note that the indices given in the arguments are unchecked.
row | Row index. |
col | Column index. |
Definition at line 224 of file FGMatrix33.h.
void InitMatrix | ( | void | ) |
Initialize the matrix.
This function initializes a matrix to all 0.0.
Definition at line 257 of file FGMatrix33.cpp.
|
inline |
Initialize the matrix.
This function initializes a matrix to user specified values.
Definition at line 262 of file FGMatrix33.h.
FGMatrix33 Inverse | ( | void | ) | const |
Return the inverse of the matrix.
Computes and returns if the inverse of the matrix. It is computed by Cramers Rule. Also there are no checks performed if the matrix is invertible. If you are not sure that it really is check this with the Invertible() call before.
Definition at line 227 of file FGMatrix33.cpp.
|
inline |
Return if the matrix is invertible.
Checks and returns if the matrix is nonsingular and thus invertible. This is done by simply computing the determinant and check if it is zero. Note that this test does not cover any instabilities caused by nearly singular matirces using finite arithmetics. It only checks exact singularity.
Definition at line 297 of file FGMatrix33.h.
|
inline |
Read access the entries of the matrix.
row | Row index. |
col | Column index. |
Definition at line 177 of file FGMatrix33.h.
|
inline |
Write access the entries of the matrix.
Note that the indices given in the arguments are unchecked.
row | Row index. |
col | Column index. |
Definition at line 190 of file FGMatrix33.h.
FGColumnVector3 operator* | ( | const FGColumnVector3 & | v | ) | const |
Matrix vector multiplication.
v | vector to multiply with. |
Compute and return the product of the current matrix with the vector given in the argument.
Definition at line 489 of file FGMatrix33.cpp.
FGMatrix33 operator* | ( | const FGMatrix33 & | B | ) | const |
Matrix product.
B | matrix to add to. |
Compute and return the product of the current matrix and the matrix B given in the argument.
Definition at line 378 of file FGMatrix33.cpp.
FGMatrix33 operator* | ( | const double | scalar | ) | const |
Multiply the matrix with a scalar.
scalar | scalar factor to multiply with. |
Compute and return the product of the current matrix with the scalar value scalar given in the argument.
Definition at line 331 of file FGMatrix33.cpp.
FGMatrix33 & operator*= | ( | const FGMatrix33 & | B | ) |
In place matrix multiplication.
B | matrix to multiply with. |
Compute the product of the current matrix and the matrix B given in the argument.
Definition at line 397 of file FGMatrix33.cpp.
FGMatrix33 & operator*= | ( | const double | scalar | ) |
In place matrix scale.
scalar | scalar value to multiply with. |
Compute the product of the current matrix and the scalar value scalar given in the argument.
Definition at line 361 of file FGMatrix33.cpp.
FGMatrix33 operator+ | ( | const FGMatrix33 & | B | ) | const |
Matrix addition.
B | matrix to add to. |
Compute and return the sum of the current matrix and the matrix B given in the argument.
Definition at line 299 of file FGMatrix33.cpp.
FGMatrix33 & operator+= | ( | const FGMatrix33 & | B | ) |
In place matrix addition.
B | matrix to add. |
Compute the sum of the current matrix and the matrix B given in the argument.
Definition at line 314 of file FGMatrix33.cpp.
FGMatrix33 operator- | ( | const FGMatrix33 & | B | ) | const |
Matrix subtraction.
B | matrix to add to. |
Compute and return the sum of the current matrix and the matrix B given in the argument.
Definition at line 267 of file FGMatrix33.cpp.
FGMatrix33 & operator-= | ( | const FGMatrix33 & | B | ) |
In place matrix subtraction.
B | matrix to subtract. |
Compute the diffence from the current matrix and the matrix B given in the argument.
Definition at line 282 of file FGMatrix33.cpp.
FGMatrix33 operator/ | ( | const double | scalar | ) | const |
Multiply the matrix with 1.0/scalar.
scalar | scalar factor to divide through. |
Compute and return the product of the current matrix with the scalar value 1.0/scalar, where scalar is given in the argument.
Definition at line 422 of file FGMatrix33.cpp.
FGMatrix33 & operator/= | ( | const double | scalar | ) |
In place matrix scale.
scalar | scalar value to divide through. |
Compute the product of the current matrix and the scalar value 1.0/scalar, where scalar is given in the argument.
Definition at line 447 of file FGMatrix33.cpp.
|
inline |
Assignment operator.
A | source matrix. |
Copy the content of the matrix given in the argument into *this.
Definition at line 313 of file FGMatrix33.h.
|
inline |
Number of rows in the matrix.
Definition at line 231 of file FGMatrix33.h.
void T | ( | void | ) |
Transposes this matrix.
This function only transposes this matrix. Nothing is returned.
Definition at line 470 of file FGMatrix33.cpp.
|
inline |
Transposed matrix.
This function only returns the transpose of this matrix. This matrix itself remains unchanged.
Definition at line 243 of file FGMatrix33.h.