mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add operators *= and /=
This commit is contained in:
@@ -29,7 +29,7 @@ template<typename MatrixType> void matrixManip(const MatrixType& m)
|
||||
{
|
||||
int rows = m.rows(), cols = m.cols();
|
||||
int i = rand()%rows, j = rand()%cols;
|
||||
|
||||
|
||||
MatrixType a(rows, cols), b(rows, cols);
|
||||
a.row(i);
|
||||
a.col(j);
|
||||
@@ -37,6 +37,7 @@ template<typename MatrixType> void matrixManip(const MatrixType& m)
|
||||
a.block(1, rows-1, 1, cols-1);
|
||||
a.row(i) = b.row(i);
|
||||
a.row(i) += b.row(i);
|
||||
a.col(j) *= 2;
|
||||
a.minor(i, j) = b.block(1, rows-1, 1, cols-1);
|
||||
a.minor(i, j) -= eval(a.block(1, rows-1, 1, cols-1));
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ template<typename MatrixType1,
|
||||
a = eval(a + b);
|
||||
a += b;
|
||||
a -= b + b;
|
||||
a *= s;
|
||||
b /= s;
|
||||
if(rows1 == cols1) a *= b;
|
||||
|
||||
MatrixType1 d(rows1, cols1);
|
||||
MatrixType2 e(rows2, cols2);
|
||||
|
||||
@@ -45,7 +45,9 @@ template<typename VectorType> void vectorOps(const VectorType& v)
|
||||
a = eval(s * (b - c));
|
||||
|
||||
a += b;
|
||||
a += b + b;
|
||||
a -= b + b;
|
||||
a *= s;
|
||||
b /= s;
|
||||
a += eval(a + a);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user