11#if defined __cplusplus
33 if( size < 10 ) size = 10;
43 if( pops == NULL )
return( NULL );
55 if( pops == NULL )
return( 0 );
56 for( pop = pops->
first; pop != NULL; pop = next ) {
68 double level_MeV,
MCGIDI_POP *parent,
int globalParticle ) {
78 if( sorted == NULL )
return( NULL );
85 if( ( pop =
MCGIDI_POP_new( smr, name, mass_MeV, level_MeV, parent ) ) == NULL )
return( NULL );
88 if( pops->
first == NULL ) {
96 if( globalParticle ) {
106 int iCmp = 0, min = 0, mid = 0, max = pops->
numberOfPOPs;
108 if( max == 0 )
return( -1 );
109 while( ( max - min ) > 1 ) {
110 mid = ( min + max ) / 2;
111 iCmp = strcmp( name, pops->
sorted[mid]->
name );
112 if( iCmp == 0 )
return( mid );
120 if( strcmp( name, pops->
sorted[0]->
name ) == 0 )
return( 0 );
122 if( max < pops->numberOfPOPs ) {
123 if( strcmp( name, pops->
sorted[max]->
name ) == 0 )
return( max );
126 if( strcmp( name, pops->
sorted[0]->
name ) < 0 )
return( -1 );
137 if( index < 0 )
return( NULL );
138 return( pops->
sorted[index] );
147 fprintf( f,
"POPs Information: n = %d\n", pops->
numberOfPOPs );
170 if( pop == NULL )
return( NULL );
193 if( pop == NULL )
return( NULL );
203 if( pop == NULL )
return( NULL );
217#if defined __cplusplus
MCGIDI_POP * MCGIDI_POPs_addParticleIfNeeded(statusMessageReporting *smr, MCGIDI_POPs *pops, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent, int globalParticle)
int MCGIDI_miscNameToZAm(statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
MCGIDI_POP * MCGIDI_POPs_findParticle(MCGIDI_POPs *pops, char const *name)
MCGIDI_POP * MCGIDI_POP_new(statusMessageReporting *smr, char const *name, double mass_MeV, double level_MeV, MCGIDI_POP *parent)
void * MCGIDI_POPs_free(MCGIDI_POPs *pops)
int MCGIDI_POPs_findParticleIndex(MCGIDI_POPs *pops, char const *name)
void MCGIDI_POPs_printSortedList(MCGIDI_POPs *pops)
int MCGIDI_POPs_initial(statusMessageReporting *smr, MCGIDI_POPs *pops, int size)
MCGIDI_POP * MCGIDI_POP_free(MCGIDI_POP *pop)
MCGIDI_POPs * MCGIDI_POPs_new(statusMessageReporting *smr, int size)
void MCGIDI_POPs_writeSortedList(MCGIDI_POPs *pops, FILE *f)
MCGIDI_POP * MCGIDI_POP_release(MCGIDI_POP *pop)
int MCGIDI_POPs_release(MCGIDI_POPs *pops)
double MCGIDI_POP_getMass_MeV(MCGIDI_POP *pop)
int lPoPs_addParticleIfNeeded(statusMessageReporting *smr, char const *name, char const *special)
#define smr_allocateCopyString2(smr, s, forItem)
void * smr_freeMemory(void **p)
#define smr_malloc2(smr, size, zero, forItem)
MCGIDI_GammaBranching * gammas