# 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 theA11, const Standard_Real theA12, const Standard_Real theA13, const Standard_Real theA21, const Standard_Real theA22, const Standard_Real theA23, const Standard_Real theA31, const Standard_Real theA32, const Standard_Real theA33)

gp_Mat (const gp_XYZ &theCol1, const gp_XYZ &theCol2, const gp_XYZ &theCol3)
Creates a matrix. theCol1, theCol2, theCol3 are the 3 columns of the matrix. More...

void SetCol (const Standard_Integer theCol, const gp_XYZ &theValue)
Assigns the three coordinates of theValue to the column of index theCol of this matrix. Raises OutOfRange if theCol < 1 or theCol > 3. More...

void SetCols (const gp_XYZ &theCol1, const gp_XYZ &theCol2, const gp_XYZ &theCol3)
Assigns the number triples theCol1, theCol2, theCol3 to the three columns of this matrix. More...

void SetCross (const gp_XYZ &theRef)
Modifies the matrix M so that applying it to any number triple (X, Y, Z) produces the same result as the cross product of theRef and the number triple (X, Y, Z): i.e.: M * {X,Y,Z}t = theRef.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 theRef and the triplet {XYZ}. Note: this matrix is anti-symmetric. More...

void SetDiagonal (const Standard_Real theX1, const Standard_Real theX2, const Standard_Real theX3)
Modifies the main diagonal of the matrix. More...

void SetDot (const gp_XYZ &theRef)
Modifies this matrix so that applying it to any number triple (X, Y, Z) produces the same result as the scalar product of theRef and the number triple (X, Y, Z): this * (X,Y,Z) = theRef.(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 &theAxis, const Standard_Real theAng)
Modifies this matrix so that it represents a rotation. theAng 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 theRow, const gp_XYZ &theValue)
Assigns the three coordinates of Value to the row of index theRow of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3. More...

void SetRows (const gp_XYZ &theRow1, const gp_XYZ &theRow2, const gp_XYZ &theRow3)
Assigns the number triples theRow1, theRow2, theRow3 to the three rows of this matrix. More...

void SetScale (const Standard_Real theS)
Modifies the matrix so that it represents a scaling transformation, where theS is the scale factor. : More...

void SetValue (const Standard_Integer theRow, const Standard_Integer theCol, const Standard_Real theValue)
Assigns <theValue> to the coefficient of row theRow, column theCol of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3. More...

gp_XYZ Column (const Standard_Integer theCol) const
Returns the column of theCol index. Raises OutOfRange if theCol < 1 or theCol > 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 theRow) const
returns the row of theRow index. Raises OutOfRange if theRow < 1 or theRow > 3 More...

const Standard_RealValue (const Standard_Integer theRow, const Standard_Integer theCol) const
Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3. More...

const Standard_Realoperator() (const Standard_Integer theRow, const Standard_Integer theCol) const

Standard_RealChangeValue (const Standard_Integer theRow, const Standard_Integer theCol)
Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3. More...

Standard_Realoperator() (const Standard_Integer theRow, const Standard_Integer theCol)

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 operator+= (const gp_Mat &theOther)

gp_Mat Added (const gp_Mat &theOther) const
Computes the sum of this matrix and the matrix theOther for each coefficient of the matrix : <me>.Coef(i,j) + <theOther>.Coef(i,j) More...

gp_Mat operator+ (const gp_Mat &theOther) const

void Divide (const Standard_Real theScalar)

void operator/= (const Standard_Real theScalar)

gp_Mat Divided (const Standard_Real theScalar) const
Divides all the coefficients of the matrix by Scalar. More...

gp_Mat operator/ (const Standard_Real theScalar) const

void Invert ()

gp_Mat Inverted () const
Inverses the matrix and raises if the matrix is singular. More...

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

gp_Mat operator* (const gp_Mat &theOther) const

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

void operator*= (const gp_Mat &theOther)

void PreMultiply (const gp_Mat &theOther)

gp_Mat Multiplied (const Standard_Real theScalar) const

gp_Mat operator* (const Standard_Real theScalar) const

void Multiply (const Standard_Real theScalar)
Multiplies all the coefficients of the matrix by Scalar. More...

void operator*= (const Standard_Real theScalar)

void Power (const Standard_Integer N)

gp_Mat Powered (const Standard_Integer theN) const
Computes <me> = <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Invert() *...........* <me>.Invert(). If theN < 0 an exception will be raised if the matrix is not inversible. More...

void Subtract (const gp_Mat &theOther)

void operator-= (const gp_Mat &theOther)

gp_Mat Subtracted (const gp_Mat &theOther) const
cOmputes for each coefficient of the matrix : <me>.Coef(i,j) - <theOther>.Coef(i,j) More...

gp_Mat operator- (const gp_Mat &theOther) const

void Transpose ()

gp_Mat Transposed () const
Transposes the matrix. A(j, i) -> A (i, j) More...

void DumpJson (Standard_OStream &theOStream, 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.

## ◆ gp_Mat() [1/3]

 gp_Mat::gp_Mat ( )
inline

creates a matrix with null coefficients.

## ◆ gp_Mat() [2/3]

 gp_Mat::gp_Mat ( const Standard_Real theA11, const Standard_Real theA12, const Standard_Real theA13, const Standard_Real theA21, const Standard_Real theA22, const Standard_Real theA23, const Standard_Real theA31, const Standard_Real theA32, const Standard_Real theA33 )
inline

## ◆ gp_Mat() [3/3]

 gp_Mat::gp_Mat ( const gp_XYZ & theCol1, const gp_XYZ & theCol2, const gp_XYZ & theCol3 )

Creates a matrix. theCol1, theCol2, theCol3 are the 3 columns of the matrix.

## Member Function Documentation

 void gp_Mat::Add ( const gp_Mat & theOther )
inline

 gp_Mat gp_Mat::Added ( const gp_Mat & theOther ) const
inline

Computes the sum of this matrix and the matrix theOther for each coefficient of the matrix : <me>.Coef(i,j) + <theOther>.Coef(i,j)

## ◆ ChangeValue()

 Standard_Real& gp_Mat::ChangeValue ( const Standard_Integer theRow, const Standard_Integer theCol )
inline

Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3.

## ◆ Column()

 gp_XYZ gp_Mat::Column ( const Standard_Integer theCol ) const

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

## ◆ Determinant()

 Standard_Real gp_Mat::Determinant ( ) const
inline

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 theScalar )
inline

## ◆ Divided()

 gp_Mat gp_Mat::Divided ( const Standard_Real theScalar ) const
inline

Divides all the coefficients of the matrix by Scalar.

## ◆ DumpJson()

 void gp_Mat::DumpJson ( Standard_OStream & theOStream, 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
inline

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 & theOther ) const
inline

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

## ◆ Multiplied() [2/2]

 gp_Mat gp_Mat::Multiplied ( const Standard_Real theScalar ) const
inline

## ◆ Multiply() [1/2]

 void gp_Mat::Multiply ( const gp_Mat & theOther )
inline

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

## ◆ Multiply() [2/2]

 void gp_Mat::Multiply ( const Standard_Real theScalar )
inline

Multiplies all the coefficients of the matrix by Scalar.

## ◆ operator()() [1/2]

 Standard_Real& gp_Mat::operator() ( const Standard_Integer theRow, const Standard_Integer theCol )
inline

## ◆ operator()() [2/2]

 const Standard_Real& gp_Mat::operator() ( const Standard_Integer theRow, const Standard_Integer theCol ) const
inline

## ◆ operator*() [1/2]

 gp_Mat gp_Mat::operator* ( const gp_Mat & theOther ) const
inline

## ◆ operator*() [2/2]

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

## ◆ operator*=() [1/2]

 void gp_Mat::operator*= ( const gp_Mat & theOther )
inline

## ◆ operator*=() [2/2]

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

## ◆ operator+()

 gp_Mat gp_Mat::operator+ ( const gp_Mat & theOther ) const
inline

## ◆ operator+=()

 void gp_Mat::operator+= ( const gp_Mat & theOther )
inline

## ◆ operator-()

 gp_Mat gp_Mat::operator- ( const gp_Mat & theOther ) const
inline

## ◆ operator-=()

 void gp_Mat::operator-= ( const gp_Mat & theOther )
inline

## ◆ operator/()

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

## ◆ operator/=()

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

## ◆ Power()

 void gp_Mat::Power ( const Standard_Integer N )

## ◆ Powered()

 gp_Mat gp_Mat::Powered ( const Standard_Integer theN ) const
inline

Computes <me> = <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Invert() *...........* <me>.Invert(). If theN < 0 an exception will be raised if the matrix is not inversible.

## ◆ PreMultiply()

 void gp_Mat::PreMultiply ( const gp_Mat & theOther )
inline

## ◆ Row()

 gp_XYZ gp_Mat::Row ( const Standard_Integer theRow ) const

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

## ◆ SetCol()

 void gp_Mat::SetCol ( const Standard_Integer theCol, const gp_XYZ & theValue )

Assigns the three coordinates of theValue to the column of index theCol of this matrix. Raises OutOfRange if theCol < 1 or theCol > 3.

## ◆ SetCols()

 void gp_Mat::SetCols ( const gp_XYZ & theCol1, const gp_XYZ & theCol2, const gp_XYZ & theCol3 )

Assigns the number triples theCol1, theCol2, theCol3 to the three columns of this matrix.

## ◆ SetCross()

 void gp_Mat::SetCross ( const gp_XYZ & theRef )

Modifies the matrix M so that applying it to any number triple (X, Y, Z) produces the same result as the cross product of theRef and the number triple (X, Y, Z): i.e.: M * {X,Y,Z}t = theRef.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 theRef and the triplet {XYZ}. Note: this matrix is anti-symmetric.

## ◆ SetDiagonal()

 void gp_Mat::SetDiagonal ( const Standard_Real theX1, const Standard_Real theX2, const Standard_Real theX3 )
inline

Modifies the main diagonal of the matrix.

<me>.Value (1, 1) = theX1
<me>.Value (2, 2) = theX2
<me>.Value (3, 3) = theX3

The other coefficients of the matrix are not modified.

## ◆ SetDot()

 void gp_Mat::SetDot ( const gp_XYZ & theRef )

Modifies this matrix so that applying it to any number triple (X, Y, Z) produces the same result as the scalar product of theRef and the number triple (X, Y, Z): this * (X,Y,Z) = theRef.(X,Y,Z) Note: this matrix is symmetric.

## ◆ SetIdentity()

 void gp_Mat::SetIdentity ( )
inline

Modifies this matrix so that it represents the Identity matrix.

## ◆ SetRotation()

 void gp_Mat::SetRotation ( const gp_XYZ & theAxis, const Standard_Real theAng )

Modifies this matrix so that it represents a rotation. theAng 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 theRow, const gp_XYZ & theValue )

Assigns the three coordinates of Value to the row of index theRow of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3.

## ◆ SetRows()

 void gp_Mat::SetRows ( const gp_XYZ & theRow1, const gp_XYZ & theRow2, const gp_XYZ & theRow3 )

Assigns the number triples theRow1, theRow2, theRow3 to the three rows of this matrix.

## ◆ SetScale()

 void gp_Mat::SetScale ( const Standard_Real theS )
inline

Modifies the matrix so that it represents a scaling transformation, where theS is the scale factor. :

| theS 0.0 0.0 |
<me> = | 0.0 theS 0.0 |
| 0.0 0.0 theS |

## ◆ SetValue()

 void gp_Mat::SetValue ( const Standard_Integer theRow, const Standard_Integer theCol, const Standard_Real theValue )
inline

Assigns <theValue> to the coefficient of row theRow, column theCol of this matrix. Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3.

## ◆ Subtract()

 void gp_Mat::Subtract ( const gp_Mat & theOther )
inline

## ◆ Subtracted()

 gp_Mat gp_Mat::Subtracted ( const gp_Mat & theOther ) const
inline

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

## ◆ Transpose()

 void gp_Mat::Transpose ( )
inline

## ◆ Transposed()

 gp_Mat gp_Mat::Transposed ( ) const
inline

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

## ◆ Value()

 const Standard_Real& gp_Mat::Value ( const Standard_Integer theRow, const Standard_Integer theCol ) const
inline

Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3.

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