Registered Member
|
Hello,
I want to initialize an Eigen::ArrayXcf (an Array of std::complex<float> ) to be zero. This code fragment: #include <Eigen/Dense> using namespace Eigen; .......... std::vector<size_t> coil_im_dims_; coil_im_dims_.clear(); coil_im_dims_.push_back(256); coil_im_dims_push_back(256); ArrayXcf cg_x = ArrayXcf::Zero(coil_im_dims_[0], coil_im_dims_[1]); ............. will encounter a running error: /usr/local/inclue/Eigen/src/Core/util/XprHelper.h: 53: Eigen::internal::variable_if_dynamic<T, Value>::variable_if_dynamic(T) [with T = long int; int Value=1]: Assertion 'v == T(Value)' failed. What should I do to solve this problem? Thank you for your help. Best wishes, Jia Sen |
Moderator
|
ArrayXcf is 1D, use ArrayXXcf for 2D. (yes I know that's a bit confusing with MatrixXcf which has only one 'X' but 'Matrix' 2D by nature....)
|
Registered Member
|
Thank you so much. So mindless mistake I made. The problem has been solved.
Best wishes, Jia Sen |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]