[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Toon-members] Question: Dynamical resizable Matrix
From: |
E. Rosten |
Subject: |
Re: [Toon-members] Question: Dynamical resizable Matrix |
Date: |
Wed, 14 Oct 2009 10:29:22 +0100 (BST) |
User-agent: |
Alpine 2.00 (LSU 1167 2008-08-23) |
On Sun, 11 Oct 2009, Gabriel Nützi wrote:
Hello everyone
Is there a possibility to resize a Matrix, or to append during runtime more
elements or rows&columns? in an efficient way ?
Does anybody know about how to do this with TooN?
Unfortunately, this is not implemented yet.
As an interim step, you can keep the data in a std::vector, and present it
as a matrix. Eg:
std::vector<double> data;
...
...
...
wrapMatrix(&data[0], num_rows, num_cols) //This returns a matrix.
This assumes that the data is in row major order (ie you are adding rows).
You can also declare a matrix which references the data:
Matrix<Dynamic, Dynamic, double, Reference::RowMajor> m(&data[0], num_rows,
num_cols);
You can also wrap column major data (ie you are adding rows) this way.
-Ed
Thanks a lot for any advice!!
Regards Gabriel
_______________________________________________
Toon-members mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/toon-members
--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)
/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage