AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ deepcopy()

template<class S , class T >
void aff::deepcopy ( const S &  source,
T &  target 
)

deep copy

Takes any two containers with appropriate interface and copies as many values as possible from source to target.

Parameters
sourcecontainer to read values from
targetcontainer to write values to
See also
aff::Array::copyin
aff::Series::copyin

Definition at line 65 of file deepcopy.h.

Referenced by aff::Series< T >::copyin(), and aff::Array< T >::copyin().

66  {
67  // acces source through container of const (read only access)
68  typedef typename S::Tcontainer::Tcoc Tscoc;
69  typedef typename Tscoc::Trepresentation Tsrep;
70  typedef typename Tscoc::Tstepper Tsstp;
71  // access types for target
72  typedef typename T::Tcontainer Ttcon;
73  typedef typename Ttcon::Trepresentation Ttrep;
74  typedef typename Ttcon::Tstepper Ttstp;
75  // alias for source and target
76  const Tscoc& csource(source);
77  Ttcon ctarget(target);
78  // representations
79  Tsrep srep(csource.representation());
80  Ttrep trep(ctarget.representation());
81  // steppers
82  Tsstp sstp(csource.shape());
83  Ttstp tstp(ctarget.shape());
84  sstp.tofirst();
85  tstp.tofirst();
86  while (sstp.valid() && tstp.valid())
87  {
88  trep[tstp.current()]=srep[sstp.current()];
89  tstp.incr();
90  sstp.incr();
91  }
92  } // deepcopy
Here is the caller graph for this function: