JSBSim Flight Dynamics Model
1.2.1 (08 Aug 2024)
An Open Source Flight Dynamics and Control Software Library in C++
|
Handles matrix math operations.
Definition at line 69 of file FGMatrix33.h.
#include <FGMatrix33.h>
Public Types | |
enum | { eRows = 3 , eColumns = 3 } |
Public Member Functions | |
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 (const FGMatrix33 &M) | |
Copy constructor. More... | |
FGMatrix33 (void) | |
Default initializer. 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) |
Write access the entries of the matrix. More... | |
double | Entry (unsigned int row, unsigned int col) const |
Read 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 (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... | |
void | InitMatrix (void) |
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) |
Write access the entries of the matrix. More... | |
double | operator() (unsigned int row, unsigned int col) const |
Read access the entries of the matrix. More... | |
FGMatrix33 | operator* (const double scalar) const |
Multiply the matrix with a scalar. 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) |
In place matrix scale. More... | |
FGMatrix33 & | operator*= (const FGMatrix33 &B) |
In place matrix multiplication. 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... | |
FGMatrix33 & | operator= (std::initializer_list< double > lv) |
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... | |
FGMatrix33 | ( | void | ) |
|
inline |
Copy constructor.
M | Matrix which is used for initialization. |
Create copy of the matrix given in the argument.
Definition at line 90 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 117 of file FGMatrix33.h.
|
inline |
Number of cloumns in the matrix.
Definition at line 214 of file FGMatrix33.h.
double Determinant | ( | void | ) | const |
Determinant of the matrix.
Definition at line 221 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 66 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 83 of file FGMatrix33.cpp.
|
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 202 of file FGMatrix33.h.
|
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 185 of file FGMatrix33.h.
|
inline |
Initialize the matrix.
This function initializes a matrix to user specified values.
Definition at line 240 of file FGMatrix33.h.
void InitMatrix | ( | void | ) |
Initialize the matrix.
This function initializes a matrix to all 0.0.
Definition at line 259 of file FGMatrix33.cpp.
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 229 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 275 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 168 of file FGMatrix33.h.
|
inline |
Read access the entries of the matrix.
row | Row index. |
col | Column index. |
Definition at line 155 of file FGMatrix33.h.
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 333 of file FGMatrix33.cpp.
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 481 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 380 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 363 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 399 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 301 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 316 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 269 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 284 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 424 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 444 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 291 of file FGMatrix33.h.
|
inline |
Assignment operator.
lv | initializer list of at most 9 values. |
Copy the content of the list into *this.
Definition at line 310 of file FGMatrix33.h.
|
inline |
Number of rows in the matrix.
Definition at line 209 of file FGMatrix33.h.
void T | ( | void | ) |
Transposes this matrix.
This function only transposes this matrix. Nothing is returned.
Definition at line 462 of file FGMatrix33.cpp.
|
inline |
Transposed matrix.
This function only returns the transpose of this matrix. This matrix itself remains unchanged.
Definition at line 221 of file FGMatrix33.h.