Fix sub and div

This commit is contained in:
kradchen
2023-06-07 15:45:06 +08:00
parent 9909a54f15
commit 5b1da21a31

View File

@@ -472,7 +472,7 @@ namespace Aurora {
} }
//operation - //operation -
Matrix Matrix::operator-(double aScalar) const { return operatorMxA(&vdSubI, aScalar, *this);} Matrix Matrix::operator-(double aScalar) const { return operatorMxA(&vdSubI, aScalar, *this);}
Matrix operator-(double aScalar, const Matrix &matrix) {return matrix - aScalar;} Matrix operator-(double aScalar, const Matrix &matrix) {return operatorAxM(&vdSubI, aScalar, matrix);}
Matrix Matrix::operator-(const Matrix &aMatrix) const { Matrix Matrix::operator-(const Matrix &aMatrix) const {
if (isScalar()){ if (isScalar()){
return getScalar()-aMatrix; return getScalar()-aMatrix;
@@ -546,7 +546,7 @@ namespace Aurora {
} }
//operation / //operation /
Matrix Matrix::operator/(double aScalar) const { return operatorMxA(&vdDivI, aScalar, *this);} Matrix Matrix::operator/(double aScalar) const { return operatorMxA(&vdDivI, aScalar, *this);}
Matrix operator/(double aScalar, const Matrix &matrix) {return matrix / aScalar;} Matrix operator/(double aScalar, const Matrix &matrix) {return operatorAxM(&vdDivI, aScalar, matrix);}
Matrix Matrix::operator/(const Matrix &aMatrix) const { Matrix Matrix::operator/(const Matrix &aMatrix) const {
if (isScalar()){ if (isScalar()){
return getScalar()/aMatrix; return getScalar()/aMatrix;
@@ -557,7 +557,7 @@ namespace Aurora {
return operatorMxM(vdDivI, vzDivI, *this, aMatrix); return operatorMxM(vdDivI, vzDivI, *this, aMatrix);
} }
Matrix &operator/(double aScalar, Matrix &&matrix) { Matrix &operator/(double aScalar, Matrix &&matrix) {
return operatorMxA_RR(&vdDivI,aScalar, std::forward<Matrix&&>(matrix)); return operatorAxM_RR(&vdDivI,aScalar, std::forward<Matrix&&>(matrix));
} }
Matrix &operator/(Matrix &&matrix,double aScalar) { Matrix &operator/(Matrix &&matrix,double aScalar) {
return operatorMxA_RR(&vdDivI,aScalar, std::forward<Matrix&&>(matrix)); return operatorMxA_RR(&vdDivI,aScalar, std::forward<Matrix&&>(matrix));