Eliminates use of temporary linked lists to process Patterns & Curves (issue #449)

This commit is contained in:
Lew Rossman
2019-04-05 13:02:39 -04:00
parent 1632508545
commit edcd4b69c7
7 changed files with 295 additions and 449 deletions

View File

@@ -317,23 +317,6 @@ struct IDstring // Holds component ID label
char ID[MAXID+1];
};
struct Floatlist // Element of List of Numbers
{
double value; // element's numerical value
struct Floatlist *next; // next element on the list
};
typedef struct Floatlist SFloatlist;
struct Tmplist // Item of Temporary List of Objects
{
int i; // object's index
char ID[MAXID+1]; // object's ID name
SFloatlist *x; // list of data values
SFloatlist *y; // list of data values
struct Tmplist *next; // next object on list
};
typedef struct Tmplist STmplist; // Pointer to temporary list of objects
typedef struct // Time Pattern Object
{
char ID[MAXID+1]; // pattern ID
@@ -348,6 +331,7 @@ typedef struct // Curve Object
char *Comment; // curve comment
CurveType Type; // curve type
int Npts; // number of points
int Capacity; // size of X & Y arrays
double *X; // x-values
double *Y; // y-values
} Scurve;
@@ -576,12 +560,8 @@ typedef struct {
Pressflag, // Pressure units flag
DefPat; // Default demand pattern
STmplist
*Patlist, // Temporary time pattern list
*PrevPat, // Previous pattern list element
*Curvelist, // Temporary list of curves
*PrevCurve; // Previous curve list element
Spattern *PrevPat; // Previous pattern processed
Scurve *PrevCurve; // Previous curve processed
double *X; // Temporary array for curve data
} Parser;