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

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 doubleValue (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 doubleoperator() (const int theRow, const int theCol) const
 
doubleChangeValue (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.
 
doubleoperator() (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]

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

constexpr void gp_Mat2d::Add ( const gp_Mat2d & Other)
inlineconstexprnoexcept

◆ Added()

constexpr gp_Mat2d gp_Mat2d::Added ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

Computes the sum of this matrix and the matrix theOther.for each coefficient of the matrix :

<me>.Coef(i,j) + <theOther>.Coef(i,j)
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

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

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

constexpr void gp_Mat2d::Divide ( const double theScalar)
inlineconstexpr

◆ Divided()

constexpr gp_Mat2d gp_Mat2d::Divided ( const double theScalar) const
inlineconstexpr

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

constexpr 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]

constexpr gp_Mat2d gp_Mat2d::Multiplied ( const double theScalar) const
inlineconstexprnoexcept

◆ Multiplied() [2/2]

constexpr gp_Mat2d gp_Mat2d::Multiplied ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

◆ Multiply() [1/2]

constexpr void gp_Mat2d::Multiply ( const double theScalar)
inlineconstexprnoexcept

Multiplies all the coefficients of the matrix by a scalar.

◆ Multiply() [2/2]

constexpr 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]

constexpr gp_Mat2d gp_Mat2d::operator* ( const double theScalar) const
inlineconstexprnoexcept

◆ operator*() [2/2]

constexpr gp_Mat2d gp_Mat2d::operator* ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

◆ operator*=()

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

◆ operator+()

constexpr gp_Mat2d gp_Mat2d::operator+ ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

◆ operator+=()

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

◆ operator-()

constexpr gp_Mat2d gp_Mat2d::operator- ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

◆ operator-=()

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

◆ operator/()

constexpr gp_Mat2d gp_Mat2d::operator/ ( const double theScalar) const
inlineconstexpr

◆ operator/=()

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

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

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

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

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

constexpr void gp_Mat2d::Subtract ( const gp_Mat2d & theOther)
inlineconstexprnoexcept

◆ Subtracted()

constexpr gp_Mat2d gp_Mat2d::Subtracted ( const gp_Mat2d & theOther) const
inlineconstexprnoexcept

Computes for each coefficient of the matrix :

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

◆ Transpose()

constexpr void gp_Mat2d::Transpose ( )
inlineconstexprnoexcept

◆ Transposed()

constexpr gp_Mat2d gp_Mat2d::Transposed ( ) const
inlineconstexprnoexcept

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: