Discussion:
[eigen] following up on dynamic allocation
Gael Guennebaud
2018-05-22 11:57:33 UTC
Permalink
For the record, this question has been answered on SO:
https://stackoverflow.com/questions/50431053/eigen3-defining-a-variable-size-matrix

gael
Hi, the problem with your first function is that any parameter passed to
a template has to be a constant or another template parameter, so in
1. Your function has to be a template itself, and
2. either "n" and "p" have to be parameters of the template, or they
have to be deduced from the matrix type (you can only do that with fixed
type matrices).
marco stamazza
2018-05-23 00:26:59 UTC
Permalink
Thanks guys.
Post by Gael Guennebaud
https://stackoverflow.com/questions/50431053/eigen3-
defining-a-variable-size-matrix
gael
Hi, the problem with your first function is that any parameter passed to
a template has to be a constant or another template parameter, so in
1. Your function has to be a template itself, and
2. either "n" and "p" have to be parameters of the template, or they
have to be deduced from the matrix type (you can only do that with fixed
type matrices).
--
"Anyone who lives within their means suffers from a lack of imagination."
Loading...