Skip to content

repeat_matrixRepeatMatrixRepeatMatrixrepeat_matrixT_repeat_matrix🔗

Short description🔗

repeat_matrixRepeatMatrixRepeatMatrixrepeat_matrixT_repeat_matrix — Repeat a matrix.

Signature🔗

repeat_matrix( matrix MatrixID, integer Rows, integer Columns, out matrix MatrixRepeatedID )void RepeatMatrix( const HTuple& MatrixID, const HTuple& Rows, const HTuple& Columns, HTuple* MatrixRepeatedID )static void HOperatorSet.RepeatMatrix( HTuple matrixID, HTuple rows, HTuple columns, out HTuple matrixRepeatedID )def repeat_matrix( matrix_id: HHandle, rows: int, columns: int ) -> HHandle

Herror T_repeat_matrix( const Htuple MatrixID, const Htuple Rows, const Htuple Columns, Htuple* MatrixRepeatedID )

HMatrix HMatrix::RepeatMatrix( Hlong Rows, Hlong Columns ) const

HMatrix HMatrix.RepeatMatrix( int rows, int columns )

Description🔗

The operator repeat_matrixRepeatMatrix creates the new matrix MatrixRepeated and copies all elements of the input Matrix \(n\) times to this new matrix, where \(n\) = Rowsrowsrows \(\cdot\) Columnscolumnscolumns. The new matrix has dimensions Rowsrowsrows \(\times\) rows of the input Matrix and Columnscolumnscolumns \(\times\) columns of the input Matrix. The input Matrix is defined by the matrix handle MatrixIDmatrixIDmatrix_id. The operator returns the matrix handle MatrixRepeatedIDmatrixRepeatedIDmatrix_repeated_id of the matrix MatrixRepeated. Access to the elements of the matrix is possible e.g., with the operator get_full_matrixGetFullMatrix.

Example:

Rowsrowsrows = 22, Columnscolumnscolumns = 33

\[\begin{eqnarray*} \texttt{Matrix} = \left[ \begin{array}{rrr} 3.0 & -1.0 & -2.0 \\ -5.0 & 7.0 & 2.0 \end{array} \right] \end{eqnarray*}\]
\[\begin{eqnarray*} \to \qquad \texttt{MatrixRepeated} = \left[ \begin{array}{rrrrrrrrr} 3.0 & -1.0 & -2.0 & 3.0 & -1.0 & -2.0 & 3.0 & -1.0 & -2.0 \\ -5.0 & 7.0 & 2.0 & -5.0 & 7.0 & 2.0 & -5.0 & 7.0 & 2.0 \\ 3.0 & -1.0 & -2.0 & 3.0 & -1.0 & -2.0 & 3.0 & -1.0 & -2.0 \\ -5.0 & 7.0 & 2.0 & -5.0 & 7.0 & 2.0 & -5.0 & 7.0 & 2.0 \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.

Parameters🔗

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

Matrix handle of the input matrix.

Rowsrowsrows (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of copies of input matrix in row direction.

Default: 22
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 201, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20
Restriction: Rows >= 1

Columnscolumnscolumns (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of copies of input matrix in column direction.

Default: 22
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 201, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20
Restriction: Columns >= 1

MatrixRepeatedIDmatrixRepeatedIDmatrix_repeated_id (output_control) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the repeated copied matrix.

Result🔗

If the parameters are valid, the operator repeat_matrixRepeatMatrix 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

See also

copy_matrixCopyMatrix

Module🔗

Foundation