[Dune] arithmetic operators for FieldVector<K,1>

Christian Engwer christi at uni-hd.de
Mon Dec 4 22:01:12 CET 2006


Hi Carsten,

did you try running your code without the arithmetic operators? You
arguments sound convincing, but I would first test the
implications. If it worked for you, I think we could/should remove the
arithmetic operators.

Christian

On Mon, Oct 23, 2006 at 03:23:44PM +0200, Carsten Graeser wrote:
> Hello,
> are explicit overloads for arithmetic operator in FieldVector<K,1>
> necessary ? Having 'operator K' and 'operator K () const' these
> operators are overloaded ambiguously preventing the simple use
> 
> 	double a = x[i] + 1.0;
> 	double b = x[i] - 1.0;
> 	double c = x[i] * 1.0;
> 
> where x is a BlockVector< FieldVector<double,1> >. So one has to write
> 
> 	double c = -1.0 + T[i];
> 
> Shouldn't 'operator K' and 'operator K () const' be enough since the
> overloaded arithmetic operators only refer to the operators for K ?
> 
> Carsten
> 
> 




More information about the Dune mailing list