mean_matrixT_mean_matrixMeanMatrixMeanMatrixmean_matrix (算子)

名称

mean_matrixT_mean_matrixMeanMatrixMeanMatrixmean_matrix — 返回矩阵的元素平均值。

签名

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

描述

算子 mean_matrixmean_matrixMeanMatrixMeanMatrixMeanMatrixmean_matrix returns the mean values of the elements of the Matrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id. A new matrix MatrixMean is generated with the result and the matrix handle MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanIDmatrix_mean_id of this matrix is returned.可通过算子 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 Matrix separately. The resulting matrix MatrixMean has one row and the identical number of columns as the input matrix.

示例:

MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type = 'columns'"columns""columns""columns""columns""columns"

'rows'"rows""rows""rows""rows""rows"

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

示例:

MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type = 'rows'"rows""rows""rows""rows""rows"

'full'"full""full""full""full""full"

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

示例:

MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type = 'full'"full""full""full""full""full"

执行信息

参数

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输入控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

输入矩阵的矩阵句柄。

MeanTypeMeanTypeMeanTypeMeanTypemeanTypemean_type (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of mean determination.

默认值: 'columns' "columns" "columns" "columns" "columns" "columns"

值列表: 'columns'"columns""columns""columns""columns""columns", 'full'"full""full""full""full""full", 'rows'"rows""rows""rows""rows""rows"

MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanIDmatrix_mean_id (输出控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle with the mean values of the input matrix.

结果

如果参数有效,算子 mean_matrixmean_matrixMeanMatrixMeanMatrixMeanMatrixmean_matrix 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的前趋

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

可能的后继

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix, get_value_matrixget_value_matrixGetValueMatrixGetValueMatrixGetValueMatrixget_value_matrix

另见

norm_matrixnorm_matrixNormMatrixNormMatrixNormMatrixnorm_matrix, sum_matrixsum_matrixSumMatrixSumMatrixSumMatrixsum_matrix

模块

基础