ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ptwX_core.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <cstdlib>
#include <float.h>
#include "ptwX.h"
+ Include dependency graph for ptwX_core.cc:

Go to the source code of this file.

Functions

static int ptwX_sort_descending (void const *p1, void const *p2)
 
static int ptwX_sort_ascending (void const *p1, void const *p2)
 
ptwXPointsptwX_new (int64_t size, nfu_status *status)
 
nfu_status ptwX_setup (ptwXPoints *ptwX, int64_t size)
 
ptwXPointsptwX_create (int64_t size, int64_t length, double const *xs, nfu_status *status)
 
ptwXPointsptwX_createLine (int64_t size, int64_t length, double slope, double offset, nfu_status *status)
 
nfu_status ptwX_copy (ptwXPoints *dest, ptwXPoints *src)
 
ptwXPointsptwX_clone (ptwXPoints *ptwX, nfu_status *status)
 
ptwXPointsptwX_slice (ptwXPoints *ptwX, int64_t index1, int64_t index2, nfu_status *status)
 
nfu_status ptwX_reallocatePoints (ptwXPoints *ptwX, int64_t size, int forceSmallerResize)
 
nfu_status ptwX_clear (ptwXPoints *ptwX)
 
nfu_status ptwX_release (ptwXPoints *ptwX)
 
ptwXPointsptwX_free (ptwXPoints *ptwX)
 
int64_t ptwX_length (ptwXPoints *ptwX)
 
nfu_status ptwX_setData (ptwXPoints *ptwX, int64_t length, double const *xs)
 
nfu_status ptwX_deletePoints (ptwXPoints *ptwX, int64_t i1, int64_t i2)
 
double * ptwX_getPointAtIndex (ptwXPoints *ptwX, int64_t index)
 
double ptwX_getPointAtIndex_Unsafely (ptwXPoints *ptwX, int64_t index)
 
nfu_status ptwX_setPointAtIndex (ptwXPoints *ptwX, int64_t index, double x)
 
nfu_status ptwX_insertPointsAtIndex (ptwXPoints *ptwX, int64_t index, int64_t n1, double const *xs)
 
int ptwX_ascendingOrder (ptwXPoints *ptwX)
 
ptwXPointsptwX_fromString (char const *str, char **endCharacter, nfu_status *status)
 
nfu_status ptwX_countOccurrences (ptwXPoints *ptwX, double value, int *count)
 
nfu_status ptwX_reverse (ptwXPoints *ptwX)
 
nfu_status ptwX_sort (ptwXPoints *ptwX, enum ptwX_sort_order order)
 
nfu_status ptwX_closesDifference (ptwXPoints *ptwX, double value, int64_t *index, double *difference)
 
nfu_status ptwX_closesDifferenceInRange (ptwXPoints *ptwX, int64_t i1, int64_t i2, double value, int64_t *index, double *difference)
 
ptwXPointsptwX_unique (ptwXPoints *ptwX, int order, nfu_status *status)
 
nfu_status ptwX_abs (ptwXPoints *ptwX)
 
nfu_status ptwX_neg (ptwXPoints *ptwX)
 
nfu_status ptwX_add_double (ptwXPoints *ptwX, double value)
 
nfu_status ptwX_mul_double (ptwXPoints *ptwX, double value)
 
nfu_status ptwX_slopeOffset (ptwXPoints *ptwX, double slope, double offset)
 
nfu_status ptwX_add_ptwX (ptwXPoints *ptwX1, ptwXPoints *ptwX2)
 
nfu_status ptwX_sub_ptwX (ptwXPoints *ptwX1, ptwXPoints *ptwX2)
 
nfu_status ptwX_xMinMax (ptwXPoints *ptwX, double *xMin, double *xMax)
 
nfu_status ptwX_compare (ptwXPoints *ptwX1, ptwXPoints *ptwX2, int *comparison)
 
int ptwX_close (ptwXPoints *ptwX1, ptwXPoints *ptwX2, int epsilonFactor, double epsilon, nfu_status *status)
 

Function Documentation

nfu_status ptwX_abs ( ptwXPoints ptwX)

Definition at line 434 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 434 of file ptwX_core.cc

References BTOF::length, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

nfu_status ptwX_add_double ( ptwXPoints ptwX,
double  value 
)

Definition at line 453 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 453 of file ptwX_core.cc

References ptwX_slopeOffset().

+ Here is the call graph for this function:

nfu_status ptwX_add_ptwX ( ptwXPoints ptwX1,
ptwXPoints ptwX2 
)

Definition at line 479 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 479 of file ptwX_core.cc

References ptwXPoints_s::length, nfu_domainsNotMutual, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

Referenced by MCGIDI_reaction_recast().

+ Here is the caller graph for this function:

int ptwX_ascendingOrder ( ptwXPoints ptwX)

Definition at line 257 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 257 of file ptwX_core.cc

References ptwXPoints_s::length, ptwXPoints_s::points, x1, and x2.

nfu_status ptwX_clear ( ptwXPoints ptwX)

Definition at line 139 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 139 of file ptwX_core.cc

References ptwXPoints_s::length, and ptwXPoints_s::status.

Referenced by ptwX_copy().

+ Here is the caller graph for this function:

ptwXPoints* ptwX_clone ( ptwXPoints ptwX,
nfu_status status 
)

Definition at line 88 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 88 of file ptwX_core.cc

References ptwXPoints_s::length, and ptwX_slice().

Referenced by GIDI_settings_processedFlux::GIDI_settings_processedFlux(), MCGIDI_target_heated_recast(), GIDI_settings_processedFlux::operator=(), and ptwX_unique().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ptwX_close ( ptwXPoints ptwX1,
ptwXPoints ptwX2,
int  epsilonFactor,
double  epsilon,
nfu_status status 
)

Definition at line 553 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 553 of file ptwX_core.cc

References kdfinder::abs(), DBL_EPSILON, ptwXPoints_s::length, n1, nfu_domainsNotMutual, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

+ Here is the call graph for this function:

nfu_status ptwX_closesDifference ( ptwXPoints ptwX,
double  value,
int64_t *  index,
double *  difference 
)

Definition at line 352 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 352 of file ptwX_core.cc

References ptwXPoints_s::length, and ptwX_closesDifferenceInRange().

+ Here is the call graph for this function:

nfu_status ptwX_closesDifferenceInRange ( ptwXPoints ptwX,
int64_t  i1,
int64_t  i2,
double  value,
int64_t *  index,
double *  difference 
)

Definition at line 359 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 359 of file ptwX_core.cc

References d1, ptwXPoints_s::length, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

Referenced by ptwX_closesDifference().

+ Here is the caller graph for this function:

nfu_status ptwX_compare ( ptwXPoints ptwX1,
ptwXPoints ptwX2,
int comparison 
)

Definition at line 528 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 528 of file ptwX_core.cc

References ptwXPoints_s::length, n1, nfu_Okay, G4InuclParticleNames::nn, ptwXPoints_s::points, and ptwXPoints_s::status.

nfu_status ptwX_copy ( ptwXPoints dest,
ptwXPoints src 
)

Definition at line 78 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 78 of file ptwX_core.cc

References ptwXPoints_s::length, nfu_Okay, ptwXPoints_s::points, ptwX_clear(), ptwX_setData(), and ptwXPoints_s::status.

+ Here is the call graph for this function:

nfu_status ptwX_countOccurrences ( ptwXPoints ptwX,
double  value,
int count 
)

Definition at line 301 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 301 of file ptwX_core.cc

References ptwXPoints_s::length, nfu_Okay, and ptwXPoints_s::points.

ptwXPoints* ptwX_create ( int64_t  size,
int64_t  length,
double const *  xs,
nfu_status status 
)

Definition at line 50 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 50 of file ptwX_core.cc

References nfu_Okay, ptwX_free(), ptwX_new(), and ptwX_setData().

Referenced by ptwX_fromString(), and GIDI_settings_particle::setGroup().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ptwXPoints* ptwX_createLine ( int64_t  size,
int64_t  length,
double  slope,
double  offset,
nfu_status status 
)

Definition at line 62 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 62 of file ptwX_core.cc

References ptwXPoints_s::length, BTOF::length, offset, ptwXPoints_s::points, and ptwX_new().

Referenced by MCGIDI_target_heated_recast(), ptwXY_groupOneFunction(), ptwXY_groupThreeFunctions(), and ptwXY_groupTwoFunctions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_deletePoints ( ptwXPoints ptwX,
int64_t  i1,
int64_t  i2 
)

Definition at line 191 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 191 of file ptwX_core.cc

References ptwXPoints_s::length, n, nfu_badIndex, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

ptwXPoints* ptwX_free ( ptwXPoints ptwX)

Definition at line 158 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 158 of file ptwX_core.cc

References nfu_free(), and ptwX_release().

Referenced by GIDI_settings_processedFlux::GIDI_settings_processedFlux(), MCGIDI_angular_parseFromTOM(), MCGIDI_energy_parseMadlandNixFromTOM(), MCGIDI_fromTOM_pdfOfX(), MCGIDI_KalbachMann_parseFromTOM2(), MCGIDI_reaction_recast(), MCGIDI_reaction_release(), MCGIDI_target_heated_recast(), MCGIDI_target_heated_release(), GIDI_settings_processedFlux::operator=(), ptwX_create(), ptwX_unique(), ptwXY_groupOneFunction(), ptwXY_groupThreeFunctions(), ptwXY_groupTwoFunctions(), ptwXY_runningIntegral(), GIDI_settings_particle::setGroup(), GIDI_settings_particle::~GIDI_settings_particle(), and GIDI_settings_processedFlux::~GIDI_settings_processedFlux().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ptwXPoints* ptwX_fromString ( char const *  str,
char **  endCharacter,
nfu_status status 
)

Definition at line 287 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 287 of file ptwX_core.cc

References nfu_free(), nfu_Okay, nfu_stringToListOfDoubles(), and ptwX_create().

+ Here is the call graph for this function:

double* ptwX_getPointAtIndex ( ptwXPoints ptwX,
int64_t  index 
)

Definition at line 206 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 206 of file ptwX_core.cc

References ptwXPoints_s::length, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

Referenced by MCGIDI_reaction_getCrossSectionAtE(), MCGIDI_reaction_recast(), and MCGIDI_target_heated_getTotalCrossSectionAtE().

+ Here is the caller graph for this function:

double ptwX_getPointAtIndex_Unsafely ( ptwXPoints ptwX,
int64_t  index 
)

Definition at line 215 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 215 of file ptwX_core.cc

References ptwXPoints_s::points.

Referenced by MCGIDI_angular_parseFromTOM(), MCGIDI_energy_parseMadlandNixFromTOM(), MCGIDI_fromTOM_pdfOfX(), MCGIDI_KalbachMann_parseFromTOM2(), and MCGIDI_target_heated_recast().

+ Here is the caller graph for this function:

nfu_status ptwX_insertPointsAtIndex ( ptwXPoints ptwX,
int64_t  index,
int64_t  n1,
double const *  xs 
)

Definition at line 238 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 238 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, n1, nfu_badIndex, nfu_Okay, ptwXPoints_s::points, ptwX_reallocatePoints(), and ptwXPoints_s::status.

+ Here is the call graph for this function:

int64_t ptwX_length ( ptwXPoints ptwX)

Definition at line 166 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 166 of file ptwX_core.cc

References ptwXPoints_s::length.

Referenced by MCGIDI_target_heated_getTotalCrossSectionAtE(), ptwXY_groupOneFunction(), ptwXY_groupThreeFunctions(), ptwXY_groupTwoFunctions(), and ptwXY_intersectionWith_ptwX().

+ Here is the caller graph for this function:

nfu_status ptwX_mul_double ( ptwXPoints ptwX,
double  value 
)

Definition at line 460 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 460 of file ptwX_core.cc

References ptwX_slopeOffset().

+ Here is the call graph for this function:

nfu_status ptwX_neg ( ptwXPoints ptwX)

Definition at line 446 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 446 of file ptwX_core.cc

References ptwX_slopeOffset().

+ Here is the call graph for this function:

ptwXPoints* ptwX_new ( int64_t  size,
nfu_status status 
)

Definition at line 24 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 24 of file ptwX_core.cc

References nfu_calloc(), nfu_free(), nfu_mallocError, nfu_Okay, ptwX_setup(), and ptwXPoints_s::status.

Referenced by ptwX_create(), ptwX_createLine(), ptwX_slice(), ptwX_unique(), ptwXY_getXArray(), ptwXY_groupOneFunction(), ptwXY_groupThreeFunctions(), ptwXY_groupTwoFunctions(), and ptwXY_runningIntegral().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_reallocatePoints ( ptwXPoints ptwX,
int64_t  size,
int  forceSmallerResize 
)

Definition at line 116 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 116 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, BTOF::length, ptwXPoints_s::mallocFailedSize, nfu_mallocError, nfu_realloc(), ptwXPoints_s::points, ptwX_minimumSize, and ptwXPoints_s::status.

Referenced by ptwX_insertPointsAtIndex(), ptwX_setData(), ptwX_setPointAtIndex(), and ptwX_setup().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_release ( ptwXPoints ptwX)

Definition at line 147 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 147 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, nfu_free(), nfu_Okay, and ptwXPoints_s::points.

Referenced by ptwX_free().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_reverse ( ptwXPoints ptwX)

Definition at line 314 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 314 of file ptwX_core.cc

References ptwXPoints_s::length, n1, nfu_Okay, ptwXPoints_s::points, and tmp.

nfu_status ptwX_setData ( ptwXPoints ptwX,
int64_t  length,
double const *  xs 
)

Definition at line 173 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 173 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, BTOF::length, nfu_Okay, ptwXPoints_s::points, ptwX_reallocatePoints(), and ptwXPoints_s::status.

Referenced by ptwX_copy(), and ptwX_create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_setPointAtIndex ( ptwXPoints ptwX,
int64_t  index,
double  x 
)

Definition at line 222 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 222 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, nfu_badIndex, nfu_Okay, ptwXPoints_s::points, ptwX_reallocatePoints(), ptwXPoints_s::status, and x.

Referenced by MCGIDI_target_heated_recast(), and ptwXY_runningIntegral().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_setup ( ptwXPoints ptwX,
int64_t  size 
)

Definition at line 37 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 37 of file ptwX_core.cc

References ptwXPoints_s::allocatedSize, ptwXPoints_s::length, ptwXPoints_s::mallocFailedSize, nfu_Okay, ptwXPoints_s::points, ptwX_reallocatePoints(), and ptwXPoints_s::status.

Referenced by ptwX_new().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ptwXPoints* ptwX_slice ( ptwXPoints ptwX,
int64_t  index1,
int64_t  index2,
nfu_status status 
)

Definition at line 95 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 95 of file ptwX_core.cc

References Acts::index1, Acts::index2, ptwXPoints_s::length, BTOF::length, n, nfu_badIndex, nfu_badSelf, nfu_Okay, ptwXPoints_s::points, ptwX_new(), and ptwXPoints_s::status.

Referenced by ptwX_clone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_slopeOffset ( ptwXPoints ptwX,
double  slope,
double  offset 
)

Definition at line 467 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 467 of file ptwX_core.cc

References BTOF::length, nfu_Okay, offset, ptwXPoints_s::points, and ptwXPoints_s::status.

Referenced by ptwX_add_double(), ptwX_mul_double(), and ptwX_neg().

+ Here is the caller graph for this function:

nfu_status ptwX_sort ( ptwXPoints ptwX,
enum ptwX_sort_order  order 
)

Definition at line 329 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 329 of file ptwX_core.cc

References int(), ptwXPoints_s::length, nfu_Okay, ptwXPoints_s::points, ptwX_sort_ascending(), ptwX_sort_descending(), and ptwX_sort_order_ascending.

Referenced by ptwX_unique().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ptwX_sort_ascending ( void const *  p1,
void const *  p2 
)
static

Definition at line 341 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 341 of file ptwX_core.cc

References d1, and d2.

Referenced by ptwX_sort(), and ptwX_sort_descending().

+ Here is the caller graph for this function:

static int ptwX_sort_descending ( void const *  p1,
void const *  p2 
)
static

Definition at line 340 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 340 of file ptwX_core.cc

References ptwX_sort_ascending().

Referenced by ptwX_sort().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nfu_status ptwX_sub_ptwX ( ptwXPoints ptwX1,
ptwXPoints ptwX2 
)

Definition at line 494 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 494 of file ptwX_core.cc

References ptwXPoints_s::length, nfu_domainsNotMutual, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.

ptwXPoints* ptwX_unique ( ptwXPoints ptwX,
int  order,
nfu_status status 
)

Definition at line 385 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 385 of file ptwX_core.cc

References check_license::err(), ptwXPoints_s::length, BTOF::length, n1, nfu_Okay, ptwXPoints_s::points, ptwX_clone(), ptwX_free(), ptwX_new(), ptwX_sort(), ptwX_sort_order_ascending, ptwX_sort_order_descending, and x1.

+ Here is the call graph for this function:

nfu_status ptwX_xMinMax ( ptwXPoints ptwX,
double *  xMin,
double *  xMax 
)

Definition at line 509 of file ptwX_core.cc.

View newest version in sPHENIX GitHub at line 509 of file ptwX_core.cc

References ptwXPoints_s::length, n1, nfu_Okay, ptwXPoints_s::points, and ptwXPoints_s::status.