Files
eigen/doc/example.cpp

27 lines
458 B
C++
Raw Normal View History

2007-10-07 15:59:09 +00:00
#include "../src/Core.h"
2007-09-28 06:17:36 +00:00
USING_EIGEN_DATA_TYPES
2007-09-28 06:17:36 +00:00
using namespace std;
template<typename Scalar, typename Derived>
void foo(const Eigen::Object<Scalar, Derived>& m)
2007-09-28 06:17:36 +00:00
{
cout << "Here's m:" << endl << m << endl;
2007-09-28 06:17:36 +00:00
}
template<typename Scalar, typename Derived>
Eigen::ScalarMultiple<Derived>
twice(const Eigen::Object<Scalar, Derived>& m)
2007-09-28 06:17:36 +00:00
{
return 2 * m;
2007-09-28 06:17:36 +00:00
}
int main(int, char**)
{
Matrix2d m = Matrix2d::random();
foo(m);
foo(twice(m));
return 0;
2007-09-28 06:17:36 +00:00
}