Add operation ^ to Matrix class.
This commit is contained in:
@@ -281,6 +281,12 @@ namespace Aurora {
|
||||
Matrix operator/(Matrix &&aMatrix, const Matrix &aOther) {
|
||||
return operatorMxM_RR(&vdDivI,&vzDivI,aOther,std::forward<Matrix&&>(aMatrix));
|
||||
}
|
||||
|
||||
//operator ^ (pow)
|
||||
Matrix Matrix::operator^(int times) const { return operatorMxA(&vdPowI, times, *this);}
|
||||
Matrix operator^( Matrix &&matrix,int times) {
|
||||
return operatorMxA(&vdPowI, times, std::forward<Matrix&&>(matrix));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -88,6 +88,10 @@ namespace Aurora {
|
||||
Matrix operator/(Matrix &&matrix) const;
|
||||
friend Matrix operator/(Matrix &&aMatrix,const Matrix &aOther);
|
||||
|
||||
// pow
|
||||
Matrix operator^(int times) const;
|
||||
friend Matrix operator^(Matrix &&matrix,int times);
|
||||
|
||||
/**
|
||||
* print matrix , only support 2d matrix now
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user