Add forceReshape to Matrix
This commit is contained in:
@@ -300,6 +300,11 @@ namespace Aurora {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Matrix::forceReshape(int rows, int columns, int slices)
|
||||||
|
{
|
||||||
|
mInfo = {rows,columns,slices};
|
||||||
|
}
|
||||||
|
|
||||||
bool Matrix::compareShape(const Matrix &other) const {
|
bool Matrix::compareShape(const Matrix &other) const {
|
||||||
if (mInfo[2] == 1 && other.mInfo[2] == 1) {
|
if (mInfo[2] == 1 && other.mInfo[2] == 1) {
|
||||||
if (mInfo[0]==1 && other.mInfo[1] == 1 && mInfo[1] == other.mInfo[0]) return true;
|
if (mInfo[0]==1 && other.mInfo[1] == 1 && mInfo[1] == other.mInfo[0]) return true;
|
||||||
|
|||||||
@@ -233,6 +233,8 @@ namespace Aurora {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void forceReshape(int rows, int columns, int slices);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ValueType mValueType = Normal;
|
ValueType mValueType = Normal;
|
||||||
std::shared_ptr<double> mData;
|
std::shared_ptr<double> mData;
|
||||||
|
|||||||
Reference in New Issue
Block a user