aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-07-08 07:56:01 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-07-08 07:56:01 +0000
commit6f09d3a67d333d68e7c971147ec77600e86e93f3 (patch)
tree36095d2bb12c0b02b9688775f60ee5531d2b0372 /doc
parentf5791eeb7054b78ded6eb080e9712651da6c6a34 (diff)
- many updates after Cwise change
- fix compilation in product.cpp with std::complex - fix bug in MatrixBase::operator!=
Diffstat (limited to 'doc')
-rw-r--r--doc/Mainpage.dox6
-rw-r--r--doc/echelon.cpp4
-rw-r--r--doc/examples/class_CwiseBinaryOp.cpp3
-rw-r--r--doc/examples/class_CwiseUnaryOp.cpp3
-rw-r--r--doc/snippets/MatrixBase_map.cpp5
-rw-r--r--doc/snippets/MatrixBase_map_int.cpp5
-rw-r--r--doc/snippets/MatrixBase_map_int_int.cpp5
7 files changed, 7 insertions, 24 deletions
diff --git a/doc/Mainpage.dox b/doc/Mainpage.dox
index ce869371b..2437872b0 100644
--- a/doc/Mainpage.dox
+++ b/doc/Mainpage.dox
@@ -4,11 +4,11 @@ o /** \mainpage Eigen
This is the API documentation for Eigen.
-Most of the API is available as methods in MatrixBase, so this is a good starting point for browsing. Also have a look at Matrix, as a few methods and the matrix constructors are there.
+Most of the API is available as methods in MatrixBase, so this is a good starting point for browsing. Also have a look at Matrix, as a few methods and the matrix constructors are there. Other notable classes for the Eigen API are Cwise, which contains the methods for doing certain coefficient-wise operations, and Part.
-For a first contact with Eigen, it is enough to look at Matrix and MatrixBase. In fact, except for advanced use, the only class that you'll have to explicitly name in your program, i.e. of which you'll explicitly contruct objects, is Matrix. For instance, vectors are handled as a special case of Matrix with one column.
+For a first contact with Eigen, it is enough to look at Matrix, MatrixBase, and Cwise. In fact, except for advanced use, the only class that you'll have to explicitly name in your program, i.e. of which you'll explicitly contruct objects, is Matrix. For instance, vectors are handled as a special case of Matrix with one column. Typedefs are provided, e.g. Vector2f is a typedef for Matrix<float, 2, 1>.
-The many other classes are typically return types for MatrixBase methods.
+Most of the other classes are just return types for MatrixBase methods.
*/
diff --git a/doc/echelon.cpp b/doc/echelon.cpp
index 3c9e58e59..49b719ff2 100644
--- a/doc/echelon.cpp
+++ b/doc/echelon.cpp
@@ -22,7 +22,7 @@ struct unroll_echelon
unroll_echelon<Derived, Step-1>::run(m);
int rowOfBiggest, colOfBiggest;
m.template corner<CornerRows, CornerCols>(BottomRight)
- .cwiseAbs()
+ .cwise().abs()
.maxCoeff(&rowOfBiggest, &colOfBiggest);
m.row(k).swap(m.row(k+rowOfBiggest));
m.col(k).swap(m.col(k+colOfBiggest));
@@ -54,7 +54,7 @@ struct unroll_echelon<Derived, Dynamic>
int rowOfBiggest, colOfBiggest;
int cornerRows = m.rows()-k, cornerCols = m.cols()-k;
m.corner(BottomRight, cornerRows, cornerCols)
- .cwiseAbs()
+ .cwise().abs()
.maxCoeff(&rowOfBiggest, &colOfBiggest);
m.row(k).swap(m.row(k+rowOfBiggest));
m.col(k).swap(m.col(k+colOfBiggest));
diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp
index 52d65ab2b..7dc8ef762 100644
--- a/doc/examples/class_CwiseBinaryOp.cpp
+++ b/doc/examples/class_CwiseBinaryOp.cpp
@@ -7,12 +7,11 @@ using namespace std;
template<typename Scalar> struct MakeComplexOp EIGEN_EMPTY_STRUCT {
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b) const { return complex<Scalar>(a,b); }
- enum { Cost = 0 };
};
int main(int, char**)
{
Matrix4d m1 = Matrix4d::random(), m2 = Matrix4d::random();
- cout << m1.cwise(m2, MakeComplexOp<double>()) << endl;
+ cout << m1.binaryExpr(m2, MakeComplexOp<double>()) << endl;
return 0;
}
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp
index 37d121cd8..c4d8fd4ce 100644
--- a/doc/examples/class_CwiseUnaryOp.cpp
+++ b/doc/examples/class_CwiseUnaryOp.cpp
@@ -9,12 +9,11 @@ struct CwiseClampOp {
CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {}
const Scalar operator()(const Scalar& x) const { return x<m_inf ? m_inf : (x>m_sup ? m_sup : x); }
Scalar m_inf, m_sup;
- enum { Cost = Eigen::ConditionalJumpCost + Eigen::NumTraits<Scalar>::AddCost };
};
int main(int, char**)
{
Matrix4d m1 = Matrix4d::random();
- cout << m1 << endl << "becomes: " << endl << m1.cwise(CwiseClampOp<double>(-0.5,0.5)) << endl;
+ cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(CwiseClampOp<double>(-0.5,0.5)) << endl;
return 0;
}
diff --git a/doc/snippets/MatrixBase_map.cpp b/doc/snippets/MatrixBase_map.cpp
deleted file mode 100644
index 1655c542e..000000000
--- a/doc/snippets/MatrixBase_map.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-int data[4] = {1,3,0,2};
-cout << Matrix2i::map(data) << endl;
-Matrix2i::map(data) *= 2;
-cout << "The data is now:" << endl;
-for(int i = 0; i < 4; i++) cout << data[i] << endl; \ No newline at end of file
diff --git a/doc/snippets/MatrixBase_map_int.cpp b/doc/snippets/MatrixBase_map_int.cpp
deleted file mode 100644
index 066e54773..000000000
--- a/doc/snippets/MatrixBase_map_int.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-int data[4] = {1,3,0,2};
-cout << VectorXi::map(data, 4) << endl;
-VectorXi::map(data, 4) *= 2;
-cout << "The data is now:" << endl;
-for(int i = 0; i < 4; i++) cout << data[i] << endl;
diff --git a/doc/snippets/MatrixBase_map_int_int.cpp b/doc/snippets/MatrixBase_map_int_int.cpp
deleted file mode 100644
index 516b9e7f9..000000000
--- a/doc/snippets/MatrixBase_map_int_int.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-int data[4] = {1,3,0,2};
-cout << MatrixXi::map(data, 2, 2) << endl;
-MatrixXi::map(data, 2, 2) *= 2;
-cout << "The data is now:" << endl;
-for(int i = 0; i < 4; i++) cout << data[i] << endl;