2007-12-29 00:20:00 +08:00
|
|
|
#include <Eigen/Core>
|
2007-09-28 14:17:36 +08:00
|
|
|
|
2007-12-24 19:14:25 +08:00
|
|
|
USING_PART_OF_NAMESPACE_EIGEN
|
2007-10-12 04:14:01 +08:00
|
|
|
|
2007-09-28 14:17:36 +08:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
template<typename Scalar, typename Derived>
|
2007-12-24 19:14:25 +08:00
|
|
|
void foo(const MatrixBase<Scalar, Derived>& m)
|
2007-09-28 14:17:36 +08:00
|
|
|
{
|
2007-10-14 00:56:24 +08:00
|
|
|
cout << "Here's m:" << endl << m << endl;
|
2007-09-28 14:17:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename Scalar, typename Derived>
|
2007-10-13 22:19:23 +08:00
|
|
|
Eigen::ScalarMultiple<Derived>
|
2007-12-24 19:14:25 +08:00
|
|
|
twice(const MatrixBase<Scalar, Derived>& m)
|
2007-09-28 14:17:36 +08:00
|
|
|
{
|
2007-10-14 00:56:24 +08:00
|
|
|
return 2 * m;
|
2007-09-28 14:17:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int, char**)
|
|
|
|
{
|
2007-10-14 00:56:24 +08:00
|
|
|
Matrix2d m = Matrix2d::random();
|
|
|
|
foo(m);
|
|
|
|
foo(twice(m));
|
|
|
|
return 0;
|
2007-09-28 14:17:36 +08:00
|
|
|
}
|