[eigen] Performing colwise norm() and squaredNorm() |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Performing colwise norm() and squaredNorm()
- From: Manoj Rajagopalan <rmanoj@xxxxxxxxx>
- Date: Sat, 22 May 2010 19:09:02 -0400
- Organization: EECS Dept., University of Michigan, Ann Arbor, MI, USA
Hi,
In the following program, I try to compute the squaredNorm of each column
of a complex-double matrix. The result should be a vector of doubles which
should be assignable to a vector of doubles. It seems Eigen sets the type of
the temporary to be complex-double and indicates that I am illegally mixing
different types. Is this by design?
int main(void)
{
int const N = 5;
MatrixXcd M(N,N);
M.setRandom();
VectorXd v(N);
v.setZero();
v += M.colwise().squaredNorm(); // <-- ERROR: mixing types
// also with norm()
return 0;
}
Thanks,
Manoj