Change compare shape logic
This commit is contained in:
@@ -292,18 +292,10 @@ namespace Aurora {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool Matrix::compareShape(const Matrix &other) const {
|
||||
if (mInfo.size() != other.mInfo.size()) {
|
||||
// all vector compare length
|
||||
if (mInfo.size() + other.mInfo.size() == 3){
|
||||
return getDataSize()== other.getDataSize();
|
||||
}
|
||||
// 2 and 3
|
||||
else if (mInfo.size() + other.mInfo.size() == 5){
|
||||
return (mInfo.size()==3&& mInfo[2]==1)|| (other.mInfo.size()==3&& other.mInfo[2]==1);
|
||||
}
|
||||
return false;
|
||||
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[1]==1 && other.mInfo[0] == 1 && mInfo[0] == other.mInfo[1]) return true;
|
||||
}
|
||||
for (int i = 0; i < mInfo.size(); ++i) {
|
||||
if (mInfo[i] != other.mInfo[i]) return false;
|
||||
|
||||
Reference in New Issue
Block a user