aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-03-10 17:23:11 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-03-10 17:23:11 +0000
commit01572b9f54e769a7d1bb3d5073c264a5fbc7ce42 (patch)
treeea9b9ef0469040e8b8ae0805f77d726c319dfeac /doc
parent9d9d81ad71a52c33ba4db9f8a6059d435d279316 (diff)
big change: MatrixBase only takes one template parameter "Derived", the
template parameter "Scalar" is removed. This is achieved by introducting a template <typename Derived> struct Scalar to achieve a forward-declaration of the Scalar typedefs.
Diffstat (limited to 'doc')
-rw-r--r--doc/Mainpage.dox2
-rw-r--r--doc/examples/class_Block.cpp8
-rw-r--r--doc/examples/class_Cast.cpp13
-rw-r--r--doc/examples/class_Column.cpp8
-rw-r--r--doc/examples/class_CwiseBinaryOp.cpp4
-rw-r--r--doc/examples/class_CwiseUnaryOp.cpp2
-rw-r--r--doc/examples/class_Eval.cpp4
-rw-r--r--doc/examples/class_FixedBlock.cpp8
-rw-r--r--doc/examples/class_Row.cpp8
9 files changed, 30 insertions, 27 deletions
diff --git a/doc/Mainpage.dox b/doc/Mainpage.dox
index 115cb2eeb..b82e60c60 100644
--- a/doc/Mainpage.dox
+++ b/doc/Mainpage.dox
@@ -71,7 +71,7 @@ The To-do wiki for Eigen is here: <a href="http://techbase.kde.org/index.php?tit
Eigen is standard C++98 and so should theoretically be compatible with any compliant compiler. Of course, in practice, things might be slightly different. At least, Eigen is known to compile with any version of GCC from 3.3 to 4.3 as well as with recent versions of ICC.
-Eigen is well tested with recent versions of GCC and ICC. Both GCC 4.2 and ICC gives very good performance. ICC might provide even better performance when the auto-vectorization makes sense. For some reason the performance is not so great with GCC 4.1.
+Eigen is well tested with recent versions of GCC and ICC. Both GCC 4.2 and ICC give very good performance. ICC might provide even better performance when the auto-vectorization makes sense. For some reason the performance is not so great with GCC 4.1.
For best performance, we recommend the following compilation flags:
<ul>
diff --git a/doc/examples/class_Block.cpp b/doc/examples/class_Block.cpp
index 26f9666cb..7a4c60a42 100644
--- a/doc/examples/class_Block.cpp
+++ b/doc/examples/class_Block.cpp
@@ -2,16 +2,16 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
Eigen::Block<Derived>
-topLeftCorner(MatrixBase<Scalar, Derived>& m, int rows, int cols)
+topLeftCorner(MatrixBase<Derived>& m, int rows, int cols)
{
return Eigen::Block<Derived>(m.asArg(), 0, 0, rows, cols);
}
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::Block<Derived>
-topLeftCorner(const MatrixBase<Scalar, Derived>& m, int rows, int cols)
+topLeftCorner(const MatrixBase<Derived>& m, int rows, int cols)
{
return Eigen::Block<Derived>(m.asArg(), 0, 0, rows, cols);
}
diff --git a/doc/examples/class_Cast.cpp b/doc/examples/class_Cast.cpp
index 88549732f..456466d1f 100644
--- a/doc/examples/class_Cast.cpp
+++ b/doc/examples/class_Cast.cpp
@@ -2,14 +2,17 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::CwiseUnaryOp<
- Eigen::ScalarCastOp<typename Eigen::NumTraits<Scalar>::FloatingPoint>,
- Derived
+ Eigen::ScalarCastOp<
+ typename Eigen::NumTraits< typename Eigen::Scalar<Derived>::Type >::FloatingPoint
+ >, Derived
>
-castToFloatingPoint(const MatrixBase<Scalar, Derived>& m)
+castToFloatingPoint(const MatrixBase<Derived>& m)
{
- return m.template cast<typename Eigen::NumTraits<Scalar>::FloatingPoint>();
+ return m.template cast<typename Eigen::NumTraits<
+ typename Eigen::Scalar<Derived>::Type>::FloatingPoint
+ >();
}
int main(int, char**)
diff --git a/doc/examples/class_Column.cpp b/doc/examples/class_Column.cpp
index 3b37d835f..22f95e22d 100644
--- a/doc/examples/class_Column.cpp
+++ b/doc/examples/class_Column.cpp
@@ -2,16 +2,16 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
Eigen::Column<Derived>
-firstColumn(MatrixBase<Scalar, Derived>& m)
+firstColumn(MatrixBase<Derived>& m)
{
return Eigen::Column<Derived>(m.asArg(), 0);
}
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::Column<Derived>
-firstColumn(const MatrixBase<Scalar, Derived>& m)
+firstColumn(const MatrixBase<Derived>& m)
{
return Eigen::Column<Derived>(m.asArg(), 0);
}
diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp
index f5439a434..ae634a041 100644
--- a/doc/examples/class_CwiseBinaryOp.cpp
+++ b/doc/examples/class_CwiseBinaryOp.cpp
@@ -9,9 +9,9 @@ struct CwiseMinOp EIGEN_EMPTY_STRUCT {
};
// define a custom binary operator between two matrices
-template<typename Scalar, typename Derived1, typename Derived2>
+template<typename Derived1, typename Derived2>
const Eigen::CwiseBinaryOp<CwiseMinOp, Derived1, Derived2>
-cwiseMin(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2)
+cwiseMin(const MatrixBase<Derived1> &mat1, const MatrixBase<Derived2> &mat2)
{
return Eigen::CwiseBinaryOp<CwiseMinOp, Derived1, Derived2>(mat1.asArg(), mat2.asArg());
}
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp
index 4d4bfe734..042e051e9 100644
--- a/doc/examples/class_CwiseUnaryOp.cpp
+++ b/doc/examples/class_CwiseUnaryOp.cpp
@@ -13,6 +13,6 @@ struct CwiseClampOp EIGEN_EMPTY_STRUCT {
int main(int, char**)
{
Matrix4d m1 = Matrix4d::random();
- cout << m1.cwise(CwiseClampOp<Matrix4d::Scalar>(-0.5,0.5)) << endl;
+ cout << m1.cwise(CwiseClampOp<double>(-0.5,0.5)) << endl;
return 0;
}
diff --git a/doc/examples/class_Eval.cpp b/doc/examples/class_Eval.cpp
index 8c638fe79..ee6ee89d1 100644
--- a/doc/examples/class_Eval.cpp
+++ b/doc/examples/class_Eval.cpp
@@ -2,9 +2,9 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::Eval<Eigen::Transpose<Derived> >
-evaluatedTranspose(const MatrixBase<Scalar, Derived>& m)
+evaluatedTranspose(const MatrixBase<Derived>& m)
{
return m.transpose().eval();
}
diff --git a/doc/examples/class_FixedBlock.cpp b/doc/examples/class_FixedBlock.cpp
index 18dda46e7..b643d1148 100644
--- a/doc/examples/class_FixedBlock.cpp
+++ b/doc/examples/class_FixedBlock.cpp
@@ -2,16 +2,16 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
Eigen::Block<Derived, 2, 2>
-topLeft2x2Corner(MatrixBase<Scalar, Derived>& m)
+topLeft2x2Corner(MatrixBase<Derived>& m)
{
return Eigen::Block<Derived, 2, 2>(m.asArg(), 0, 0);
}
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::Block<Derived, 2, 2>
-topLeft2x2Corner(const MatrixBase<Scalar, Derived>& m)
+topLeft2x2Corner(const MatrixBase<Derived>& m)
{
return Eigen::Block<Derived, 2, 2>(m.asArg(), 0, 0);
}
diff --git a/doc/examples/class_Row.cpp b/doc/examples/class_Row.cpp
index 23358d869..4071b8c0d 100644
--- a/doc/examples/class_Row.cpp
+++ b/doc/examples/class_Row.cpp
@@ -2,16 +2,16 @@
USING_PART_OF_NAMESPACE_EIGEN
using namespace std;
-template<typename Scalar, typename Derived>
+template<typename Derived>
Eigen::Row<Derived>
-firstRow(MatrixBase<Scalar, Derived>& m)
+firstRow(MatrixBase<Derived>& m)
{
return Eigen::Row<Derived>(m.asArg(), 0);
}
-template<typename Scalar, typename Derived>
+template<typename Derived>
const Eigen::Row<Derived>
-firstRow(const MatrixBase<Scalar, Derived>& m)
+firstRow(const MatrixBase<Derived>& m)
{
return Eigen::Row<Derived>(m.asArg(), 0);
}