src/ESRLib/SpinSpace.cc
// ----------------------------------------------------------------------------
//           Functions To Make A Spin System From A Parameter Set
// ----------------------------------------------------------------------------
Functions To Make A Spin System From A Parameter Set
Functions To Make A Spin System From A Parameter Set
int SpinSpace::getSpins(const ParameterSet& pset, int warn) const
  {
  int ns = 0;					
  string pstate, pname("NSpins");		
  list<SinglePar>::const_iterator item;		
  item = pset.seek(pname);		 	
  if(item != pset.end()) 			
    (*item).parse(pname,ns,pstate);		
  else
    {
    if(warn)
      {
      error(2, pname, 1); 			
      if(warn > 1)  fatality(3);		
      }
    ns = -1;
    }
  return ns;
  }
int SpinSpace :: getSpins ( const ParameterSet & pset , int warn ) const { int ns = 0 ; string pstate , pname ( " " ) ; list < SinglePar > :: const_iterator item ; item = pset . seek ( pname ) ; if ( item != pset . end ( ) ) ( * item ) . parse ( pname , ns , pstate ) ; else { if ( warn ) { error ( 2 , pname , 1 ) ; if ( warn > 1 ) fatality ( 3 ) ; } ns = -1 ; } return ns ; }
Functions To Make A Spin System From A Parameter Set
Functions To Make A Spin System From A Parameter Set
// Input                sys	: A spin system (this) //                      pset    : A parameter set //			warn	: Warning level //					0 = no warnings //					1 = warnings //				       >1 = fatal warnings // Output               ns      : Number of spins specified by  //                                parameter NSpins in pset // Note                         : This does NOT set the number of spins // Note				: Return -1 if # of spins not found // Assume no spins // Parameter name // A pix into parameter list // Pix in param. list for NSpins // Retrieve the number of spins // if it was found in the list // Can't read in NSpins // This is a fatal error