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