OpenLexocad
27.0
|
#include <Mat.h>
Public Member Functions | |
Mat () | |
creates a matrix with null coefficients. More... | |
Mat (const double a11, const double a12, const double a13, const double a21, const double a22, const double a23, const double a31, const double a32, const double a33) | |
Mat (const XYZ &Col1, const XYZ &Col2, const XYZ &Col3) | |
void | setCol (const int Col, const XYZ &Value) |
void | setCols (const XYZ &Col1, const XYZ &Col2, const XYZ &Col3) |
void | setCross (const XYZ &Ref) |
void | setDiagonal (const double X1, const double X2, const double X3) |
void | setDot (const XYZ &Ref) |
void | setIdentity () |
Modifies this matrix so that it represents the Identity matrix. More... | |
bool | isIdentity () const |
Returns true if this matrix represents the Identity matrix. More... | |
void | setRotation (const XYZ &Axis, const double Ang) |
void | setRow (const int Row, const XYZ &Value) |
void | setRows (const XYZ &Row1, const XYZ &Row2, const XYZ &Row3) |
void | setScale (const double S) |
void | setValue (const int Row, const int Col, const double Value) |
XYZ | column (const int Col) const |
double | determinant () const |
Computes the determinant of the matrix. More... | |
XYZ | diagonal () const |
Returns the main diagonal of the matrix. More... | |
XYZ | row (const int Row) const |
const double & | value (const int Row, const int Col) const |
const double & | operator() (const int Row, const int Col) const |
double & | changeValue (const int Row, const int Col) |
double & | operator() (const int Row, const int Col) |
bool | isSingular () const |
void | add (const Mat &Other) |
void | operator+= (const Mat &Other) |
Mat | added (const Mat &Other) const |
Mat | operator+ (const Mat &Other) const |
void | divide (const double Scalar) |
void | operator/= (const double Scalar) |
Mat | divided (const double Scalar) const |
Divides all the coefficients of the matrix by Scalar More... | |
Mat | operator/ (const double Scalar) const |
void | invert () |
Mat | inverted () const |
Mat | multiplied (const Mat &Other) const |
Computes the product of two matrices <me> * <Other> More... | |
Mat | operator * (const Mat &Other) const |
void | multiply (const Mat &Other) |
Computes the product of two matrices <me> = <Other> * <me>. More... | |
void | operator *= (const Mat &Other) |
void | preMultiply (const Mat &Other) |
Mat | multiplied (const double Scalar) const |
Mat | operator * (const double Scalar) const |
void | multiply (const double Scalar) |
Multiplies all the coefficients of the matrix by Scalar More... | |
void | operator *= (const double Scalar) |
void | power (const int N) |
Mat | powered (const int N) const |
void | subtract (const Mat &Other) |
void | operator-= (const Mat &Other) |
Mat | subtracted (const Mat &Other) const |
Mat | operator- (const Mat &Other) const |
bool | operator== (const Mat &Other) const |
bool | operator!= (const Mat &Other) const |
void | transpose () |
Mat | transposed () const |
Transposes the matrix. A(j, i) -> A (i, j) More... | |
Geom::XYZ | computeEulerAngles () const |
Friends | |
class | XYZ |
class | CA_Transfrom |
class | gp_GTrsf |
class | Geom::GTrsf |
Describes a three column, three row matrix. This sort of
object is used in various vectorial or matrix computations.
Geom::Mat::Mat | ( | ) |
creates a matrix with null coefficients.
Geom::Mat::Mat | ( | const double | a11, |
const double | a12, | ||
const double | a13, | ||
const double | a21, | ||
const double | a22, | ||
const double | a23, | ||
const double | a31, | ||
const double | a32, | ||
const double | a33 | ||
) |
Creates a matrix.
Col1, Col2, Col3 are the 3 columns of the matrix.
void Geom::Mat::add | ( | const Mat & | Other | ) |
Computes the sum of this matrix and
the matrix Other for each coefficient of the matrix :
<me>.Coef(i,j) + <Other>.Coef(i,j)
double& Geom::Mat::changeValue | ( | const int | Row, |
const int | Col | ||
) |
Returns the coefficient of range (Row, Col)
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3
XYZ Geom::Mat::column | ( | const int | Col | ) | const |
Returns the column of Col index.
Raises OutOfRange if Col < 1 or Col > 3
Geom::XYZ Geom::Mat::computeEulerAngles | ( | ) | const |
double Geom::Mat::determinant | ( | ) | const |
Computes the determinant of the matrix.
XYZ Geom::Mat::diagonal | ( | ) | const |
Returns the main diagonal of the matrix.
void Geom::Mat::divide | ( | const double | Scalar | ) |
Mat Geom::Mat::divided | ( | const double | Scalar | ) | const |
Divides all the coefficients of the matrix by Scalar
void Geom::Mat::invert | ( | ) |
Mat Geom::Mat::inverted | ( | ) | const |
Inverses the matrix and raises if the matrix is singular.
bool Geom::Mat::isIdentity | ( | ) | const |
Returns true if this matrix represents the Identity matrix.
bool Geom::Mat::isSingular | ( | ) | const |
The Gauss LU decomposition is used to invert the matrix
(see Math package) so the matrix is considered as singular if
the largest pivot found is lower or equal to Resolution from gp.
Computes the product of two matrices <me> * <Other>
Mat Geom::Mat::multiplied | ( | const double | Scalar | ) | const |
void Geom::Mat::multiply | ( | const Mat & | Other | ) |
Computes the product of two matrices <me> = <Other> * <me>.
void Geom::Mat::multiply | ( | const double | Scalar | ) |
Multiplies all the coefficients of the matrix by Scalar
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool Geom::Mat::operator== | ( | const Mat & | Other | ) | const |
void Geom::Mat::power | ( | const int | N | ) |
Mat Geom::Mat::powered | ( | const int | N | ) | const |
Computes <me> = <me> * <me> * .......* <me>, N time.
if N = 0 <me> = Identity
if N < 0 <me> = <me>.Invert() *...........* <me>.Invert().
If N < 0 an exception will be raised if the matrix is not
invertible
void Geom::Mat::preMultiply | ( | const Mat & | Other | ) |
XYZ Geom::Mat::row | ( | const int | Row | ) | const |
returns the row of Row index.
Raises OutOfRange if Row < 1 or Row > 3
void Geom::Mat::setCol | ( | const int | Col, |
const XYZ & | Value | ||
) |
Assigns the three coordinates of Value to the column of index
Col of this matrix.
Raises OutOfRange if Col < 1 or Col > 3.
Assigns the number triples Col1, Col2, Col3 to the three
columns of this matrix.
void Geom::Mat::setCross | ( | const XYZ & | Ref | ) |
Modifies the matrix M so that applying it to any number
triple (X, Y, Z) produces the same result as the cross
product of Ref and the number triple (X, Y, Z):
i.e.: M * {X,Y,Z}t = Ref.Cross({X, Y ,Z})
this matrix is anti symmetric. To apply this matrix to the
triplet {XYZ} is the same as to do the cross product between the
triplet Ref and the triplet {XYZ}.
Note: this matrix is anti-symmetric.
void Geom::Mat::setDiagonal | ( | const double | X1, |
const double | X2, | ||
const double | X3 | ||
) |
Modifies the main diagonal of the matrix.
<me>.Value (1, 1) = X1
<me>.Value (2, 2) = X2
<me>.Value (3, 3) = X3
The other coefficients of the matrix are not modified.
void Geom::Mat::setDot | ( | const XYZ & | Ref | ) |
Modifies this matrix so that applying it to any number
triple (X, Y, Z) produces the same result as the scalar
product of Ref and the number triple (X, Y, Z):
this * (X,Y,Z) = Ref.(X,Y,Z)
Note: this matrix is symmetric.
void Geom::Mat::setIdentity | ( | ) |
Modifies this matrix so that it represents the Identity matrix.
void Geom::Mat::setRotation | ( | const XYZ & | Axis, |
const double | Ang | ||
) |
Modifies this matrix so that it represents a rotation. Ang is the angular value in
radians and the XYZ axis gives the direction of the
rotation.
Raises ConstructionError if XYZ.Modulus() <= Resolution()
void Geom::Mat::setRow | ( | const int | Row, |
const XYZ & | Value | ||
) |
Assigns the three coordinates of Value to the row of index
Row of this matrix. Raises OutOfRange if Row < 1 or Row > 3.
Assigns the number triples Row1, Row2, Row3 to the three
rows of this matrix.
void Geom::Mat::setScale | ( | const double | S | ) |
Modifies the the matrix so that it represents
a scaling transformation, where S is the scale factor. :
| S 0.0 0.0 |
<me> = | 0.0 S 0.0 |
| 0.0 0.0 S |
void Geom::Mat::setValue | ( | const int | Row, |
const int | Col, | ||
const double | Value | ||
) |
Assigns
to the coefficient of row Row, column Col of this matrix.
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3
void Geom::Mat::subtract | ( | const Mat & | Other | ) |
cOmputes for each coefficient of the matrix :
<me>.Coef(i,j) - <Other>.Coef(i,j)
void Geom::Mat::transpose | ( | ) |
Mat Geom::Mat::transposed | ( | ) | const |
Transposes the matrix. A(j, i) -> A (i, j)
const double& Geom::Mat::value | ( | const int | Row, |
const int | Col | ||
) | const |
Returns the coefficient of range (Row, Col)
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3
|
friend |
|
friend |
|
friend |
|
friend |