src/Pulses/PulComposite.cc
// ____________________________________________________________________________
// iii              CLASS COMPOSITE PULSE COPY FACILITATORS 
// ____________________________________________________________________________
iii              CLASS COMPOSITE PULSE COPY FACILITATORS
iii CLASS COMPOSITE PULSE COPY FACILITATORS
void PulComposite::copyHams(const PulComposite& CPul1)
  {
  Hsteps = NULL; 
  if(CPul1.Hsteps)			
    {
    Hsteps = new gen_op[WFsteps];	
    for(int i=0; i<WFsteps; i++)	
      Hsteps[i] = CPul1.Hsteps[i];	
    Hcount = CPul1.Hcount;		
    }
  if(!Hindex) copyHIndxs(CPul1);	
  }
void PulComposite :: copyHams ( const PulComposite & CPul1 ) { Hsteps = NULL ; if ( CPul1 . Hsteps ) { Hsteps = new gen_op [ WFsteps ] ; for ( int i = 0 ; i < WFsteps ; i ++ ) Hsteps [ i ] = CPul1 . Hsteps [ i ] ; Hcount = CPul1 . Hcount ; } if ( ! Hindex ) copyHIndxs ( CPul1 ) ; }
____________________________________________________________________________
iii              CLASS COMPOSITE PULSE COPY FACILITATORS
____________________________________________________________________________
____________________________________________________________________________ iii CLASS COMPOSITE PULSE COPY FACILITATORS ____________________________________________________________________________
// Input	CPul	: A composite pulse (this) //		CPul1    : A second PulComposite // Output	none	: CPul step Hamiltonians & their indices //			  are copied from CPul1 // Note			: Assumed arrays Hsteps and Hindex //			  are currently empty // Note			: Recall that some Hsteps[n] will be empty //			  as the actual operator for n will reside //			  in Hsteps[Hindex[n]]! // If the Hamiltonians exist //	Allocate space for Hs //	Copy all of the Hamiltonians //	(Some may be NULL) //	Copy Hamiltonian count  // Copy H indices if needed