Registered Member
|
Hello,
Basically I am trying to develop some iterative algorithms that involve matrix with varying size, for instance, something like
Here, P and Q are initially n*1 matrix, and they grow during the iteration, so the column size is dynamic, I would like to know the best practice to use Eigen for this case, it seems to me I have to use "resize" every time the column size has been increased, is there any better solution ? |
Moderator
|
if you know a reasonable bound m for j, better allocate n*m matrices P and Q once.
Otherwise you can use conservativeResize(NoChange,alloc_size) and double alloc_size whenever alloc_size<=j. Increasing it one by one will be rather slow. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]