mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
merge
This commit is contained in:
@@ -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.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.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>
|
<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">
|
<tr class="alt"><td colspan="3">
|
||||||
|
|
||||||
Read-write access to sub-matrices:</td></tr>
|
Read-write access to sub-matrices:</td></tr>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ using namespace std;
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
MatrixXf m = MatrixXf::Random(3,3);
|
MatrixXd m = MatrixXd::Random(3,3);
|
||||||
m = (m + MatrixXf::Constant(3,3,1.2)) * 50;
|
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
|
||||||
cout << "m =" << endl << m << endl;
|
cout << "m =" << endl << m << endl;
|
||||||
VectorXf v(3);
|
VectorXd v(3);
|
||||||
v << 1, 2, 3;
|
v << 1, 2, 3;
|
||||||
cout << "m * v =" << endl << m * v << endl;
|
cout << "m * v =" << endl << m * v << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ using namespace std;
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
Matrix3f m = Matrix3f::Random();
|
Matrix3d m = Matrix3d::Random();
|
||||||
m = (m + Matrix3f::Constant(1.2)) * 50;
|
m = (m + Matrix3d::Constant(1.2)) * 50;
|
||||||
cout << "m =" << endl << m << endl;
|
cout << "m =" << endl << m << endl;
|
||||||
Vector3f v(1,2,3);
|
Vector3d v(1,2,3);
|
||||||
|
|
||||||
cout << "m * v =" << endl << m * v << endl;
|
cout << "m * v =" << endl << m * v << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user