Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/nf_utilities.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002 # <<BEGIN-copyright>>
0003 # Copyright 2019, Lawrence Livermore National Security, LLC.
0004 # This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
0005 # gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
0006 # SPDX-License-Identifier: MIT
0007 # <<END-copyright>>
0008 */
0009 
0010 #ifndef nf_utilities_h_included
0011 #define nf_utilities_h_included
0012 
0013 #define _USE_MATH_DEFINES
0014 #include <stdio.h>
0015 #include <stdint.h>
0016 #include <string.h>
0017 #include <stdarg.h>
0018 #include <math.h>
0019 
0020 #include <statusMessageReporting.h>
0021 
0022 extern int nfu_SMR_libraryID;
0023 
0024 #ifdef __APPLE__
0025 #ifndef NFU_USEHEAP
0026 #define NFU_USEHEAP 1
0027 #endif
0028 #endif
0029 
0030 #define nf_floatToShortestString_trimZeros   ( 1 << 0 )
0031 #define nf_floatToShortestString_keepPeriod  ( 1 << 1 )
0032 #define nf_floatToShortestString_includeSign ( 1 << 2 )
0033 
0034 #if defined __cplusplus
0035     extern "C" {
0036 #endif
0037 
0038 typedef enum nfu_status_e {         
0039     nfu_Okay,               
0040     nfu_Error,               
0041     nfu_badSelf,            
0042     nfu_mallocError,            
0043     nfu_insufficientMemory,     
0044     nfu_badIndex,                   
0045     nfu_XNotAscending,      
0046     nfu_badIndexForX,           
0047     nfu_XOutsideDomain,             
0048     nfu_invalidInterpolation,       
0049     nfu_divByZero,              
0050     nfu_unsupportedInterpolationConversion, 
0051     nfu_unsupportedInterpolation,   
0052     nfu_empty,              
0053     nfu_tooFewPoints,           
0054     nfu_domainsNotMutual,                   
0055     nfu_badInput,                   
0056     nfu_badNorm,            
0057     nfu_badIntegrationInput,    
0058     nfu_otherInterpolation,
0059     nfu_flatInterpolation,
0060     nfu_failedToConverge,           
0061     nfu_oddNumberOfValues,  
0062     nfu_badLogValue 
0063 } nfu_status;
0064 
0065 /*
0066 * Functions in nf_utilities.c
0067 */
0068 int nfu_setup( void );
0069 double nfu_getNAN( void );
0070 int nfu_isNAN( double d );
0071 double nfu_getInfinity( double sign );
0072 const char *nfu_statusMessage( nfu_status status );
0073 void nfu_setMemoryDebugMode( int mode );
0074 void nfu_printMsg( char const *fmt, ... );
0075 void nfu_printErrorMsg( char const *fmt, ... );
0076 
0077 /*
0078 * These function are to be deleted when conversion to statusMessageReporting is completed.
0079 */
0080 void *nfu_malloc( size_t size );
0081 void *nfu_calloc( size_t size, size_t n );
0082 void *nfu_realloc( size_t size, void *old );
0083 void *nfu_free( void *p );
0084 /*
0085 * Functions in nf_stringToInt32s.c
0086 */
0087 int32_t *nfu_stringToListOfInt32s( statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter );
0088 int nfu_stringToInt32( statusMessageReporting *smr, char const *str, char **endCharacter, int32_t *value );
0089 /*
0090 * Functions in nf_stringToDoubles.c
0091 */
0092 double *nfu_stringToListOfDoubles( statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, 
0093         char **endCharacter, int useSystem_strtod );
0094 double nf_strtod( char const *ptr, char **endCharacter );
0095 char *nf_floatToShortestString( double value, int significantDigits, int favorEFormBy, int flags );
0096 
0097 #if defined __cplusplus
0098     }
0099 #endif
0100 
0101 #endif          /* End of nf_utilities_h_included. */