mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Big renaming:
start ---> head end ---> tail Much frustration with sed syntax. Need to learn perl some day.
This commit is contained in:
@@ -41,8 +41,8 @@ A.setIdentity(); // Fill A with the identity.
|
||||
// Eigen // Matlab
|
||||
x.start(n) // x(1:n)
|
||||
x.start<n>() // x(1:n)
|
||||
x.end(n) // N = rows(x); x(N - n: N)
|
||||
x.end<n>() // N = rows(x); x(N - n: N)
|
||||
x.tail(n) // N = rows(x); x(N - n: N)
|
||||
x.tail<n>() // N = rows(x); x(N - n: N)
|
||||
x.segment(i, n) // x(i+1 : i+n)
|
||||
x.segment<n>(i) // x(i+1 : i+n)
|
||||
P.block(i, j, rows, cols) // P(i+1 : i+rows, j+1 : j+cols)
|
||||
|
||||
@@ -493,7 +493,7 @@ Read-write access to sub-vectors:
|
||||
<td></td>
|
||||
|
||||
<tr><td>\code vec1.start(n)\endcode</td><td>\code vec1.start<n>()\endcode</td><td>the first \c n coeffs </td></tr>
|
||||
<tr><td>\code vec1.end(n)\endcode</td><td>\code vec1.end<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>
|
||||
<td>the \c size coeffs in \n the range [\c pos : \c pos + \c n [</td></tr>
|
||||
<tr style="border-style: dashed none dashed none;"><td>
|
||||
|
||||
@@ -27,8 +27,8 @@ struct unroll_echelon
|
||||
m.row(k).swap(m.row(k+rowOfBiggest));
|
||||
m.col(k).swap(m.col(k+colOfBiggest));
|
||||
m.template corner<CornerRows-1, CornerCols>(BottomRight)
|
||||
-= m.col(k).template end<CornerRows-1>()
|
||||
* (m.row(k).template end<CornerCols>() / m(k,k));
|
||||
-= m.col(k).template tail<CornerRows-1>()
|
||||
* (m.row(k).template tail<CornerCols>() / m(k,k));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ struct unroll_echelon<Derived, Dynamic>
|
||||
m.row(k).swap(m.row(k+rowOfBiggest));
|
||||
m.col(k).swap(m.col(k+colOfBiggest));
|
||||
m.corner(BottomRight, cornerRows-1, cornerCols)
|
||||
-= m.col(k).end(cornerRows-1) * (m.row(k).end(cornerCols) / m(k,k));
|
||||
-= m.col(k).tail(cornerRows-1) * (m.row(k).tail(cornerCols) / m(k,k));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RowVector4i v = RowVector4i::Random();
|
||||
cout << "Here is the vector v:" << endl << v << endl;
|
||||
cout << "Here is v.end(2):" << endl << v.end(2) << endl;
|
||||
v.end(2).setZero();
|
||||
cout << "Here is v.tail(2):" << endl << v.tail(2) << endl;
|
||||
v.tail(2).setZero();
|
||||
cout << "Now the vector v is:" << endl << v << endl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RowVector4i v = RowVector4i::Random();
|
||||
cout << "Here is the vector v:" << endl << v << endl;
|
||||
cout << "Here is v.start(2):" << endl << v.start(2) << endl;
|
||||
v.start(2).setZero();
|
||||
cout << "Here is v.head(2):" << endl << v.head(2) << endl;
|
||||
v.head(2).setZero();
|
||||
cout << "Now the vector v is:" << endl << v << endl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RowVector4i v = RowVector4i::Random();
|
||||
cout << "Here is the vector v:" << endl << v << endl;
|
||||
cout << "Here is v.end(2):" << endl << v.end<2>() << endl;
|
||||
v.end<2>().setZero();
|
||||
cout << "Here is v.tail(2):" << endl << v.tail<2>() << endl;
|
||||
v.tail<2>().setZero();
|
||||
cout << "Now the vector v is:" << endl << v << endl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RowVector4i v = RowVector4i::Random();
|
||||
cout << "Here is the vector v:" << endl << v << endl;
|
||||
cout << "Here is v.start(2):" << endl << v.start<2>() << endl;
|
||||
v.start<2>().setZero();
|
||||
cout << "Here is v.head(2):" << endl << v.head<2>() << endl;
|
||||
v.head<2>().setZero();
|
||||
cout << "Now the vector v is:" << endl << v << endl;
|
||||
|
||||
Reference in New Issue
Block a user