Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
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

constexpr gp_Mat2d () noexcept
 Creates a matrix with null coefficients.
 gp_Mat2d (const gp_XY &theCol1, const gp_XY &theCol2)
 theCol1, theCol2 are the 2 columns of the matrix.
void SetCol (const int 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.
void SetCols (const gp_XY &theCol1, const gp_XY &theCol2)
 Assigns the number pairs theCol1, theCol2 to the two columns of this matrix.
constexpr void SetDiagonal (const double theX1, const double theX2) noexcept
 Modifies the main diagonal of the matrix.
constexpr void SetIdentity () noexcept
 Modifies this matrix, so that it represents the Identity matrix.
void SetRotation (const double theAng)
 Modifies this matrix, so that it represents a rotation. theAng is the angular value in radian of the rotation.
void SetRow (const int 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.
void SetRows (const gp_XY &theRow1, const gp_XY &theRow2)
 Assigns the number pairs theRow1, theRow2 to the two rows of this matrix.
constexpr void SetScale (const double theS) noexcept
 Modifies the matrix such that it represents a scaling transformation, where theS is the scale factor:
void SetValue (const int theRow, const int theCol, const double 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.
gp_XY Column (const int theCol) const
 Returns the column of theCol index. Raises OutOfRange if theCol < 1 or theCol > 2.
constexpr double Determinant () const noexcept
 Computes the determinant of the matrix.
gp_XY Diagonal () const
 Returns the main diagonal of the matrix.
gp_XY Row (const int theRow) const
 Returns the row of index theRow. Raised if theRow < 1 or theRow > 2.
const double & Value (const int theRow, const int theCol) const
 Returns the coefficient of range (ttheheRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 2.
const double & operator() (const int theRow, const int theCol) const
double & ChangeValue (const int theRow, const int theCol)
 Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 2.
double & operator() (const int theRow, const int theCol)
constexpr bool IsSingular () const noexcept
 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.
constexpr void Add (const gp_Mat2d &Other) noexcept
constexpr void operator+= (const gp_Mat2d &theOther) noexcept
constexpr gp_Mat2d Added (const gp_Mat2d &theOther) const noexcept
 Computes the sum of this matrix and the matrix theOther.for each coefficient of the matrix :
constexpr gp_Mat2d operator+ (const gp_Mat2d &theOther) const noexcept
constexpr void Divide (const double theScalar)
constexpr void operator/= (const double theScalar)
constexpr gp_Mat2d Divided (const double theScalar) const
 Divides all the coefficients of the matrix by a scalar.
constexpr gp_Mat2d operator/ (const double theScalar) const
void Invert ()
gp_Mat2d Inverted () const
 Inverses the matrix and raises exception if the matrix is singular.
constexpr gp_Mat2d Multiplied (const gp_Mat2d &theOther) const noexcept
constexpr gp_Mat2d operator* (const gp_Mat2d &theOther) const noexcept
constexpr void Multiply (const gp_Mat2d &theOther) noexcept
 Computes the product of two matrices <me> * <theOther>
constexpr void PreMultiply (const gp_Mat2d &theOther) noexcept
 Modifies this matrix by premultiplying it by the matrix Other <me> = theOther * <me>.
constexpr gp_Mat2d Multiplied (const double theScalar) const noexcept
constexpr gp_Mat2d operator* (const double theScalar) const noexcept
constexpr void Multiply (const double theScalar) noexcept
 Multiplies all the coefficients of the matrix by a scalar.
constexpr void operator*= (const double theScalar) noexcept
void Power (const int theN)
gp_Mat2d Powered (const int 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
constexpr void Subtract (const gp_Mat2d &theOther) noexcept
constexpr void operator-= (const gp_Mat2d &theOther) noexcept
constexpr gp_Mat2d Subtracted (const gp_Mat2d &theOther) const noexcept
 Computes for each coefficient of the matrix :
constexpr gp_Mat2d operator- (const gp_Mat2d &theOther) const noexcept
constexpr void Transpose () noexcept
constexpr gp_Mat2d Transposed () const noexcept
 Transposes the matrix. A(j, i) -> A (i, j)

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 ( )
inlineconstexprnoexcept

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

◆ Added()

gp_Mat2d gp_Mat2d::Added ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

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

double & gp_Mat2d::ChangeValue ( const int theRow,
const int 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 int theCol) const

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

◆ Determinant()

double gp_Mat2d::Determinant ( ) const
inlineconstexprnoexcept

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 double theScalar)
inlineconstexpr

◆ Divided()

gp_Mat2d gp_Mat2d::Divided ( const double theScalar) const
inlinenodiscardconstexpr

Divides all the coefficients of the matrix by a scalar.

◆ Invert()

void gp_Mat2d::Invert ( )

◆ Inverted()

gp_Mat2d gp_Mat2d::Inverted ( ) const
inlinenodiscard

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

◆ IsSingular()

bool gp_Mat2d::IsSingular ( ) const
inlineconstexprnoexcept

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 double theScalar) const
inlinenodiscardconstexprnoexcept

◆ Multiplied() [2/2]

gp_Mat2d gp_Mat2d::Multiplied ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

◆ Multiply() [1/2]

void gp_Mat2d::Multiply ( const double theScalar)
inlineconstexprnoexcept

Multiplies all the coefficients of the matrix by a scalar.

◆ Multiply() [2/2]

void gp_Mat2d::Multiply ( const gp_Mat2d & theOther)
inlineconstexprnoexcept

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

◆ operator()() [1/2]

double & gp_Mat2d::operator() ( const int theRow,
const int theCol )
inline

◆ operator()() [2/2]

const double & gp_Mat2d::operator() ( const int theRow,
const int theCol ) const
inline

◆ operator*() [1/2]

gp_Mat2d gp_Mat2d::operator* ( const double theScalar) const
inlinenodiscardconstexprnoexcept

◆ operator*() [2/2]

gp_Mat2d gp_Mat2d::operator* ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

◆ operator*=()

void gp_Mat2d::operator*= ( const double theScalar)
inlineconstexprnoexcept

◆ operator+()

gp_Mat2d gp_Mat2d::operator+ ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

◆ operator+=()

void gp_Mat2d::operator+= ( const gp_Mat2d & theOther)
inlineconstexprnoexcept

◆ operator-()

gp_Mat2d gp_Mat2d::operator- ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

◆ operator-=()

void gp_Mat2d::operator-= ( const gp_Mat2d & theOther)
inlineconstexprnoexcept

◆ operator/()

gp_Mat2d gp_Mat2d::operator/ ( const double theScalar) const
inlinenodiscardconstexpr

◆ operator/=()

void gp_Mat2d::operator/= ( const double theScalar)
inlineconstexpr

◆ Power()

void gp_Mat2d::Power ( const int theN)

◆ Powered()

gp_Mat2d gp_Mat2d::Powered ( const int theN) const
inlinenodiscard

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

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

◆ Row()

gp_XY gp_Mat2d::Row ( const int theRow) const

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

◆ SetCol()

void gp_Mat2d::SetCol ( const int 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 double theX1,
const double theX2 )
inlineconstexprnoexcept

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 ( )
inlineconstexprnoexcept

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

◆ SetRotation()

void gp_Mat2d::SetRotation ( const double 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 int 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 double theS)
inlineconstexprnoexcept

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 int theRow,
const int theCol,
const double 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)
inlineconstexprnoexcept

◆ Subtracted()

gp_Mat2d gp_Mat2d::Subtracted ( const gp_Mat2d & theOther) const
inlinenodiscardconstexprnoexcept

Computes for each coefficient of the matrix :

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

◆ Transpose()

void gp_Mat2d::Transpose ( )
inlineconstexprnoexcept

◆ Transposed()

gp_Mat2d gp_Mat2d::Transposed ( ) const
inlinenodiscardconstexprnoexcept

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

◆ Value()

const double & gp_Mat2d::Value ( const int theRow,
const int 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: