[Dune-devel] GSOC2013

shailesh borkar shaileshborkar9 at gmail.com
Tue Apr 16 17:46:03 CEST 2013


Hello everyone,
	While going through the code in dune/common/array.hh file, i found
that we have not checked the array index bound condition in

reference operator[] (size_type i)
{
      return a[i];
}

const_reference operator[] (size_type i) const
{
      return a[i];
}

So it will be better if we check the condition for index of array,
reference operator[] (size_type i)
{
	assert(i<=(N-1))//i should be less than N
	return a[i];
}

Also in fmatrix.hh file, in copy constructor
FieldVector (const FieldVector & x) : _data(x._data)
{}

we should check for equality of sizes
FieldVector (const FieldVector & x)
{
	assert(SIZE==x.size())
	_data=x._data;
}
Thanks.




More information about the Dune-devel mailing list