[Dune-devel] GSOC2013

Christian Engwer christian.engwer at uni-muenster.de
Mon Apr 15 23:59:21 CEST 2013


Hi Shailesh,

> if (&a!=this) // check if this and a are different objects
> {
>     // copy data
>     for (size_type i=0; i<this->n; i++) this->p[i]=a.p[i];
>     for (size_type i=0; i<this->n; i++) this->j[i]=a.j[i];
> }
> 
> cant we reduce it to O(N) instead of O(2N) in single loop
> for(size_type i=0; i<this->n;i++)
> {
>     this->p[i]=a.p[i];
>     this->j[i]=a.j[i];
> }

first of all O(N) == O(2N) and the number of operations are exactly
the same. The copy operation is totally memory bound, so there
shouldn't be any difference.

Ciao
Christian




More information about the Dune-devel mailing list