Re: [eigen] An insistent plea for an input operator |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] An insistent plea for an input operator
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 20 Jul 2010 15:41:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=knBrhdijnpRQgA1M7Nl/cDJUqE/vXvrXtXMSYZaehsA=; b=YqA6Wj+q3qJMUS5FksYWf+A6J+ZCtgwsCdMNCfGxZBGaqdeJdMnv6rQ8q+rHF4hhD/ gEgWQHP825EzQ2BwXSUAwPreAeaK50s1yeZHOh7jRlQliBX9go1HRx+X1pH3yNR1zVgV tv3a5ZFa8QadXdOGcLKQscHC2Ixjl72qDpJSs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=oT5diFSfSZT8bL+Rlh+vAx+xtojcyZAQU/HSweuyYfemiMLhufMlJGp2kdLDVKSybf gQKBMqs/6PKYgpcjRBt4dW6l+5jC6ImOrNkvCfUPeAB8DUG7sCYG9tNVnw9dbRL1xXup iNfmQl2apjyXWM7fsI6uPp5u+MStFiOrG9uN0=
I'm ok to add it, I cannot see how it could block us in the future to
support more sophisticated input format.
gael
On Tue, Jul 20, 2010 at 2:48 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> ok, my biggest objection was that getting general input right is hard,
> and that we must then get the API right; but I can agree that in any
> case we'll end up supporting the very simple stream format that your
> operator>> is supporting. So, why not.
>
> Others?
>
> Benoit
>
> 2010/7/20 Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>:
>> Hi,
>>
>> I know, I've asked for this feature several month, ago,
>> but I'm obstinate to ask for it again and again.
>>
>> Background: I'm teaching C++ for beginners (mathematicians) and
>> there should be an easy input operator for matrices and vectors.
>>
>> Currently, I have to patch Eigen (2 or 3) by adding
>>
>> namespace Eigen {
>> template<typename Derived>
>> std::istream & operator >>(std::istream & Inp, MatrixBase<Derived> & m)
>> {
>> for (int i = 0; i < m.rows(); ++i)
>> for (int j = 0; j < m.cols(); j++)
>> Inp >> m(i,j);
>>
>> return Inp;
>> }
>>
>> }
>>
>> to make the following simple program run
>>
>>
>> int main() {
>> Eigen::MatrixXi A(2,3);
>> std::cerr << "intput 2x3 matrix:\n";
>> std::cin >> A;
>> std::cout << "I've got:\n" << A << std::endl;
>> }
>>
>> I've never understood the objections against adding this.
>> Pardon for being such obstinate,
>> Helmut.
>>
>> My problem is, that students download Eigen themselves and forget about
>> adding these few lines.
>>
>> --
>> Helmut Jarausch
>>
>> Lehrstuhl fuer Numerische Mathematik
>> RWTH - Aachen University
>> D 52056 Aachen, Germany
>>
>>
>>
>>
>
>
>