13 #if defined __cplusplus
18 #define incrementalSize 1000
22 #define AMU2MeV 931.494028
23 #define AMU2eV ( MeV2eV * 931.494028 )
24 #define K2MeV 8.6173856922566752e-11
25 #define K2eV ( MeV2eV * K2MeV )
49 {
"MeV",
"eV",
MeV2eV }, {
"MeV",
"keV",
MeV2keV }, {
"K",
"MeV",
K2MeV }, {
"K",
"eV",
K2eV } };
51 static char const *
PoPs_genreStrings[] = {
"invalid",
"unknown",
"alias",
"photon",
"lepton",
"quark",
"meson",
"baryon",
"nucleus",
"atom" };
125 if( pops == NULL )
return( NULL );
126 sorted = &(pops[size]);
165 if( ( newPoP = (
PoP *)
smr_malloc2( smr,
sizeof(
PoP ), 0,
"newPoP" ) ) == NULL )
return( NULL );
184 if( pop->
index < 0 ) {
242 if( high == 0 )
return( -1 );
243 while( ( high - low ) > 1 ) {
244 mid = ( low + high ) >> 1;
246 if( iCmp == 0 )
return( mid );
269 if( index < 0 )
return( -1. );
329 if( index < 0 )
return( -1 );
353 if( index < 0 )
return( -1 );
369 if( protonIsNucleus ) {
381 if( index < 0 )
return( NULL );
391 if( atomIndex < 0 )
return( NULL );
401 if( index < 0 )
return( index );
409 char const *
p = NULL;
471 fprintf( f,
"\n\n" );
473 fprintf( f,
" name index genre mass hasNucleus alias info\n" );
474 fprintf( f,
" Z A l\n" );
475 fprintf( f,
" --------------------------------------------------------------------------------------------\n" );
486 fprintf( f,
" T" ); }
491 fprintf( f,
" T" ); }
495 if( pop->
Z + pop->
A > 0 ) {
496 fprintf( f,
" %3d %3d", pop->
Z, pop->
A );
498 fprintf( f,
" %d", pop->
l ); }
526 if( ( pop = (
PoP *)
smr_malloc2( smr,
sizeof(
PoP ), 0,
"pop" ) ) == NULL )
return( NULL );
589 if( ( pop =
PoP_new( smr ) ) == NULL )
return( NULL );
614 return( pop->
index );
652 if( properIndex < 0 ) {
656 if( aliasIndex >= 0 ) {
666 alias, truePop->
name, name );
670 if( ( pop =
PoP_new( smr ) ) == NULL )
return( NULL );
709 char const **unsorted = (
char const **)
smr_malloc2( smr, size *
sizeof(
char * ), 0,
"unsorted" );
711 if( unsorted == NULL )
return( NULL );
753 if( strcmp( _from, _to ) == 0 )
return( 0 );
754 for( i = 0; i <
n; i++ ) {
760 else if( strcmp(
conversions[i]._to, _from ) == 0 ) {
780 #if defined __cplusplus