Open CASCADE Technology  7.4.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. More...

#include <gp_Mat.hxx>

Public Member Functions

 gp_Mat ()
 creates a matrix with null coefficients. More...
 
 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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void SetIdentity ()
 Modifies this matrix so that it represents the Identity matrix. More...
 
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() More...
 
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. More...
 
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. More...
 
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 |. More...
 
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. More...
 
gp_XYZ Column (const Standard_Integer Col) const
 Returns the column of Col index. Raises OutOfRange if Col < 1 or Col > 3. More...
 
Standard_Real Determinant () const
 Computes the determinant of the matrix. More...
 
gp_XYZ Diagonal () const
 Returns the main diagonal of the matrix. More...
 
gp_XYZ Row (const Standard_Integer Row) const
 returns the row of Row index. Raises OutOfRange if Row < 1 or Row > 3 More...
 
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. More...
 
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. More...
 
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. More...
 
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) More...
 
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. More...
 
gp_Mat operator/ (const Standard_Real Scalar) const
 
void Invert ()
 
gp_Mat Inverted () const
 Inverses the matrix and raises if the matrix is singular. More...
 
gp_Mat Multiplied (const gp_Mat &Other) const
 Computes the product of two matrices <me> * <Other> More...
 
gp_Mat operator* (const gp_Mat &Other) const
 
void Multiply (const gp_Mat &Other)
 Computes the product of two matrices <me> = <Other> * <me>. More...
 
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. More...
 
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. More...
 
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) More...
 
gp_Mat operator- (const gp_Mat &Other) const
 
void Transpose ()
 
gp_Mat Transposed () const
 Transposes the matrix. A(j, i) -> A (i, j) More...
 
void DumpJson (Standard_OStream &theOStream, const Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ gp_Mat() [1/3]

gp_Mat::gp_Mat ( )

creates a matrix with null coefficients.

◆ gp_Mat() [2/3]

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() [3/3]

gp_Mat::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.

Member Function Documentation

◆ Add()

void gp_Mat::Add ( const gp_Mat Other)

◆ Added()

gp_Mat 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)

◆ ChangeValue()

Standard_Real& gp_Mat::ChangeValue ( 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.

◆ Column()

gp_XYZ gp_Mat::Column ( const Standard_Integer  Col) const

Returns the column of Col index. Raises OutOfRange if Col < 1 or Col > 3.

◆ Determinant()

Standard_Real gp_Mat::Determinant ( ) const

Computes the determinant of the matrix.

◆ Diagonal()

gp_XYZ gp_Mat::Diagonal ( ) const

Returns the main diagonal of the matrix.

◆ Divide()

void gp_Mat::Divide ( const Standard_Real  Scalar)

◆ Divided()

gp_Mat gp_Mat::Divided ( const Standard_Real  Scalar) const

Divides all the coefficients of the matrix by Scalar.

◆ DumpJson()

void gp_Mat::DumpJson ( Standard_OStream theOStream,
const Standard_Integer  theDepth = -1 
) const

Dumps the content of me into the stream.

◆ Invert()

void gp_Mat::Invert ( )

◆ Inverted()

gp_Mat gp_Mat::Inverted ( ) const

Inverses the matrix and raises if the matrix is singular.

  • 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.

◆ IsSingular()

Standard_Boolean gp_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.

◆ Multiplied() [1/2]

gp_Mat gp_Mat::Multiplied ( const gp_Mat Other) const

Computes the product of two matrices <me> * <Other>

◆ Multiplied() [2/2]

gp_Mat gp_Mat::Multiplied ( const Standard_Real  Scalar) const

◆ Multiply() [1/2]

void gp_Mat::Multiply ( const gp_Mat Other)

Computes the product of two matrices <me> = <Other> * <me>.

◆ Multiply() [2/2]

void gp_Mat::Multiply ( const Standard_Real  Scalar)

Multiplies all the coefficients of the matrix by Scalar.

◆ operator()() [1/2]

const Standard_Real& gp_Mat::operator() ( const Standard_Integer  Row,
const Standard_Integer  Col 
) const
inline

◆ operator()() [2/2]

Standard_Real& gp_Mat::operator() ( const Standard_Integer  Row,
const Standard_Integer  Col 
)
inline

◆ operator*() [1/2]

gp_Mat gp_Mat::operator* ( const gp_Mat Other) const
inline

◆ operator*() [2/2]

gp_Mat gp_Mat::operator* ( const Standard_Real  Scalar) const
inline

◆ operator*=() [1/2]

void gp_Mat::operator*= ( const gp_Mat Other)
inline

◆ operator*=() [2/2]

void gp_Mat::operator*= ( const Standard_Real  Scalar)
inline

◆ operator+()

gp_Mat gp_Mat::operator+ ( const gp_Mat Other) const
inline

◆ operator+=()

void gp_Mat::operator+= ( const gp_Mat Other)
inline

◆ operator-()

gp_Mat gp_Mat::operator- ( const gp_Mat Other) const
inline

◆ operator-=()

void gp_Mat::operator-= ( const gp_Mat Other)
inline

◆ operator/()

gp_Mat gp_Mat::operator/ ( const Standard_Real  Scalar) const
inline

◆ operator/=()

void gp_Mat::operator/= ( const Standard_Real  Scalar)
inline

◆ Power()

void gp_Mat::Power ( const Standard_Integer  N)

◆ Powered()

gp_Mat 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.

◆ PreMultiply()

void gp_Mat::PreMultiply ( const gp_Mat Other)

◆ Row()

gp_XYZ gp_Mat::Row ( const Standard_Integer  Row) const

returns the row of Row index. Raises OutOfRange if Row < 1 or Row > 3

◆ SetCol()

void gp_Mat::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.

◆ SetCols()

void gp_Mat::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.

◆ SetCross()

void gp_Mat::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.

◆ SetDiagonal()

void gp_Mat::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.

◆ SetDot()

void gp_Mat::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.

◆ SetIdentity()

void gp_Mat::SetIdentity ( )

Modifies this matrix so that it represents the Identity matrix.

◆ SetRotation()

void gp_Mat::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()

◆ SetRow()

void gp_Mat::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.

◆ SetRows()

void gp_Mat::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.

◆ SetScale()

void gp_Mat::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 |.

◆ SetValue()

void gp_Mat::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.

◆ Subtract()

void gp_Mat::Subtract ( const gp_Mat Other)

◆ Subtracted()

gp_Mat gp_Mat::Subtracted ( const gp_Mat Other) const

cOmputes for each coefficient of the matrix : <me>.Coef(i,j) - <Other>.Coef(i,j)

◆ Transpose()

void gp_Mat::Transpose ( )

◆ Transposed()

gp_Mat gp_Mat::Transposed ( ) const

Transposes the matrix. A(j, i) -> A (i, j)

◆ Value()

const Standard_Real& gp_Mat::Value ( 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.


The documentation for this class was generated from the following file: