Registered Member
|
Hi everyone,
I am new to Eigen and would like to know if its possible that Eigen assign values from a data file directly to a matrix. I mean something like the following suppose I have the following text file. 1 2 2.3 8 2 3.2 4 1.2 Is there way to assign these values to: MatrixXd x Regards, |
Moderator
|
No, you have to implement this yourself. The main reason is that there is no clear standard format to store matrices, so we prefer to let users do their own cooking here.
|
Registered Member
|
|
Registered Member
|
Perhaps CSV support would be possible in the future? It's standardized (RFC 4180) and seems to be _the_ lowest-common-denominator data-exchange format supported by a very wide range of software, from spreadsheets (e.g. Gnumeric, Microsoft Excel, Open Office), through scientific computing software (e.g. Mathematica, MATLAB, GNU Octave, Scilab), to a variety of statistical packages (E-Views, Ox, OxMetrics, R, SAS, STATA, ...). Ideally, overloading the operator<< so that in addition to current functionality it accepts a csv-file as a right-operand would fit with the way Eigen does things -- and "comma-initialization" description would still fit perfectly! |
Moderator
|
ok, thank you for the suggestion. Seeing the amount of software supporting this format it might indeed make sense to have it in Eigen. I'm adding an entry on our bugzilla to not forget about it. Patch welcome
|
Registered Member
|
|
Registered Member
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora