Open CASCADE Technology 6.6.0
Public Member Functions
gp_Mat Class Reference

Describes a three column, three row matrix. This sort of
object is used in various vectorial or matrix computations.

#include <gp_Mat.hxx>

Public Member Functions

 gp_Mat ()
 creates a matrix with null coefficients.

 gp_Mat (const Standard_Real a11, const Standard_Real a12, const Standard_Real a13, const Standard_Real a21, const Standard_Real a22, const Standard_Real a23, const Standard_Real a31, const Standard_Real a32, const Standard_Real a33)
 gp_Mat (const gp_XYZ &Col1, const gp_XYZ &Col2, const gp_XYZ &Col3)
 Creates a matrix.
Col1, Col2, Col3 are the 3 columns of the matrix.

void SetCol (const Standard_Integer Col, const gp_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.

void SetCols (const gp_XYZ &Col1, const gp_XYZ &Col2, const gp_XYZ &Col3)
 Assigns the number triples Col1, Col2, Col3 to the three
columns of this matrix.

void SetCross (const gp_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 SetDiagonal (const Standard_Real X1, const Standard_Real X2, const Standard_Real 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 SetDot (const gp_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 SetIdentity ()
 Modifies this matrix so that it represents the Identity matrix.

void SetRotation (const gp_XYZ &Axis, const Standard_Real 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 SetRow (const Standard_Integer Row, const gp_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.

void SetRows (const gp_XYZ &Row1, const gp_XYZ &Row2, const gp_XYZ &Row3)
 Assigns the number triples Row1, Row2, Row3 to the three
rows of this matrix.

void SetScale (const Standard_Real 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 SetValue (const Standard_Integer Row, const Standard_Integer Col, const Standard_Real 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

gp_XYZ Column (const Standard_Integer Col) const
 Returns the column of Col index.
Raises OutOfRange if Col < 1 or Col > 3

Standard_Real Determinant () const
 Computes the determinant of the matrix.

gp_XYZ Diagonal () const
 Returns the main diagonal of the matrix.

gp_XYZ Row (const Standard_Integer Row) const
 returns the row of Row index.
Raises OutOfRange if Row < 1 or Row > 3

const Standard_RealValue (const Standard_Integer Row, const Standard_Integer Col) const
 Returns the coefficient of range (Row, Col)
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3

const Standard_Realoperator() (const Standard_Integer Row, const Standard_Integer Col) const
Standard_RealChangeValue (const Standard_Integer Row, const Standard_Integer Col)
 Returns the coefficient of range (Row, Col)
Raises OutOfRange if Row < 1 or Row > 3 or Col < 1 or Col > 3

Standard_Realoperator() (const Standard_Integer Row, const Standard_Integer Col)
Standard_Boolean 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.

void Add (const gp_Mat &Other)
void operator+= (const gp_Mat &Other)
gp_Mat Added (const gp_Mat &Other) const
 Computes the sum of this matrix and
the matrix Other for each coefficient of the matrix :
<me>.Coef(i,j) + <Other>.Coef(i,j)

gp_Mat operator+ (const gp_Mat &Other) const
void Divide (const Standard_Real Scalar)
void operator/= (const Standard_Real Scalar)
gp_Mat Divided (const Standard_Real Scalar) const
 Divides all the coefficients of the matrix by Scalar

gp_Mat operator/ (const Standard_Real Scalar) const
void Invert ()
gp_Mat Inverted () const
 Inverses the matrix and raises if the matrix is singular.

gp_Mat Multiplied (const gp_Mat &Other) const
 Computes the product of two matrices <me> * <Other>

gp_Mat operator* (const gp_Mat &Other) const
void Multiply (const gp_Mat &Other)
 Computes the product of two matrices <me> = <Other> * <me>.

void operator*= (const gp_Mat &Other)
void PreMultiply (const gp_Mat &Other)
gp_Mat Multiplied (const Standard_Real Scalar) const
gp_Mat operator* (const Standard_Real Scalar) const
void Multiply (const Standard_Real Scalar)
 Multiplies all the coefficients of the matrix by Scalar

void operator*= (const Standard_Real Scalar)
void Power (const Standard_Integer N)
gp_Mat Powered (const Standard_Integer 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
inversible

void Subtract (const gp_Mat &Other)
void operator-= (const gp_Mat &Other)
gp_Mat Subtracted (const gp_Mat &Other) const
 cOmputes for each coefficient of the matrix :
<me>.Coef(i,j) - <Other>.Coef(i,j)

gp_Mat operator- (const gp_Mat &Other) const
void Transpose ()
gp_Mat Transposed () const
 Transposes the matrix. A(j, i) -> A (i, j)

Standard_Real_CSFDB_Getgp_Matmatrix (const Standard_Integer i1, const Standard_Integer i2)

Constructor & Destructor Documentation

gp_Mat::gp_Mat ( )
gp_Mat::gp_Mat ( const Standard_Real  a11,
const Standard_Real  a12,
const Standard_Real  a13,
const Standard_Real  a21,
const Standard_Real  a22,
const Standard_Real  a23,
const Standard_Real  a31,
const Standard_Real  a32,
const Standard_Real  a33 
)
gp_Mat::gp_Mat ( const gp_XYZ Col1,
const gp_XYZ Col2,
const gp_XYZ Col3 
)

Member Function Documentation

Standard_Real& gp_Mat::_CSFDB_Getgp_Matmatrix ( const Standard_Integer  i1,
const Standard_Integer  i2 
) [inline]
void gp_Mat::Add ( const gp_Mat Other)
gp_Mat gp_Mat::Added ( const gp_Mat Other) const
Standard_Real& gp_Mat::ChangeValue ( const Standard_Integer  Row,
const Standard_Integer  Col 
)
gp_XYZ gp_Mat::Column ( const Standard_Integer  Col) const
Standard_Real gp_Mat::Determinant ( ) const
gp_XYZ gp_Mat::Diagonal ( ) const
void gp_Mat::Divide ( const Standard_Real  Scalar)
gp_Mat gp_Mat::Divided ( const Standard_Real  Scalar) const
void gp_Mat::Invert ( )
gp_Mat gp_Mat::Inverted ( ) const
  • Invert assigns the result to this matrix, while
  • Inverted creates a new one.
    Warning
    The Gauss LU decomposition is used to invert the matrix.
    Consequently, the matrix is considered as singular if the
    largest pivot found is less than or equal to gp::Resolution().
    Exceptions
    Standard_ConstructionError if this matrix is singular,
    and therefore cannot be inverted.
Standard_Boolean gp_Mat::IsSingular ( ) const
gp_Mat gp_Mat::Multiplied ( const Standard_Real  Scalar) const
gp_Mat gp_Mat::Multiplied ( const gp_Mat Other) const
void gp_Mat::Multiply ( const gp_Mat Other)
void gp_Mat::Multiply ( const Standard_Real  Scalar)
const Standard_Real& gp_Mat::operator() ( const Standard_Integer  Row,
const Standard_Integer  Col 
) const [inline]
Standard_Real& gp_Mat::operator() ( const Standard_Integer  Row,
const Standard_Integer  Col 
) [inline]
gp_Mat gp_Mat::operator* ( const gp_Mat Other) const [inline]
gp_Mat gp_Mat::operator* ( const Standard_Real  Scalar) const [inline]
void gp_Mat::operator*= ( const gp_Mat Other) [inline]
void gp_Mat::operator*= ( const Standard_Real  Scalar) [inline]
gp_Mat gp_Mat::operator+ ( const gp_Mat Other) const [inline]
void gp_Mat::operator+= ( const gp_Mat Other) [inline]
gp_Mat gp_Mat::operator- ( const gp_Mat Other) const [inline]
void gp_Mat::operator-= ( const gp_Mat Other) [inline]
gp_Mat gp_Mat::operator/ ( const Standard_Real  Scalar) const [inline]
void gp_Mat::operator/= ( const Standard_Real  Scalar) [inline]
void gp_Mat::Power ( const Standard_Integer  N)
gp_Mat gp_Mat::Powered ( const Standard_Integer  N) const
void gp_Mat::PreMultiply ( const gp_Mat Other)
gp_XYZ gp_Mat::Row ( const Standard_Integer  Row) const
void gp_Mat::SetCol ( const Standard_Integer  Col,
const gp_XYZ Value 
)
void gp_Mat::SetCols ( const gp_XYZ Col1,
const gp_XYZ Col2,
const gp_XYZ Col3 
)
void gp_Mat::SetCross ( const gp_XYZ Ref)
void gp_Mat::SetDiagonal ( const Standard_Real  X1,
const Standard_Real  X2,
const Standard_Real  X3 
)
void gp_Mat::SetDot ( const gp_XYZ Ref)
void gp_Mat::SetIdentity ( )
void gp_Mat::SetRotation ( const gp_XYZ Axis,
const Standard_Real  Ang 
)
void gp_Mat::SetRow ( const Standard_Integer  Row,
const gp_XYZ Value 
)
void gp_Mat::SetRows ( const gp_XYZ Row1,
const gp_XYZ Row2,
const gp_XYZ Row3 
)
void gp_Mat::SetScale ( const Standard_Real  S)
void gp_Mat::SetValue ( const Standard_Integer  Row,
const Standard_Integer  Col,
const Standard_Real  Value 
)
void gp_Mat::Subtract ( const gp_Mat Other)
gp_Mat gp_Mat::Subtracted ( const gp_Mat Other) const
void gp_Mat::Transpose ( )
gp_Mat gp_Mat::Transposed ( ) const
const Standard_Real& gp_Mat::Value ( const Standard_Integer  Row,
const Standard_Integer  Col 
) const

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines