This commit is contained in:
jdh8 2012-08-18 21:10:42 +08:00
commit c0da31309d
3 changed files with 7 additions and 7 deletions

View File

@ -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>

View File

@ -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;
}

View File

@ -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;
}