24 #if defined __cplusplus
34 static struct ZSymbol ZSymbols[] = { { 0,
"n" }, { 1,
"H" }, { 2,
"He" }, { 3,
"Li" }, { 4,
"Be" }, { 5,
"B" }, { 6,
"C" },
35 { 7,
"N" }, { 8,
"O" }, { 9,
"F" }, { 10,
"Ne" }, { 11,
"Na" }, { 12,
"Mg" }, { 13,
"Al" }, { 14,
"Si" }, { 15,
"P" },
36 { 16,
"S" }, { 17,
"Cl" }, { 18,
"Ar" }, { 19,
"K" }, { 20,
"Ca" }, { 21,
"Sc" }, { 22,
"Ti" }, { 23,
"V" }, { 24,
"Cr" },
37 { 25,
"Mn" }, { 26,
"Fe" }, { 27,
"Co" }, { 28,
"Ni" }, { 29,
"Cu" }, { 30,
"Zn" }, { 31,
"Ga" }, { 32,
"Ge" }, { 33,
"As" },
38 { 34,
"Se" }, { 35,
"Br" }, { 36,
"Kr" }, { 37,
"Rb" }, { 38,
"Sr" }, { 39,
"Y" }, { 40,
"Zr" }, { 41,
"Nb" }, { 42,
"Mo" },
39 { 43,
"Tc" }, { 44,
"Ru" }, { 45,
"Rh" }, { 46,
"Pd" }, { 47,
"Ag" }, { 48,
"Cd" }, { 49,
"In" }, { 50,
"Sn" }, { 51,
"Sb" },
40 { 52,
"Te" }, { 53,
"I" }, { 54,
"Xe" }, { 55,
"Cs" }, { 56,
"Ba" }, { 57,
"La" }, { 58,
"Ce" }, { 59,
"Pr" }, { 60,
"Nd" },
41 { 61,
"Pm" }, { 62,
"Sm" }, { 63,
"Eu" }, { 64,
"Gd" }, { 65,
"Tb" }, { 66,
"Dy" }, { 67,
"Ho" }, { 68,
"Er" }, { 69,
"Tm" },
42 { 70,
"Yb" }, { 71,
"Lu" }, { 72,
"Hf" }, { 73,
"Ta" }, { 74,
"W" }, { 75,
"Re" }, { 76,
"Os" }, { 77,
"Ir" }, { 78,
"Pt" },
43 { 79,
"Au" }, { 80,
"Hg" }, { 81,
"Tl" }, { 82,
"Pb" }, { 83,
"Bi" }, { 84,
"Po" }, { 85,
"At" }, { 86,
"Rn" }, { 87,
"Fr" },
44 { 88,
"Ra" }, { 89,
"Ac" }, { 90,
"Th" }, { 91,
"Pa" }, { 92,
"U" }, { 93,
"Np" }, { 94,
"Pu" }, { 95,
"Am" }, { 96,
"Cm" },
45 { 97,
"Bk" }, { 98,
"Cf" }, { 99,
"Es" }, { 100,
"Fm" }, { 101,
"Md" }, { 102,
"No" }, { 103,
"Lr" }, { 104,
"Rf" }, { 105,
"Db" },
46 { 106,
"Sg" }, { 107,
"Bh" }, { 108,
"Hs" }, { 109,
"Mt" } };
50 int length,
double *
data,
char const *fromUnits[2],
char const *toUnits[2] );
73 for( i = 0; i <
n; i++ ) {
84 char s[1024] =
"", *q, *
e;
86 if( strlen( name ) >= (
sizeof( s ) - 1 ) ) {
91 *Z = *A = *m = *level = 0;
92 if( ( !strncmp(
"FissionProduct", name, 14 ) ) || !strncmp(
"99120", name, 5 ) ) {
97 if( strcmp(
"gamma", name ) == 0 )
return( 0 );
98 if( strcmp(
"n", name ) == 0 ) { *A = 1;
return( 0 ); }
100 for( p = name, q = s; ( *p != 0 ) && !isdigit( *p ) && ( *p !=
'_' ); p++, q++ ) *q = *p;
110 if( strncmp( p,
"_natural", 8 ) == 0 ) {
117 for( q = s; isdigit( *p ); p++, q++ ) *q = *p;
119 if( strcmp( s,
"natural" ) == 0 ) {
123 *A = (
int) strtol( s, &e, 10 );
148 level = (
int) strtol( p, &e, 10 );
173 if( !
smr_isOk( smr ) )
return( NULL );
189 if( !
smr_isOk( smr ) )
return( NULL );
192 if( element != NULL ) {
205 const char *fmt, ... ) {
211 va_start( args, fmt );
216 va_start( args, fmt );
234 if( d < ds[0] )
return( -2 );
235 if( d > ds[n-1] )
return( -1 );
237 imid = ( imin +
imax ) >> 1;
238 if( imid == imin )
break;
254 int n = (
int) strlen( fileName ) + 1, nCwd = 0;
255 char *absPath,
cwd[4 * 1024] =
"", *
p, *needle;
257 if( fileName[0] !=
'/' ) {
260 if( getcwd( cwd,
sizeof( cwd ) ) == NULL ) {
264 nCwd = (
int) strlen( cwd );
267 if( ( absPath = (
char *)
smr_malloc2( smr, n, 0,
"absPath" ) ) == NULL )
return( NULL );
268 if( fileName[0] !=
'/' ) {
269 strcpy( absPath, cwd );
270 strcat( absPath,
"/" );
271 strcat( absPath, fileName ); }
273 strcpy( absPath, fileName );
277 if( ( needle = strstr( absPath,
"/./" ) ) == NULL )
break;
279 for( needle += 2; *needle;
p++, needle++ ) *
p = *needle;
283 if( ( needle = strstr( absPath,
"/../" ) ) == NULL )
break;
285 while( (
p > absPath ) && ( *
p !=
'/' ) )
p--;
286 if( *
p !=
'/' )
break;
287 if(
p == absPath )
break;
288 for( needle += 3; *needle;
p++, needle++ ) *
p = *needle;
302 for( i = 0; ; i++ ) {
317 char const *frameString;
340 while( isspace( *s ) ) s++;
341 *value = strtod( s, &e ) * conversion;
346 while( isspace( *e ) ) e++;
347 if( strcmp( e, unit ) != 0 ) {
362 char const *
s1 = str;
366 while( isspace( *s1 ) ) s1++;
367 *value = strtod( s1, &e1 );
372 while( isspace( *e1 ) ) e1++;
385 if( strcmp( fromUnit, toUnit ) == 0 )
return( 1.0 );
387 if( strcmp( fromUnit,
"eV" ) == 0 ) {
388 if( strcmp( toUnit,
"MeV" ) == 0 )
return( 1
e-6 ); }
389 else if( strcmp( fromUnit,
"MeV" ) == 0 ) {
390 if( strcmp( toUnit,
"eV" ) == 0 )
return( 1
e+6 ); }
391 else if( strcmp( fromUnit,
"1/eV" ) == 0 ) {
392 if( strcmp( toUnit,
"1/MeV" ) == 0 )
return( 1
e+6 ); }
393 else if( strcmp( fromUnit,
"1/MeV" ) == 0 ) {
394 if( strcmp( toUnit,
"1/eV" ) == 0 )
return( 1
e-6 ); }
395 else if( strcmp( fromUnit,
"K" ) == 0 ) {
396 if( strcmp( toUnit,
"MeV/k" ) == 0 )
return( 8.617343183775137
e-11 );
410 char const *fromUnits[2];
413 if( !
smr_isOk( smr ) )
return( NULL );
415 if( !
smr_isOk( smr ) )
return( NULL );
429 char const *fromUnits[2];
448 int length,
double *
data,
char const *fromUnits[2],
char const *toUnits[2] ) {
450 double xFactor, yFactor;
460 ptwXY =
ptwXY_create( interpolation, NULL, 2., 1
e-3, length, 10, length, data, &status, 0 );
466 if( ( xFactor != 1. ) || ( yFactor != 1. ) ) {
484 transportabilitiesMap::iterator iter = transportabilities->find( PoPID );
486 if( iter != transportabilities->end( ) ) {
487 switch ( iter->second ) {
491 switch( transportability ) {
507 switch( transportability ) {
519 (*transportabilities)[PoPID] = transportability;
529 #if defined __cplusplus