mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
implement scalar operators separately for each type using a macro.
This is required e.g. to allow "2 * m" with m a matrix of doubles.
This commit is contained in:
@@ -5,16 +5,12 @@ using namespace Eigen;
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
Matrix<double,2,2> m, n; // 2x2 fixed-size matrix with uninitialized entries
|
||||
Matrix<double,2,2> m; // 2x2 fixed-size matrix with uninitialized entries
|
||||
m(0,0) = 1;
|
||||
m(0,1) = 2;
|
||||
m(1,0) = 3;
|
||||
m(1,1) = 4;
|
||||
|
||||
n = m;
|
||||
n = eval(n*n+n);
|
||||
cout << n << endl;
|
||||
|
||||
cout << "Here is a 2x2 matrix m:" << endl << m << endl;
|
||||
cout << "Let us now build a 4x4 matrix m2 by assembling together four 2x2 blocks." << endl;
|
||||
MatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries
|
||||
|
||||
Reference in New Issue
Block a user