Home | History | Annotate | Download | only in snippets

Lines Matching refs:m2

6 MatrixType m1(n_dims), m2(n_dims);
8 m2.setRandom();
9 float *p = &m2(0); // get the address storing the data for m2
10 MapType m2map(p,m2.size()); // m2map shares data with m2
11 MapTypeConst m2mapconst(p,m2.size()); // a read-only accessor for m2
14 cout << "m2: " << m2 << endl;
15 cout << "Squared euclidean distance: " << (m1-m2).squaredNorm() << endl;
18 m2map(3) = 7; // this will change m2, since they share the same array
19 cout << "Updated m2: " << m2 << endl;
20 cout << "m2 coefficient 2, constant accessor: " << m2mapconst(2) << endl;