41#if defined __cplusplus
89 double *p, *values, *d = (
double *) xDT->
data;
92 if( xDT->
length == 0 )
return( NULL );
93 if( *n == 0 )
return( NULL );
95 if(( values = (
double*)
xData_malloc2( NULL, *n *
sizeof(
double ), 0,
"values" ) )) {
97 for( i = 0; i < *n; i++, p++, d++ ) *p = *d;
123 if( ( xDT->
data =
xData_malloc2( smr, n *
sizeof(
double ), 0,
"data" ) ) == NULL )
return( 1 );
124 for( i = 0, s = text, p = (
double *) xDT->
data; i < n; i++, p++, s = e ) {
128 while( isspace( *e ) ) e++;
130 smr_setMessageError( smr, smrUser, __FILE__, __LINE__, 1,
"text contains extra data = %s", e );
134 if( status != 0 ) release( smr, xDT );
144 char *str, *p, fmt[32] =
" %15.7e\n";
146 double *d = (
double*) xDT->
data;
149 if( ( str = (
char *) malloc( recordSize * ( n + 1 ) ) ) == NULL )
return( NULL );
150 for( i = 0, p = str; i <
n; i++, p += recordSize, d++ ) sprintf( p, fmt, d ); *p = 0;
170 double *p, *values, *d = (
double*) xDT->
data;
172 if( xDT->
length == 0 )
return( NULL );
173 if( ( xDT->
length + 1 ) != nXs )
return( NULL );
175 if( ( values = (
double*)
xData_malloc2( NULL, 4 * xDT->
length *
sizeof(
double ), 0,
"values" ) ) == NULL )
return( NULL );
177 for( i = 0; i < xDT->
length; i++ ) {
183 p = &(values[4 * xDT->
start + 1]);
184 for( i = xDT->
start; i < xDT->end; i++, d++, p += 2 ) {
192#if defined __cplusplus
int smr_setMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
enum xData_xDataType status
xDT_releaseFunction release
xDT_toStringFunction toString
xDT_toDataFunction toData
void * xData_free(statusMessageReporting *smr, void *p)
int xData_stringTo_double(statusMessageReporting *smr, void *smrUserInterface, char const *c, double *value, char const *endings, char **e)
void * xData_get_smrUserInterfaceFromElement(xData_element *element)
int xData_init_2d_xShared_yHistogram(statusMessageReporting *smr, xData_element *element)
int xData_is_xDataType(statusMessageReporting *smr, xDataType *xDT, char const *const type, int setMsg)
int xData_isElement_2d_xShared_yHistogram(statusMessageReporting *smr, xData_element *element, int setMsg)
int xData_is_2d_xShared_yHistogram(statusMessageReporting *smr, xDataType *xDT, int setMsg)
double * xData_2d_xShared_yHistogram_toFilledXYs(xDataType *xDT, xData_Int nXs, double *Xs)
int xData_xDataTypeConvertAttributes(statusMessageReporting *smr, xData_element *element)
double * xData_2d_xShared_yHistogram_copyData(statusMessageReporting *smr, xData_element *element, xData_Int *n)
int xData_setMessageError_ReturnInt(int value, statusMessageReporting *smr, void *userData, const char *file, int line, int code, const char *fmt,...)
char const *const xData_twod_xShared_yHistogram_ID
int xData_2d_xShared_yHistogram_free_copyData(statusMessageReporting *smr, void *data)
#define xData_malloc2(smr, size, zero, forItem)