[eigen] Assignment of Complex Number |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: [eigen] Assignment of Complex Number*From*: Gokturk <poyrazoglu@xxxxxxxx>*Date*: Wed, 11 Jun 2014 12:21:42 -0400

Hi there, It might be an easy task for you guys, but I couldn't figure it out by myself. I am hoping one of you can help me on my problem. I define a complex double vector, but I am not able to assign a value to both real and imaginary part of an element in that vector. Here is an example of what I do. Please show me a way to complete this simple task. #include <iostream> #include <Eigen/Eigen> using namespace Eigen; using namespace std; int main() { // Imagine these are my data vectors // First one is real part // second one is imaginary partVectorXd FirstVector = VectorXd::Ones(10); VectorXd SecondVector = VectorXd::Ones(10); // Define a Complex Vector with same sizeVectorXcd ComplexVector = VectorXcd::Zero(10); // Fill Complex Vector from data Vectorsfor (int i = 0; i < 10; i++) ComplexVector(i) = (FirstVector(i), SecondVector(i)); // I was expecting to see 1+i1 as a value of Complex
Vector elementscout << " Complex Vector : \n " << ComplexVector << endl; return 0; } -- Gokturk Poyrazoglu Mitsubishi Electric Research Laboratories (MERL) 201 Broadway, Cambridge, MA |

**Follow-Ups**:**Re: [eigen] Assignment of Complex Number***From:*Christian Seiler

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] [Review] Pull request 66, Huge Tensor module improvements** - Next by Date:
**Re: [eigen] Bugs on bugzilla** - Previous by thread:
**[eigen] New CMake Version improved support for header only libraries ...** - Next by thread:
**Re: [eigen] Assignment of Complex Number**

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