Open CASCADE Technology  7.2.0
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 &Col1, const gp_XY &Col2)
 Col1, Col2 are the 2 columns of the matrix. More...
 
void SetCol (const Standard_Integer Col, const gp_XY &Value)
 Assigns the two coordinates of Value to the column of range Col of this matrix Raises OutOfRange if Col < 1 or Col > 2. More...
 
void SetCols (const gp_XY &Col1, const gp_XY &Col2)
 Assigns the number pairs Col1, Col2 to the two columns of this matrix. More...
 
void SetDiagonal (const Standard_Real X1, const Standard_Real X2)
 Modifies the main diagonal of the matrix. <me>.Value (1, 1) = X1 <me>.Value (2, 2) = X2 The other coefficients of the matrix are not modified. More...
 
void SetIdentity ()
 Modifies this matrix, so that it represents the Identity matrix. More...
 
void SetRotation (const Standard_Real Ang)
 Modifies this matrix, so that it representso a rotation. Ang is the angular value in radian of the rotation. More...
 
void SetRow (const Standard_Integer Row, const gp_XY &Value)
 Assigns the two coordinates of Value to the row of index Row of this matrix. Raises OutOfRange if Row < 1 or Row > 2. More...
 
void SetRows (const gp_XY &Row1, const gp_XY &Row2)
 Assigns the number pairs Row1, Row2 to the two rows of this matrix. More...
 
void SetScale (const Standard_Real S)
 Modifies the matrix such that it represents a scaling transformation, where S is the scale factor : | S 0.0 | <me> = | 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 > 2 or Col < 1 or Col > 2. More...
 
gp_XY Column (const Standard_Integer Col) const
 Returns the column of Col index. Raises OutOfRange if Col < 1 or Col > 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 Row) const
 Returns the row of index Row. Raised if Row < 1 or Row > 2. 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 > 2 or Col < 1 or Col > 2. 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 > 2 or Col < 1 or Col > 2. More...
 
Standard_Realoperator() (const Standard_Integer Row, const Standard_Integer Col)
 
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 &Other)
 
gp_Mat2d Added (const gp_Mat2d &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) Note: More...
 
gp_Mat2d operator+ (const gp_Mat2d &Other) const
 
void Divide (const Standard_Real Scalar)
 
void operator/= (const Standard_Real Scalar)
 
gp_Mat2d Divided (const Standard_Real Scalar) const
 Divides all the coefficients of the matrix by a scalar. More...
 
gp_Mat2d operator/ (const Standard_Real Scalar) 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 &Other) const
 
gp_Mat2d operator* (const gp_Mat2d &Other) const
 
void Multiply (const gp_Mat2d &Other)
 Computes the product of two matrices <me> * <Other> More...
 
void PreMultiply (const gp_Mat2d &Other)
 Modifies this matrix by premultiplying it by the matrix Other <me> = Other * <me>. More...
 
gp_Mat2d Multiplied (const Standard_Real Scalar) const
 
gp_Mat2d operator* (const Standard_Real Scalar) const
 
void Multiply (const Standard_Real Scalar)
 Multiplies all the coefficients of the matrix by a scalar. More...
 
void operator*= (const Standard_Real Scalar)
 
void Power (const Standard_Integer N)
 
gp_Mat2d 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 can be raised if the matrix is not inversible More...
 
void Subtract (const gp_Mat2d &Other)
 
void operator-= (const gp_Mat2d &Other)
 
gp_Mat2d Subtracted (const gp_Mat2d &Other) const
 Computes for each coefficient of the matrix : <me>.Coef(i,j) - <Other>.Coef(i,j) More...
 
gp_Mat2d operator- (const gp_Mat2d &Other) 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 ( )

Creates a matrix with null coefficients.

◆ gp_Mat2d() [2/2]

gp_Mat2d::gp_Mat2d ( const gp_XY Col1,
const gp_XY Col2 
)

Col1, Col2 are the 2 columns of the matrix.

Member Function Documentation

◆ Add()

void gp_Mat2d::Add ( const gp_Mat2d Other)

◆ Added()

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

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

◆ ChangeValue()

Standard_Real& gp_Mat2d::ChangeValue ( const Standard_Integer  Row,
const Standard_Integer  Col 
)

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

◆ Column()

gp_XY gp_Mat2d::Column ( const Standard_Integer  Col) const

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

◆ Determinant()

Standard_Real gp_Mat2d::Determinant ( ) const

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

◆ Divided()

gp_Mat2d gp_Mat2d::Divided ( const Standard_Real  Scalar) const

Divides all the coefficients of the matrix by a scalar.

◆ Invert()

void gp_Mat2d::Invert ( )

◆ Inverted()

gp_Mat2d gp_Mat2d::Inverted ( ) const

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

◆ IsSingular()

Standard_Boolean gp_Mat2d::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.

◆ Multiplied() [1/2]

gp_Mat2d gp_Mat2d::Multiplied ( const gp_Mat2d Other) const

◆ Multiplied() [2/2]

gp_Mat2d gp_Mat2d::Multiplied ( const Standard_Real  Scalar) const

◆ Multiply() [1/2]

void gp_Mat2d::Multiply ( const gp_Mat2d Other)

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

◆ Multiply() [2/2]

void gp_Mat2d::Multiply ( const Standard_Real  Scalar)

Multiplies all the coefficients of the matrix by a scalar.

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

◆ operator*() [1/2]

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

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/()

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

◆ operator/=()

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

◆ Power()

void gp_Mat2d::Power ( const Standard_Integer  N)

◆ Powered()

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

◆ PreMultiply()

void gp_Mat2d::PreMultiply ( const gp_Mat2d Other)

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

◆ Row()

gp_XY gp_Mat2d::Row ( const Standard_Integer  Row) const

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

◆ SetCol()

void gp_Mat2d::SetCol ( const Standard_Integer  Col,
const gp_XY Value 
)

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

◆ SetCols()

void gp_Mat2d::SetCols ( const gp_XY Col1,
const gp_XY Col2 
)

Assigns the number pairs Col1, Col2 to the two columns of this matrix.

◆ SetDiagonal()

void gp_Mat2d::SetDiagonal ( const Standard_Real  X1,
const Standard_Real  X2 
)

Modifies the main diagonal of the matrix. <me>.Value (1, 1) = X1 <me>.Value (2, 2) = X2 The other coefficients of the matrix are not modified.

◆ SetIdentity()

void gp_Mat2d::SetIdentity ( )

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

◆ SetRotation()

void gp_Mat2d::SetRotation ( const Standard_Real  Ang)

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

◆ SetRow()

void gp_Mat2d::SetRow ( const Standard_Integer  Row,
const gp_XY Value 
)

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

◆ SetRows()

void gp_Mat2d::SetRows ( const gp_XY Row1,
const gp_XY Row2 
)

Assigns the number pairs Row1, Row2 to the two rows of this matrix.

◆ SetScale()

void gp_Mat2d::SetScale ( const Standard_Real  S)

Modifies the matrix such that it represents a scaling transformation, where S is the scale factor : | S 0.0 | <me> = | 0.0 S |.

◆ SetValue()

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

◆ Subtract()

void gp_Mat2d::Subtract ( const gp_Mat2d Other)

◆ Subtracted()

gp_Mat2d gp_Mat2d::Subtracted ( const gp_Mat2d Other) const

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

◆ Transpose()

void gp_Mat2d::Transpose ( )

◆ Transposed()

gp_Mat2d gp_Mat2d::Transposed ( ) const

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

◆ Value()

const Standard_Real& gp_Mat2d::Value ( const Standard_Integer  Row,
const Standard_Integer  Col 
) const

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


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