Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

MatrixCWise Class Reference

Last update: 16.07.2025

coefficient wise access to Matrix More...

Public Types

typedef Eigen::Matrix< TScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Base
 the Eigen matrix type this class refers to
 
typedef TScalarTBuffer
 a pointer type for the data array
 
typedef int TIndex
 Eigen matrix index type.
 
typedef number TScalar
 floating point number for matrix elements
 

Public Member Functions

Matrix __add__ (TScalar other)
 returns a matrix expression of the coefficient-wise sum of *this and other More...
 
Matrix __div__ (Matrix other)
 returns a matrix expression of the coefficient-wise division of *this and other More...
 
Matrix __div__ (MatrixBlock other)
 
Matrix __eq__ (Matrix other)
 
Matrix __eq__ (MatrixBlock other)
 
Matrix __eq__ (TScalar x) const
 
Matrix __le__ (Matrix other)
 
Matrix __le__ (MatrixBlock other)
 
Matrix __le__ (TScalar x) const
 
Matrix __lt__ (Matrix other)
 
Matrix __lt__ (MatrixBlock other)
 
Matrix __lt__ (TScalar x) const
 
Matrix __mul__ (Matrix other)
 returns a matrix expression of the coefficient-wise product of *this and other More...
 
Matrix __mul__ (MatrixBlock other)
 
Matrix __pow__ (TScalar exponent)
 
Matrix __sub__ (TScalar other)
 returns a matrix expression of the coefficient-wise difference of *this and other More...
 
Matrix Abs ()
 
Matrix Abs2 ()
 
Matrix Add (TScalar other)
 modifies this matrix by the coefficient-wise sum of *this and other More...
 
Matrix Atan2 (Matrix y)
 returns the arcus tangens from two parameters: this object represents the coordinates along the x axis is this array, More...
 
Matrix Cos (TScalar a)
 returns a matrix object with coefficient-wise cosine of (this*a) More...
 
Matrix Cos ()
 
Matrix Cube ()
 
Matrix Div (Matrix other)
 modifies this matrix by the coefficient-wise division of *this and other More...
 
Matrix Div (MatrixBlock other)
 
Matrix Exp (TScalar a)
 returns a matrix object with coefficient-wise exponential of (this*a) More...
 
Matrix Exp ()
 
Matrix Greater (TScalar x) const
 
Matrix Inverse ()
 
Matrix Less (TScalar x) const
 
Matrix Log ()
 
Matrix Log10 ()
 
 MatrixCWise (MatrixCWise ar)
 destructor More...
 
 MatrixCWise (Matrix x)
 constructor from Matrix More...
 
Matrix Max (Matrix other)
 returns a matrix expression of the coefficient-wise operator max of *this and other More...
 
Matrix Max (MatrixBlock other)
 
Matrix Max (TScalar z) const
 
Matrix Min (Matrix other)
 returns a matrix expression of the coefficient-wise operator min of *this and other More...
 
Matrix Min (MatrixBlock other)
 
Matrix Min (TScalar z) const
 
Matrix Mul (Matrix other)
 modifes this matrix by the coefficient-wise product of *this and other More...
 
Matrix Mul (MatrixBlock other)
 
Matrix NotEqual (Matrix other)
 
Matrix NotEqual (MatrixBlock other)
 
Matrix NotEqual (TScalar x) const
 
Matrix Pow (TScalar exponent)
 returns a matrix object with coefficient-wise power of *this to the given exponent (operator ^) More...
 
Matrix Sign () const
 
Matrix Sin (TScalar a)
 returns a matrix object with coefficient-wise sinus of (this*a) More...
 
Matrix Sin ()
 
Matrix Sqrt ()
 
Matrix Square ()
 
Matrix Sub (TScalar other)
 modifies this matrix by the coefficient-wise difference of *this and other More...
 

Detailed Description

coefficient wise access to Matrix

This class provides operators and functions for coefficient wise access for matrices, i.e. it provides a scalar view on all matrix elements.

Operators cover elementwise scalar operations. Functions cover a wide field of scalar functions applied to all elements.

By using a reference counting system it is guaranteed that the refered object will not be deleted before the MatrixCWise is deleted.

Constructor & Destructor Documentation

◆ MatrixCWise() [1/2]

destructor

copy constructor

Parameters
arthe source object

◆ MatrixCWise() [2/2]

constructor from Matrix

Parameters
xthe matrix which is to be referenced

Member Function Documentation

◆ __add__()

Matrix __add__ ( TScalar  other)

returns a matrix expression of the coefficient-wise sum of *this and other

Parameters
otherthe other (scalar)
Returns
the result of the operation

◆ __div__()

Matrix __div__ ( Matrix  other)

returns a matrix expression of the coefficient-wise division of *this and other

Parameters
otherthe other matrix
Returns
the result of the operation

◆ __eq__()

Matrix __eq__ ( Matrix  other)
Returns
returns a matrix expression of the coefficient-wise operator == (equal) of *this and other
Parameters
otherthe other matrix to be compared

◆ __le__()

Matrix __le__ ( Matrix  other)
Returns
returns a matrix expression of the coefficient-wise operator <= of *this and other
Parameters
otherthe other matrix to be compared

◆ __lt__()

Matrix __lt__ ( Matrix  other)
Returns
returns a matrix expression of the coefficient-wise operator < of *this and other
Parameters
otherthe other matrix to be compared

◆ __mul__()

Matrix __mul__ ( Matrix  other)

returns a matrix expression of the coefficient-wise product of *this and other

Parameters
otherthe other matrix
Returns
the result of the operation

◆ __pow__()

Matrix __pow__ ( TScalar  exponent)
Returns
returns a matrix object with coefficient-wise power of *this to the given exponent (operator ^)
Parameters
exponentthe exponent

◆ __sub__()

Matrix __sub__ ( TScalar  other)

returns a matrix expression of the coefficient-wise difference of *this and other

Parameters
otherthe other object (scalar)
Returns
the result of the operation

◆ Abs()

Matrix Abs ( )
Returns
a matrix object with coefficient-wise absolute value

◆ Abs2()

Matrix Abs2 ( )
Returns
a matrix object with coefficient-wise squared absolute value

◆ Add()

Matrix Add ( TScalar  other)

modifies this matrix by the coefficient-wise sum of *this and other

Parameters
otherthe other object (scalar)
Returns
a reference to *this

◆ Atan2()

Matrix Atan2 ( Matrix  y)

returns the arcus tangens from two parameters: this object represents the coordinates along the x axis is this array,

Parameters
ythe given array defining the coordinates along the y axis.
Returns
The output matrix object contains the elementwise atan2 values

◆ Cos() [1/2]

Matrix Cos ( TScalar  a)

returns a matrix object with coefficient-wise cosine of (this*a)

Parameters
athe scalar a
Returns
the result of the operation

◆ Cos() [2/2]

Matrix Cos ( )
Returns
a matrix object with coefficient-wise cosine

◆ Cube()

Matrix Cube ( )
Returns
a matrix object with coefficient-wise cubic value (x^3)

◆ Div()

Matrix Div ( Matrix  other)

modifies this matrix by the coefficient-wise division of *this and other

Parameters
otherthe other matrix
Returns
a reference to *this

◆ Exp() [1/2]

Matrix Exp ( TScalar  a)

returns a matrix object with coefficient-wise exponential of (this*a)

Parameters
athe scalar a
Returns
the result of the operation

◆ Exp() [2/2]

Matrix Exp ( )
Returns
a matrix object with coefficient-wise exponential (Euler number power component)

◆ Greater()

Matrix Greater ( TScalar  x) const
Returns
a matrix indicating which element of this is greater than x
Parameters
xthe scalar x

◆ Inverse()

Matrix Inverse ( )
Returns
a matrix object with coefficient-wise inverse, i.e $ y_i = 1/x_i $

◆ Less()

Matrix Less ( TScalar  x) const
Returns
a matrix indicating which element of this is smaller than x
Parameters
xthe scalar x

◆ Log()

Matrix Log ( )
Returns
a matrix object with coefficient-wise natural logarithm

◆ Log10()

Matrix Log10 ( )
Returns
a matrix object with coefficient-wise decadic logarithm

◆ Max() [1/2]

Matrix Max ( Matrix  other)

returns a matrix expression of the coefficient-wise operator max of *this and other

Parameters
otherthe other matrix
Returns
the result of the operation

◆ Max() [2/2]

Matrix Max ( TScalar  z) const
Returns
an array with elementwise maximum of max(this,z)
Parameters
zthe scalar z

◆ Min() [1/2]

Matrix Min ( Matrix  other)

returns a matrix expression of the coefficient-wise operator min of *this and other

Parameters
otherthe other matrix
Returns
the result of the operation

◆ Min() [2/2]

Matrix Min ( TScalar  z) const
Returns
an array with elementwise minimum of min(this,z)
Parameters
zthe scalar z

◆ Mul()

Matrix Mul ( Matrix  other)

modifes this matrix by the coefficient-wise product of *this and other

Parameters
otherthe other matrix
Returns
a reference to *this

◆ NotEqual()

Matrix NotEqual ( Matrix  other)
Returns
returns a matrix expression of the coefficient-wise operator != (inequal) of *this and other
Parameters
otherthe other matrix to be compared

◆ Pow()

Matrix Pow ( TScalar  exponent)

returns a matrix object with coefficient-wise power of *this to the given exponent (operator ^)

Parameters
exponentthe exponent of the power operation
Returns
the result of the operation

◆ Sign()

Matrix Sign ( ) const
Returns
an array with elementwise sign (-1 if <0, 0 if=0, 1 if>0)

◆ Sin() [1/2]

Matrix Sin ( TScalar  a)

returns a matrix object with coefficient-wise sinus of (this*a)

Parameters
athe scalar a
Returns
the result of the operation

◆ Sin() [2/2]

Matrix Sin ( )
Returns
a matrix object with coefficient-wise sinus

◆ Sqrt()

Matrix Sqrt ( )
Returns
a matrix object with coefficient-wise square root

◆ Square()

Matrix Square ( )
Returns
a matrix object with coefficient-wise squared value

◆ Sub()

Matrix Sub ( TScalar  other)

modifies this matrix by the coefficient-wise difference of *this and other

Parameters
otherthe other object (scalar)
Returns
a reference to *this

Connect with Ansys