Re: [eigen] Multiple dimensions Matrix

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 18.08.2015 at 17:09, Nuno Marques wrote:
As was already suggested, there is the not-stable-yet Tensor module.
Depending on what you actually plan to do, a simple
typedef Eigen::Matrix<float, 3, 2> Matrix32;
std::vector<Matrix32> buffer;
might be sufficient, as well ...
Well the way I'm working with those, I can't tell if that's what I pretend or not.This is the way I'm using Tensors (in https://github.com/TSC21/Firmware/blob/apply_eigen_math/src/modules/position_estimator_inav/position_estimator_inav_main.cpp):

Glancing over your source, a std::vector<Matrix...> looks more suitable.
Essentially, you need to replace

  Tensor<...> buffer(BUFFER_SIZE,3,2);
  //access:
  buffer(i, x,y);

  std::vector<...> buffer(BUFFER_SIZE);
  //access:
  buffer[i](x,y);


I guess your code needs some clean-up anyways (starting with storing x_est, y_est, z_est in a pos and a vel vector instead of 3 Vector2f; not passing vectors by value ...)


Christoph




--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/