Add reshape and reshape's unittest.
This commit is contained in:
@@ -614,7 +614,6 @@ Matrix Aurora::intersect(const Matrix& aMatrix1, const Matrix& aMatrix2, Matrix&
|
||||
iaResult[i] = j + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,3 +621,12 @@ Matrix Aurora::intersect(const Matrix& aMatrix1, const Matrix& aMatrix2, Matrix&
|
||||
return result;
|
||||
}
|
||||
|
||||
Matrix Aurora::reshape(const Matrix& aMatrix, int aRows, int aColumns, int aSlices)
|
||||
{
|
||||
if(aMatrix.isNull() || (aMatrix.getDataSize() != aRows * aColumns * aSlices))
|
||||
{
|
||||
return Matrix();
|
||||
}
|
||||
return Matrix::copyFromRawData(aMatrix.getData(),aRows,aColumns,aSlices);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ namespace Aurora {
|
||||
Matrix auroraUnion(const Matrix& aMatrix1, const Matrix& aMatrix2);
|
||||
|
||||
Matrix intersect(const Matrix& aMatrix1, const Matrix& aMatrix2);
|
||||
|
||||
Matrix reshape(const Matrix& aMatrix, int aRows, int aColumns, int aSlices);
|
||||
/**
|
||||
* 并集
|
||||
* @param aIa, [C,ia,~] = intersect(A,B)用法中ia的返回值
|
||||
|
||||
Reference in New Issue
Block a user