OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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

    constexpr gp_Mat () noexcept
     Creates a matrix with null coefficients.
    constexpr gp_Mat (const double theA11, const double theA12, const double theA13, const double theA21, const double theA22, const double theA23, const double theA31, const double theA32, const double theA33) noexcept
     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.
    void SetCol (const int 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.
    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.
    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.
    constexpr void SetDiagonal (const double theX1, const double theX2, const double theX3) noexcept
     Modifies the main diagonal of the matrix.
    void SetDot (const gp_XYZ &theRef) noexcept
     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.
    constexpr void SetIdentity () noexcept
     Modifies this matrix so that it represents the Identity matrix.
    void SetRotation (const gp_XYZ &theAxis, const double 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().
    void SetRow (const int 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.
    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.
    constexpr void SetScale (const double theS) noexcept
     Modifies the matrix so 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 > 3 or theCol < 1 or theCol > 3.
    gp_XYZ Column (const int theCol) const
     Returns the column of theCol index. Raises OutOfRange if theCol < 1 or theCol > 3.
    constexpr double Determinant () const noexcept
     Computes the determinant of the matrix.
    gp_XYZ Diagonal () const
     Returns the main diagonal of the matrix.
    gp_XYZ Row (const int theRow) const
     returns the row of theRow index. Raises OutOfRange if theRow < 1 or theRow > 3
    const double & Value (const int theRow, const int theCol) const
     Returns the coefficient of range (theRow, theCol) Raises OutOfRange if theRow < 1 or theRow > 3 or theCol < 1 or theCol > 3.
    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 > 3 or theCol < 1 or theCol > 3.
    double & operator() (const int theRow, const int theCol)
    constexpr bool IsSingular () const noexcept
     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.
    constexpr void Add (const gp_Mat &theOther) noexcept
    constexpr void operator+= (const gp_Mat &theOther) noexcept
    constexpr gp_Mat Added (const gp_Mat &theOther) const noexcept
     Computes the sum of this matrix and the matrix theOther for each coefficient of the matrix : <me>.Coef(i,j) + <theOther>.Coef(i,j).
    constexpr gp_Mat operator+ (const gp_Mat &theOther) const noexcept
    constexpr void Divide (const double theScalar)
    constexpr void operator/= (const double theScalar)
    constexpr gp_Mat Divided (const double theScalar) const
     Divides all the coefficients of the matrix by Scalar.
    constexpr gp_Mat operator/ (const double theScalar) const
    void Invert ()
    gp_Mat Inverted () const
     Inverses the matrix and raises if the matrix is singular.
    constexpr gp_Mat Multiplied (const gp_Mat &theOther) const noexcept
     Computes the product of two matrices <me> * <Other>.
    constexpr gp_Mat operator* (const gp_Mat &theOther) const noexcept
    constexpr void Multiply (const gp_Mat &theOther) noexcept
     Computes the product of two matrices <me> = <Other> * <me>.
    constexpr void operator*= (const gp_Mat &theOther) noexcept
    constexpr void PreMultiply (const gp_Mat &theOther) noexcept
    constexpr gp_Mat Multiplied (const double theScalar) const noexcept
    constexpr gp_Mat operator* (const double theScalar) const noexcept
    constexpr void Multiply (const double theScalar) noexcept
     Multiplies all the coefficients of the matrix by Scalar.
    constexpr void operator*= (const double theScalar) noexcept
    void Power (const int N)
    gp_Mat 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 will be raised if the matrix is not inversible.
    constexpr void Subtract (const gp_Mat &theOther) noexcept
    constexpr void operator-= (const gp_Mat &theOther) noexcept
    constexpr gp_Mat Subtracted (const gp_Mat &theOther) const noexcept
     cOmputes for each coefficient of the matrix : <me>.Coef(i,j) - <theOther>.Coef(i,j)
    constexpr gp_Mat operator- (const gp_Mat &theOther) const noexcept
    void Transpose ()
    gp_Mat Transposed () const
     Transposes the matrix. A(j, i) -> A (i, j).
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.

    Detailed Description

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

    Constructor & Destructor Documentation

    ◆ gp_Mat() [1/3]

    gp_Mat::gp_Mat ( )
    inlineconstexprnoexcept

    Creates a matrix with null coefficients.

    ◆ gp_Mat() [2/3]

    gp_Mat::gp_Mat ( const double theA11,
    const double theA12,
    const double theA13,
    const double theA21,
    const double theA22,
    const double theA23,
    const double theA31,
    const double theA32,
    const double theA33 )
    inlineconstexprnoexcept

    ◆ 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

    ◆ Add()

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

    ◆ Added()

    gp_Mat gp_Mat::Added ( const gp_Mat & 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).

    ◆ ChangeValue()

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

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

    ◆ Determinant()

    double gp_Mat::Determinant ( ) const
    inlineconstexprnoexcept

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

    ◆ Divided()

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

    Divides all the coefficients of the matrix by Scalar.

    ◆ DumpJson()

    void gp_Mat::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const

    Dumps the content of me into the stream.

    ◆ Invert()

    void gp_Mat::Invert ( )

    ◆ Inverted()

    gp_Mat gp_Mat::Inverted ( ) const
    nodiscard

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

    bool gp_Mat::IsSingular ( ) const
    inlineconstexprnoexcept

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

    ◆ Multiplied() [2/2]

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

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

    ◆ Multiply() [1/2]

    void gp_Mat::Multiply ( const double theScalar)
    inlineconstexprnoexcept

    Multiplies all the coefficients of the matrix by Scalar.

    ◆ Multiply() [2/2]

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

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

    ◆ operator()() [1/2]

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

    ◆ operator()() [2/2]

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

    ◆ operator*() [1/2]

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

    ◆ operator*() [2/2]

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

    ◆ operator*=() [1/2]

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

    ◆ operator*=() [2/2]

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

    ◆ operator+()

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

    ◆ operator+=()

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

    ◆ operator-()

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

    ◆ operator-=()

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

    ◆ operator/()

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

    ◆ operator/=()

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

    ◆ Power()

    void gp_Mat::Power ( const int N)

    ◆ Powered()

    gp_Mat gp_Mat::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 will be raised if the matrix is not inversible.

    ◆ PreMultiply()

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

    ◆ Row()

    gp_XYZ gp_Mat::Row ( const int theRow) const

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

    ◆ SetCol()

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

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

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

    Modifies this matrix so that it represents the Identity matrix.

    ◆ SetRotation()

    void gp_Mat::SetRotation ( const gp_XYZ & theAxis,
    const double 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 int 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 double theS)
    inlineconstexprnoexcept

    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 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 > 3 or theCol < 1 or theCol > 3.

    ◆ Subtract()

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

    ◆ Subtracted()

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

    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
    inlinenodiscard

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

    ◆ Value()

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