Open CASCADE Technology  7.7.0.dev
Public Member Functions

gp_Mat2d Class Reference

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

#include <gp_Mat2d.hxx>

Public Member Functions

 gp_Mat2d ()
 Creates a matrix with null coefficients. More...
 
 gp_Mat2d (const gp_XY &theCol1, const gp_XY &theCol2)
 theCol1, theCol2 are the 2 columns of the matrix. More...
 
void SetCol (const Standard_Integer theCol, const gp_XY &theValue)
 Assigns the two coordinates of theValue to the column of range theCol of this matrix Raises OutOfRange if theCol < 1 or theCol > 2. More...
 
void SetCols (const gp_XY &theCol1, const gp_XY &theCol2)
 Assigns the number pairs theCol1, theCol2 to the two columns of this matrix. More...
 
void SetDiagonal (const Standard_Real theX1, const Standard_Real theX2)
 Modifies the main diagonal of the matrix. More...
 
void SetIdentity ()
 Modifies this matrix, so that it represents the Identity matrix. More...
 
void SetRotation (const Standard_Real theAng)
 Modifies this matrix, so that it represents a rotation. theAng is the angular value in radian of the rotation. More...
 
void SetRow (const Standard_Integer theRow, const gp_XY &theValue)
 Assigns the two coordinates of theValue to the row of index theRow of this matrix. Raises OutOfRange if theRow < 1 or theRow > 2. More...
 
void SetRows (const gp_XY &theRow1, const gp_XY &theRow2)
 Assigns the number pairs theRow1, theRow2 to the two rows of this matrix. More...
 
void SetScale (const Standard_Real theS)
 Modifies the matrix such 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 > 2 or theCol < 1 or theCol > 2. More...
 
gp_XY Column (const Standard_Integer theCol) const
 Returns the column of theCol index. Raises OutOfRange if theCol < 1 or theCol > 2. More...
 
Standard_Real Determinant () const
 Computes the determinant of the matrix. More...
 
gp_XY Diagonal () const
 Returns the main diagonal of the matrix. More...
 
gp_XY Row (const Standard_Integer theRow) const
 Returns the row of index theRow. Raised if theRow < 1 or theRow > 2. More...
 
const Standard_RealValue (const Standard_Integer theRow, const Standard_Integer theCol) const
 Returns the coefficient of range (ttheheRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 2. 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 > 2 or theCol < 1 or theCol > 2. More...
 
Standard_Realoperator() (const Standard_Integer theRow, const Standard_Integer theCol)
 
Standard_Boolean IsSingular () const
 Returns true if this matrix is singular (and therefore, cannot be inverted). The Gauss LU decomposition is used to invert the matrix 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_Mat2d &Other)
 
void operator+= (const gp_Mat2d &theOther)
 
gp_Mat2d Added (const gp_Mat2d &theOther) const
 Computes the sum of this matrix and the matrix theOther.for each coefficient of the matrix : More...
 
gp_Mat2d operator+ (const gp_Mat2d &theOther) const
 
void Divide (const Standard_Real theScalar)
 
void operator/= (const Standard_Real theScalar)
 
gp_Mat2d Divided (const Standard_Real theScalar) const
 Divides all the coefficients of the matrix by a scalar. More...
 
gp_Mat2d operator/ (const Standard_Real theScalar) const
 
void Invert ()
 
gp_Mat2d Inverted () const
 Inverses the matrix and raises exception if the matrix is singular. More...
 
gp_Mat2d Multiplied (const gp_Mat2d &theOther) const
 
gp_Mat2d operator* (const gp_Mat2d &theOther) const
 
void Multiply (const gp_Mat2d &theOther)
 Computes the product of two matrices <me> * <theOther> More...
 
void PreMultiply (const gp_Mat2d &theOther)
 Modifies this matrix by premultiplying it by the matrix Other <me> = theOther * <me>. More...
 
gp_Mat2d Multiplied (const Standard_Real theScalar) const
 
gp_Mat2d operator* (const Standard_Real theScalar) const
 
void Multiply (const Standard_Real theScalar)
 Multiplies all the coefficients of the matrix by a scalar. More...
 
void operator*= (const Standard_Real theScalar)
 
void Power (const Standard_Integer theN)
 
gp_Mat2d 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 can be raised if the matrix is not inversible More...
 
void Subtract (const gp_Mat2d &theOther)
 
void operator-= (const gp_Mat2d &theOther)
 
gp_Mat2d Subtracted (const gp_Mat2d &theOther) const
 Computes for each coefficient of the matrix : More...
 
gp_Mat2d operator- (const gp_Mat2d &theOther) const
 
void Transpose ()
 
gp_Mat2d Transposed () const
 Transposes the matrix. A(j, i) -> A (i, j) More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ gp_Mat2d() [1/2]

gp_Mat2d::gp_Mat2d ( )
inline

Creates a matrix with null coefficients.

◆ gp_Mat2d() [2/2]

gp_Mat2d::gp_Mat2d ( const gp_XY theCol1,
const gp_XY theCol2 
)

theCol1, theCol2 are the 2 columns of the matrix.

Member Function Documentation

◆ Add()

void gp_Mat2d::Add ( const gp_Mat2d Other)
inline

◆ Added()

gp_Mat2d gp_Mat2d::Added ( const gp_Mat2d 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)

Note:

  • operator += assigns the result to this matrix, while
  • operator + creates a new one.

◆ ChangeValue()

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

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

◆ Column()

gp_XY gp_Mat2d::Column ( const Standard_Integer  theCol) const

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

◆ Determinant()

Standard_Real gp_Mat2d::Determinant ( ) const
inline

Computes the determinant of the matrix.

◆ Diagonal()

gp_XY gp_Mat2d::Diagonal ( ) const

Returns the main diagonal of the matrix.

◆ Divide()

void gp_Mat2d::Divide ( const Standard_Real  theScalar)
inline

◆ Divided()

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

Divides all the coefficients of the matrix by a scalar.

◆ Invert()

void gp_Mat2d::Invert ( )

◆ Inverted()

gp_Mat2d gp_Mat2d::Inverted ( ) const
inline

Inverses the matrix and raises exception if the matrix is singular.

◆ IsSingular()

Standard_Boolean gp_Mat2d::IsSingular ( ) const
inline

Returns true if this matrix is singular (and therefore, cannot be inverted). The Gauss LU decomposition is used to invert the matrix so the matrix is considered as singular if the largest pivot found is lower or equal to Resolution from gp.

◆ Multiplied() [1/2]

gp_Mat2d gp_Mat2d::Multiplied ( const gp_Mat2d theOther) const
inline

◆ Multiplied() [2/2]

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

◆ Multiply() [1/2]

void gp_Mat2d::Multiply ( const gp_Mat2d theOther)
inline

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

◆ Multiply() [2/2]

void gp_Mat2d::Multiply ( const Standard_Real  theScalar)
inline

Multiplies all the coefficients of the matrix by a scalar.

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

◆ operator*() [1/2]

gp_Mat2d gp_Mat2d::operator* ( const gp_Mat2d theOther) const
inline

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+()

gp_Mat2d gp_Mat2d::operator+ ( const gp_Mat2d theOther) const
inline

◆ operator+=()

void gp_Mat2d::operator+= ( const gp_Mat2d theOther)
inline

◆ operator-()

gp_Mat2d gp_Mat2d::operator- ( const gp_Mat2d theOther) const
inline

◆ operator-=()

void gp_Mat2d::operator-= ( const gp_Mat2d theOther)
inline

◆ operator/()

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

◆ operator/=()

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

◆ Power()

void gp_Mat2d::Power ( const Standard_Integer  theN)

◆ Powered()

gp_Mat2d gp_Mat2d::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 can be raised if the matrix is not inversible

◆ PreMultiply()

void gp_Mat2d::PreMultiply ( const gp_Mat2d theOther)
inline

Modifies this matrix by premultiplying it by the matrix Other <me> = theOther * <me>.

◆ Row()

gp_XY gp_Mat2d::Row ( const Standard_Integer  theRow) const

Returns the row of index theRow. Raised if theRow < 1 or theRow > 2.

◆ SetCol()

void gp_Mat2d::SetCol ( const Standard_Integer  theCol,
const gp_XY theValue 
)

Assigns the two coordinates of theValue to the column of range theCol of this matrix Raises OutOfRange if theCol < 1 or theCol > 2.

◆ SetCols()

void gp_Mat2d::SetCols ( const gp_XY theCol1,
const gp_XY theCol2 
)

Assigns the number pairs theCol1, theCol2 to the two columns of this matrix.

◆ SetDiagonal()

void gp_Mat2d::SetDiagonal ( const Standard_Real  theX1,
const Standard_Real  theX2 
)
inline

Modifies the main diagonal of the matrix.

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

The other coefficients of the matrix are not modified.

◆ SetIdentity()

void gp_Mat2d::SetIdentity ( )
inline

Modifies this matrix, so that it represents the Identity matrix.

◆ SetRotation()

void gp_Mat2d::SetRotation ( const Standard_Real  theAng)
inline

Modifies this matrix, so that it represents a rotation. theAng is the angular value in radian of the rotation.

◆ SetRow()

void gp_Mat2d::SetRow ( const Standard_Integer  theRow,
const gp_XY theValue 
)

Assigns the two coordinates of theValue to the row of index theRow of this matrix. Raises OutOfRange if theRow < 1 or theRow > 2.

◆ SetRows()

void gp_Mat2d::SetRows ( const gp_XY theRow1,
const gp_XY theRow2 
)

Assigns the number pairs theRow1, theRow2 to the two rows of this matrix.

◆ SetScale()

void gp_Mat2d::SetScale ( const Standard_Real  theS)
inline

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

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

◆ SetValue()

void gp_Mat2d::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 > 2 or theCol < 1 or theCol > 2.

◆ Subtract()

void gp_Mat2d::Subtract ( const gp_Mat2d theOther)
inline

◆ Subtracted()

gp_Mat2d gp_Mat2d::Subtracted ( const gp_Mat2d theOther) const
inline

Computes for each coefficient of the matrix :

<me>.Coef(i,j) - <theOther>.Coef(i,j)

◆ Transpose()

void gp_Mat2d::Transpose ( )
inline

◆ Transposed()

gp_Mat2d gp_Mat2d::Transposed ( ) const
inline

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

◆ Value()

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

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


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