src/Bloch/BlochSys.cc
// ____________________________________________________________________________
// C              Magnetization Vector Isotope & Spin Access
// ____________________________________________________________________________
C              Magnetization Vector Isotope & Spin Access
C Magnetization Vector Isotope & Spin Access
int BlochSys::NIso() const
  {
  int nm = isotopes.size();			
  int NI = 0;					
  if(!nm) return NI;				
  std::vector<Isotope> UI;				
  UI.push_back(isotopes[0]);			
  NI++; 					
  int i, j;					
  bool unique = true;				
  Isotope I;					
  for(i=1; i<nm; i++)				
    {
    I = isotopes[i];				
    unique = true;				
    for(j=0; j<NI && unique; j++)		
      { if(I == UI[j]) unique=false; }		
    if(unique)					
      { UI.push_back(isotopes[nm]); NI++; }	
    }
  return NI;					
  }
int BlochSys :: NIso ( ) const { int nm = isotopes . size ( ) ; int NI = 0 ; if ( ! nm ) return NI ; std :: vector < Isotope > UI ; UI . push_back ( isotopes [ 0 ] ) ; NI ++ ; int i , j ; bool unique = true ; Isotope I ; for ( i = 1 ; i < nm ; i ++ ) { I = isotopes [ i ] ; unique = true ; for ( j = 0 ; j < NI && unique ; j ++ ) { if ( I == UI [ j ] ) unique = false ; } if ( unique ) { UI . push_back ( isotopes [ nm ] ) ; NI ++ ; } } return NI ; }
____________________________________________________________________________
C              Magnetization Vector Isotope & Spin Access
____________________________________________________________________________
____________________________________________________________________________ C Magnetization Vector Isotope & Spin Access ____________________________________________________________________________
// Number of vectors // No isotopes so far // If none, no isotopes // Unique isotopes // 1st one is unique! // We have at least one // Temp indices // Flag for unique isotope // Temp isotope // Loop remaining vectors //   Get the isotope type //   Assume it is unique //   Compare with others //   to see if really unique //   If it is indeed unique //   store in list & count // Return number of isotopes