This forum has been archived. All content is frozen. Please use KDE Discuss instead.

vector of matrices

Tags: None
(comma "," separated)
ajax20
Registered Member
Posts
10
Karma
0

vector of matrices

Mon Jan 30, 2012 5:14 pm
hi! I would like to creat a vector of many dynamic float matrices (all same size). how do I do this?

vector<MatrixXf> test(n) ?!?
vector<MatrixXf*> test(n)

something like:

Matrix<Matrix<double,Dynamic,Dynamic>,Dynamic,1> mA;
mA.resize(5);
for(int i =0; i< 5;i++)
{
mA(i) = C.block(0,0,30,2);
}

what's wrong?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: vector of matrices

Tue Jan 31, 2012 5:08 pm
"vector<MatrixXf> test(n)" sounds goo to me.
ajax20
Registered Member
Posts
10
Karma
0

Re: vector of matrices

Tue Jan 31, 2012 7:13 pm
how could i work with pointer?

MatrixXf* test = Nulle
test->resize(5,2);
test(0,1) = 6.0; // <-- this is wrong, what shoul it be?
Akkawe
Registered Member
Posts
35
Karma
0
OS

Re: vector of matrices

Tue Jan 31, 2012 7:26 pm
ajax20 wrote:how could i work with pointer?

MatrixXf* test = Nulle
test->resize(5,2);
test(0,1) = 6.0; // <-- this is wrong, what shoul it be?


((*test)(0,1))=6.0 ?
ajax20
Registered Member
Posts
10
Karma
0

Re: vector of matrices

Tue Jan 31, 2012 8:34 pm
****, i should know it ;D thx!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]