NESSi  v1.0.2
The NonEquilibrium Systems Simulation Library

◆ herm_matrix() [4/5]

template<typename T >
cntr::herm_matrix< T >::herm_matrix ( const herm_matrix< T > &  g)

Initializes the herm_matrix class with the same layout as a given herm_matrix.

Purpose

Initializes the herm_matrix class with the same number of time steps nt, number of points on the imaginary branch ntau, matrix rank size1 and bosonic/fermionic symmetry sig. Works for scalar or square-matrix contour objects only.

Parameters
g

The herm_matrix according to which the class should be initialized

Definition at line 157 of file cntr_herm_matrix_impl.hpp.

157  {
158  nt_ = g.nt_;
159  ntau_ = g.ntau_;
160  sig_ = g.sig_;
161  size1_ = g.size1_;
162  size2_ = g.size1_;
163  element_size_ = size1_ * size1_;
164  if (size1_ > 0) {
165  mat_ = new cplx[(ntau_ + 1) * element_size_];
166  memcpy(mat_, g.mat_, sizeof(cplx) * (ntau_ + 1) * element_size_);
167  } else {
168  mat_ = 0;
169  }
170  if (nt_ >= 0 && size1_ > 0) {
171  les_ = new cplx[((nt_ + 1) * (nt_ + 2)) / 2 * element_size_];
172  ret_ = new cplx[((nt_ + 1) * (nt_ + 2)) / 2 * element_size_];
173  tv_ = new cplx[(nt_ + 1) * (ntau_ + 1) * element_size_];
174  memcpy(les_, g.les_,
175  sizeof(cplx) * ((nt_ + 1) * (nt_ + 2)) / 2 * element_size_);
176  memcpy(ret_, g.ret_,
177  sizeof(cplx) * ((nt_ + 1) * (nt_ + 2)) / 2 * element_size_);
178  memcpy(tv_, g.tv_,
179  sizeof(cplx) * (nt_ + 1) * (ntau_ + 1) * element_size_);
180  } else {
181  les_ = 0;
182  ret_ = 0;
183  tv_ = 0;
184  }
185 }
std::complex< T > cplx