Add new max function
This commit is contained in:
@@ -359,6 +359,12 @@ Matrix Aurora::max(const Matrix &aMatrix, const Matrix &aOther) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix Aurora::max(const Matrix &aMatrix, const double aValue){
|
||||||
|
double *output = malloc(1);
|
||||||
|
output[0] = aValue;
|
||||||
|
return max(aMatrix,Matrix::New(output, 1,1,1));
|
||||||
|
}
|
||||||
|
|
||||||
Matrix Aurora::sum(const Matrix &aMatrix, FunctionDirection direction) {
|
Matrix Aurora::sum(const Matrix &aMatrix, FunctionDirection direction) {
|
||||||
if (aMatrix.getDimSize(2)>1 ) {
|
if (aMatrix.getDimSize(2)>1 ) {
|
||||||
std::cerr<< "sum() not support 3D data!"
|
std::cerr<< "sum() not support 3D data!"
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace Aurora
|
|||||||
*/
|
*/
|
||||||
Matrix min(const Matrix &aMatrix, const Matrix &aOther);
|
Matrix min(const Matrix &aMatrix, const Matrix &aOther);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 比较两个矩阵,求对应位置的最大值,不支持三维
|
* 比较两个矩阵,求对应位置的最大值,不支持三维
|
||||||
* @attention 矩阵形状不一样时,如A为[MxN],则B应为标量或[1xN]的行向量
|
* @attention 矩阵形状不一样时,如A为[MxN],则B应为标量或[1xN]的行向量
|
||||||
* @param aMatrix 目标矩阵1
|
* @param aMatrix 目标矩阵1
|
||||||
@@ -60,6 +60,15 @@ namespace Aurora
|
|||||||
*/
|
*/
|
||||||
Matrix max(const Matrix &aMatrix, const Matrix &aOther);
|
Matrix max(const Matrix &aMatrix, const Matrix &aOther);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较矩阵和产量,求对应位置的最大值
|
||||||
|
* @attention 矩阵形状不一样时,如A为[MxN],则B应为标量或[1xN]的行向量
|
||||||
|
* @param aMatrix 目标矩阵1
|
||||||
|
* @param aOther 目标矩阵2
|
||||||
|
* @return 最大值矩阵
|
||||||
|
*/
|
||||||
|
Matrix max(const Matrix &aMatrix, const double aValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 求矩阵和,可按行、列、单元, 目前不支持三维
|
* 求矩阵和,可按行、列、单元, 目前不支持三维
|
||||||
* @param aMatrix 目标矩阵
|
* @param aMatrix 目标矩阵
|
||||||
|
|||||||
Reference in New Issue
Block a user