mean_matrixT_mean_matrixMeanMatrixMeanMatrixmean_matrix (Operator)

Name

mean_matrixT_mean_matrixMeanMatrixMeanMatrixmean_matrix — Returns the elementwise mean of a matrix.

Signature

mean_matrix( : : MatrixID, MeanType : MatrixMeanID)

Herror T_mean_matrix(const Htuple MatrixID, const Htuple MeanType, Htuple* MatrixMeanID)

void MeanMatrix(const HTuple& MatrixID, const HTuple& MeanType, HTuple* MatrixMeanID)

HMatrix HMatrix::MeanMatrix(const HString& MeanType) const

HMatrix HMatrix::MeanMatrix(const char* MeanType) const

HMatrix HMatrix::MeanMatrix(const wchar_t* MeanType) const   (Windows only)

static void HOperatorSet.MeanMatrix(HTuple matrixID, HTuple meanType, out HTuple matrixMeanID)

HMatrix HMatrix.MeanMatrix(string meanType)

def mean_matrix(matrix_id: HHandle, mean_type: str) -> HHandle

Description

The operator mean_matrixmean_matrixMeanMatrixMeanMatrixMeanMatrixmean_matrix returns the mean values of the elements of the MatrixMatrixMatrixMatrixmatrixmatrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. A new matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMeanmatrix_mean is generated with the result and the matrix handle MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanIDmatrix_mean_id of this matrix is returned. Access to the elements of the matrix is possible e.g. with the operator get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix.

The type of mean determination of the matrix can be selected via the parameter MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type:

'columns'"columns""columns""columns""columns""columns":

The mean is returned for each column of the MatrixMatrixMatrixMatrixmatrixmatrix separately. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMeanmatrix_mean has one row and the identical number of columns as the input matrix.

Example:

'rows'"rows""rows""rows""rows""rows":

The mean is returned for each row of the MatrixMatrixMatrixMatrixmatrixmatrix separately. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMeanmatrix_mean has the identical number of rows as the input matrix and one column.

Example:

'full'"full""full""full""full""full":

The mean is returned using all elements of the MatrixMatrixMatrixMatrixmatrixmatrix. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMeanmatrix_mean has one row and one column.

Example:

Execution Information

Parameters

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (input_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the input matrix.

MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of mean determination.

Default value: 'columns' "columns" "columns" "columns" "columns" "columns"

List of values: 'columns'"columns""columns""columns""columns""columns", 'full'"full""full""full""full""full", 'rows'"rows""rows""rows""rows""rows"

MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanIDmatrix_mean_id (output_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle with the mean values of the input matrix.

Result

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

Possible Predecessors

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

Possible Successors

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

See also

norm_matrixnorm_matrixNormMatrixNormMatrixNormMatrixnorm_matrix, sum_matrixsum_matrixSumMatrixSumMatrixSumMatrixsum_matrix

Module

Foundation