Re: [eigen] An insistent plea for an input operator

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


On Tue, Jul 20, 2010 at 5:14 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2010/7/20 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>>> Sure! How is this a problem?
>>
>> Not really but somebody might think hey, it accepts input from
>> std::cin in the form of
>>
>> 1 2 3
>> 4 5 6
>>
>> why not from a text file... I admit, we can easily deal with that. I
>> was more like brainstorming. ;)
>
> Just for the record: I don't see how allowing reading from a text file
> is a drawback, I see it as a feature :-)

Of course it is! But not if it does not work even though it compiles.
I requires a different method.

Your other proposal sound fine to me as long as its fine for the user.
I was actually hoping for something as the standard library does. You
know, there are these modifiers. I don't recall perfectly, but they
somehow look like this

std::cout << std::ios_base::hex << 10 << std::endl;

or then with Eigen types like this

std::cout << Eigen::Format(...) << m;

or this

std::cin >> Eigen::Format(...) >> m;

I would like this a lot since it were following the standard approach
but the other one is fine too.

- Hauke



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