Skip to content

scale_matrix_modScaleMatrixModScaleMatrixModscale_matrix_modT_scale_matrix_mod🔗

Short description🔗

scale_matrix_modScaleMatrixModScaleMatrixModscale_matrix_modT_scale_matrix_mod — Scale a matrix.

Signature🔗

scale_matrix_mod( matrix MatrixID, number Factor )void ScaleMatrixMod( const HTuple& MatrixID, const HTuple& Factor )static void HOperatorSet.ScaleMatrixMod( HTuple matrixID, HTuple factor )def scale_matrix_mod( matrix_id: HHandle, factor: Union[int, float] ) -> None

Herror T_scale_matrix_mod( const Htuple MatrixID, const Htuple Factor )

void HMatrix::ScaleMatrixMod( const HTuple& Factor ) const

void HMatrix::ScaleMatrixMod( double Factor ) const

void HMatrix.ScaleMatrixMod( HTuple factor )

void HMatrix.ScaleMatrixMod( double factor )

Description🔗

The operator scale_matrixScaleMatrix scales the Matrix by a constant factor. The matrix is defined by the matrix handle MatrixIDmatrixIDmatrix_id. The input matrix is overwritten with the result. Access to the elements of the matrix is possible e.g., with the operator get_full_matrixGetFullMatrix. The formula for the calculation of the result is:

\[\begin{eqnarray*} \texttt{Matrix}_{ij} \quad = \quad \textrm{Factor} \quad \cdot \quad \texttt{Matrix}_{ij}. \end{eqnarray*}\]

Example:

Factorfactorfactor = 1.51.5

\[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 3.0 & 1.0 & -2.0 \\ -2.0 & 6.0 & 2.0 \\ -5.0 & -4.0 & 1.0 \end{array} \right] \end{eqnarray*}\]
\[\begin{eqnarray*} \qquad \to \qquad \texttt{Matrix} = \left[ \begin{array}{rrr} 4.5 & 1.5 & -3.0 \\ -3.0 & 9.0 & 3.0 \\ -7.5 & -6.0 & 1.5 \end{array} \right] \end{eqnarray*}\]

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

MatrixIDmatrixIDmatrix_id (input_control, state is modified) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the input matrix.

Factorfactorfactor (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Scale factor.

Default: 2.02.0
Suggested values: 0.1, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5, 2.0, 3.0, 5.0, 10.00.1, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5, 2.0, 3.0, 5.0, 10.0

Result🔗

If the parameters are valid, the operator scale_matrix_modScaleMatrixMod returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_matrixCreateMatrix

Possible successors

get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix

Alternatives

scale_matrixScaleMatrix

See also

mult_element_matrixMultElementMatrix, mult_element_matrix_modMultElementMatrixMod, div_element_matrixDivElementMatrix, div_element_matrix_modDivElementMatrixMod

Module🔗

Foundation