NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ operator=() [1/2]

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

Overloaded operator '='. It copies data from an existing function object

Purpose

Overloaded operator '='. It copies data from an existing function object. It copies all data from the existing function object. The method is specified for right value reference when C++11 is used.

Parameters
g

the function object one wants to copy.

Definition at line 216 of file cntr_function_impl.hpp.

References cntr::function< T >::nt_.

216  {
217  int len;
218  if (this == &g)
219  return *this;
220  if (data_ != 0)
221  delete[] data_;
222  nt_ = g.nt_;
223  size1_ = g.size1_;
224  size2_ = g.size2_;
225  element_size_ = size1_ * size2_;
226  len = (nt_ + 2) * size1_ * size2_;
227  if (len > 0) {
228  total_size_ = len;
229  data_ = new cplx[len];
230  memcpy(data_, g.data_, sizeof(cplx) * len);
231  } else {
232  data_ = 0;
233  }
234  return *this;
235 }
int size2_
Number of the rows in the Matrix form.
int total_size_
Size of the data stored for the function on the real-time axis including ; * size1 * size2 ...
cplx * data_
Pointer to the function in the Matrix form on the real-time axis ( ) ; &#39;data_+ element_size&#39; corresp...
int size1_
Number of the colums in the Matrix form.
std::complex< T > cplx
int nt_
Maximum number of the time steps.