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

is there an input operator

Tags: None
(comma "," separated)
HWJ
Registered Member
Posts
18
Karma
0

is there an input operator

Wed Feb 18, 2009 11:09 am
Hi,

I'd like to write

#include
#include
USING_PART_OF_NAMESPACE_EIGEN
int main() {
MatrixXi A(2,3);
cerr > A;
cout > A(i,j);

Is there such a beast?

Furthermore, is there an option to start indexing at 1 (instead of 0) ?

Many thanks for a hint,
Helmut.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

RE: is there an input operator

Wed Feb 18, 2009 12:51 pm
HWJ wrote:It should just perform the double loop
for (int i=0; i > A(i,j);

Is there such a beast?


No, there's no input yet in Eigen. It would be rather nontrivial to make it in such a way that's usable for a broad range of users.

Nothing prevents you from having your own overload of operator MatrixBase so you could fill directly an arbitrary expression.

HWJ wrote:Furthermore, is there an option to start indexing at 1 (instead of 0) ?


No, there's no such option. It could only be implemented as a separate method (in order to not disturb code that assumed 0-based access) and then nothing prevents you from adding such a method directly in MatrixBase:

http://eigen.tuxfamily.org/api/CustomizingEigen.html


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell