Re: [Lapackpp-devel] a problem on LaIndex class operator +
Status: Beta
Brought to you by:
cstim
|
From: Christian S. <sti...@tu...> - 2008-06-10 20:03:53
|
Am Dienstag, 10. Juni 2008 10:11 schrieb 小小河/tp:
> hi stimming,
> i am a new user of lapack++2.5.2. i have trouble with the LaIndex class
> operator +. your code in laindex.h is that
> ---------
> inline LaIndex& operator+(int i) {
> start_+=i; end_+=i; return *this;}
> ---------
> the problem is that, when the operator + is used like this:
> -------------
> LaIndex i(0,1);
> LaGenMatDouble A(3,3);
> std::cout << A(i+1,i+1);
> -------------
> the third line will cause an error, because i has been changed to be
> (2:1:3) not expected (0:1:1).
>
> I think the following definition maybe better:
> ------------
> inline LaIndex operator+(int i);
> ------------
Absolutely. Thanks for pointing this out. I've committed this to SVN and it
will be in the next release.
Christian
|