NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ operator=()

template<typename T >
distributed_array< T > & cntr::distributed_array< T >::operator= ( const distributed_array< T > &  g)

Definition at line 48 of file cntr_distributed_array_impl.hpp.

48  {
49  size_t len;
50  if(this==&g) return *this;
51  if(data_!=0) delete [] data_;
52  blocksize_=g.blocksize();
53  n_=g.n();
54  tid_=g.tid();
55  ntasks_=g.ntasks();
56  tid_map_=g.tid_map();
57  maxlen_=g.maxlen();
58  len=maxlen_*n_;
59  if(len>0){
60  data_ = new T [len];
61  memcpy(data_, g.data(), sizeof(T)*len);
62  }else{
63  data_=0;
64  }
65  return *this;
66 }