Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:32

0001 /*
0002 # <<BEGIN-copyright>>
0003 # <<END-copyright>>
0004 */
0005 
0006 #ifndef ptwX_h_included
0007 #define ptwX_h_included
0008 
0009 #include <stdio.h>
0010 #include <stdint.h>
0011 
0012 #include <nf_utilities.h>
0013 
0014 #if defined __cplusplus
0015     extern "C" {
0016     namespace GIDI {
0017 #endif
0018 
0019 #define ptwX_minimumSize 10
0020 
0021 enum ptwX_sort_order { ptwX_sort_order_descending, ptwX_sort_order_ascending };
0022 
0023 typedef
0024     struct ptwXPoints_s {
0025         nfu_status status;
0026         int64_t length;
0027         int64_t allocatedSize;
0028         int64_t mallocFailedSize;
0029         double *points;
0030     } ptwXPoints;
0031 
0032 /*
0033 * Routines in ptwX_core.c
0034 */
0035 ptwXPoints *ptwX_new( int64_t size, nfu_status *status );
0036 nfu_status ptwX_setup( ptwXPoints *ptwX, int64_t size );
0037 ptwXPoints *ptwX_create( int64_t size, int64_t length, double const *xs, nfu_status *status );
0038 ptwXPoints *ptwX_createLine( int64_t size, int64_t length, double slope, double offset, nfu_status *status );
0039 nfu_status ptwX_copy( ptwXPoints *dest, ptwXPoints *src );
0040 ptwXPoints *ptwX_clone( ptwXPoints *ptwX, nfu_status *status );
0041 ptwXPoints *ptwX_slice( ptwXPoints *ptwX, int64_t index1, int64_t index2, nfu_status *status );
0042 nfu_status ptwX_reallocatePoints( ptwXPoints *ptwX, int64_t size, int forceSmallerResize );
0043 nfu_status ptwX_clear( ptwXPoints *ptwX );
0044 nfu_status ptwX_release( ptwXPoints *ptwX );
0045 ptwXPoints *ptwX_free( ptwXPoints *ptwX );
0046 
0047 int64_t ptwX_length( ptwXPoints *ptwX );
0048 nfu_status ptwX_setData( ptwXPoints *ptwX, int64_t length, double const *xs );
0049 nfu_status ptwX_deletePoints( ptwXPoints *ptwX, int64_t i1, int64_t i2 );
0050 double *ptwX_getPointAtIndex( ptwXPoints *ptwX, int64_t index );
0051 double ptwX_getPointAtIndex_Unsafely( ptwXPoints *ptwX, int64_t index );
0052 nfu_status ptwX_setPointAtIndex( ptwXPoints *ptwX, int64_t index, double x );
0053 nfu_status ptwX_insertPointsAtIndex( ptwXPoints *ptwX, int64_t index, int64_t n1, double const *xs );
0054 int ptwX_ascendingOrder( ptwXPoints *ptwX );
0055 ptwXPoints *ptwX_fromString( char const *str, char **endCharacter, nfu_status *status );
0056 nfu_status ptwX_countOccurrences( ptwXPoints *ptwX, double value, int *count );
0057 nfu_status ptwX_reverse( ptwXPoints *ptwX );
0058 nfu_status ptwX_sort( ptwXPoints *ptwX, enum ptwX_sort_order order );
0059 nfu_status ptwX_closesDifference( ptwXPoints *ptwX, double value, int64_t *index, double *difference );
0060 nfu_status ptwX_closesDifferenceInRange( ptwXPoints *ptwX, int64_t i1, int64_t i2, double value, int64_t *index, double *difference );
0061 ptwXPoints *ptwX_unique( ptwXPoints *ptwX, int order, nfu_status *status );
0062 
0063 nfu_status ptwX_abs( ptwXPoints *ptwX );
0064 nfu_status ptwX_neg( ptwXPoints *ptwX );
0065 nfu_status ptwX_add_double( ptwXPoints *ptwX, double value );
0066 nfu_status ptwX_mul_double( ptwXPoints *ptwX, double value );
0067 nfu_status ptwX_slopeOffset( ptwXPoints *ptwX, double slope, double offset );
0068 nfu_status ptwX_add_ptwX( ptwXPoints *ptwX1, ptwXPoints *ptwX2 );
0069 nfu_status ptwX_sub_ptwX( ptwXPoints *ptwX1, ptwXPoints *ptwX2 );
0070 
0071 nfu_status ptwX_xMinMax( ptwXPoints *ptwX, double *xMin, double *xMax );
0072 
0073 nfu_status ptwX_compare( ptwXPoints *ptwX1, ptwXPoints *ptwX2, int *comparison );
0074 int ptwX_close( ptwXPoints *ptwX1, ptwXPoints *ptwX2, int epsilonFactor, double epsilon, nfu_status *status );
0075 
0076 /*
0077 * Routines in ptwX_misc.c
0078 */
0079 void ptwX_simpleWrite( ptwXPoints const *ptwX, FILE *f, char const *format );
0080 void ptwX_simplePrint( ptwXPoints const *ptwX, char const *format );
0081 
0082 #if defined __cplusplus
0083     }
0084     }
0085 #endif
0086 
0087 #endif          /* End of ptwX_h_included. */