mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-12 16:11:29 +08:00
merge
This commit is contained in:
commit
c0da31309d
@ -490,7 +490,7 @@ Read-write access to sub-vectors:
|
||||
<tr><td>\code vec1.head(n)\endcode</td><td>\code vec1.head<n>()\endcode</td><td>the first \c n coeffs </td></tr>
|
||||
<tr><td>\code vec1.tail(n)\endcode</td><td>\code vec1.tail<n>()\endcode</td><td>the last \c n coeffs </td></tr>
|
||||
<tr><td>\code vec1.segment(pos,n)\endcode</td><td>\code vec1.segment<n>(pos)\endcode</td>
|
||||
<td>the \c n coeffs in \n the range [\c pos : \c pos + \c n [</td></tr>
|
||||
<td>the \c n coeffs in the \n range [\c pos : \c pos + \c n - 1]</td></tr>
|
||||
<tr class="alt"><td colspan="3">
|
||||
|
||||
Read-write access to sub-matrices:</td></tr>
|
||||
|
@ -6,10 +6,10 @@ using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
MatrixXf m = MatrixXf::Random(3,3);
|
||||
m = (m + MatrixXf::Constant(3,3,1.2)) * 50;
|
||||
MatrixXd m = MatrixXd::Random(3,3);
|
||||
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
|
||||
cout << "m =" << endl << m << endl;
|
||||
VectorXf v(3);
|
||||
VectorXd v(3);
|
||||
v << 1, 2, 3;
|
||||
cout << "m * v =" << endl << m * v << endl;
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
Matrix3f m = Matrix3f::Random();
|
||||
m = (m + Matrix3f::Constant(1.2)) * 50;
|
||||
Matrix3d m = Matrix3d::Random();
|
||||
m = (m + Matrix3d::Constant(1.2)) * 50;
|
||||
cout << "m =" << endl << m << endl;
|
||||
Vector3f v(1,2,3);
|
||||
Vector3d v(1,2,3);
|
||||
|
||||
cout << "m * v =" << endl << m * v << endl;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user