Add createVectorMatrix function.
This commit is contained in:
@@ -880,6 +880,24 @@ Matrix Aurora::deleteColumn(const Matrix& aMatrix, int aColumnIndex)
|
|||||||
return Matrix::New(resultData, rows, columns-1);
|
return Matrix::New(resultData, rows, columns-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix Aurora::createVectorMatrix(double aStartValue, double aStepValue, double aEndValue)
|
||||||
|
{
|
||||||
|
std::vector<double> matrixData;
|
||||||
|
double tempValue = aStartValue;
|
||||||
|
matrixData.push_back(tempValue);
|
||||||
|
long long compare1 = std::round(aEndValue * 10e13);
|
||||||
|
long long compare2 = std::round(tempValue * 10e13);
|
||||||
|
while(std::round(tempValue* 10e13) <= compare1)
|
||||||
|
{
|
||||||
|
tempValue += aStepValue;
|
||||||
|
matrixData.push_back(tempValue);
|
||||||
|
compare2 = std::round(tempValue * 10e14);
|
||||||
|
}
|
||||||
|
matrixData.pop_back();
|
||||||
|
|
||||||
|
return Matrix::copyFromRawData(matrixData.data(), 1, matrixData.size());
|
||||||
|
}
|
||||||
|
|
||||||
Matrix Aurora::reshape(const Matrix& aMatrix, int aRows, int aColumns, int aSlices)
|
Matrix Aurora::reshape(const Matrix& aMatrix, int aRows, int aColumns, int aSlices)
|
||||||
{
|
{
|
||||||
if(aMatrix.isNull() || (aMatrix.getDataSize() != aRows * aColumns * aSlices))
|
if(aMatrix.isNull() || (aMatrix.getDataSize() != aRows * aColumns * aSlices))
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ namespace Aurora {
|
|||||||
Matrix xcorr(const Matrix& aMatrix1, const Matrix& aMatrix2);
|
Matrix xcorr(const Matrix& aMatrix1, const Matrix& aMatrix2);
|
||||||
|
|
||||||
Matrix deleteColumn(const Matrix& aMatrix, int aColumnIndex);
|
Matrix deleteColumn(const Matrix& aMatrix, int aColumnIndex);
|
||||||
|
|
||||||
|
Matrix createVectorMatrix(double aStartValue, double aStepValue, double aEndValue);
|
||||||
/**
|
/**
|
||||||
* 并集
|
* 并集
|
||||||
* @param aIa, [C,ia,~] = intersect(A,B)用法中ia的返回值
|
* @param aIa, [C,ia,~] = intersect(A,B)用法中ia的返回值
|
||||||
|
|||||||
Reference in New Issue
Block a user