70 data = (nr_double_t *) malloc (
sizeof (nr_double_t) * size);
72 memcpy (
data, s.data, sizeof (nr_double_t) * size);
74 memset (
data, 0,
sizeof (nr_double_t) * size);
79 assert (idx >= 0 && idx < size &&
data != NULL);
85 assert (idx >= 0 && idx < size &&
data != NULL);
95 data = (nr_double_t *) realloc (
data,
sizeof (nr_double_t) * points);
97 memset (&
data[size], 0,
sizeof (nr_double_t) * (points - size));
100 data = (nr_double_t *) malloc (
sizeof (nr_double_t) * points);
101 memset (
data, 0,
sizeof (nr_double_t) * points);
110 if (
data == NULL || size == 0)
return (
char *)
"";
111 int len = 3 + size - 1;
112 txt = (
char *) malloc (len);
114 for (
int i = 0;
i < size;
i++) {
115 static char str[256];
116 sprintf (str,
"%g", (
double)
get (
i));
117 txt = (
char *) realloc (txt, len += strlen (str));
119 if (
i != size - 1) strcat (txt,
";");
128 if (
data != NULL && size > 0) {
129 nr_double_t * buf = (nr_double_t *) malloc (
sizeof (nr_double_t) * size);
130 for (
int i = 0;
i < size;
i++) buf[
i] =
data[size - 1 -
i];
139 nr_double_t res =
data[counter];
140 if (++counter >= size) counter = 0;
150 if (--counter < 0) counter = size - 1;
151 return data[counter];
170 for (
int i = 0;
i < points;
i++)
set (
i,
real (v.
get (
i)));
193 for (
int i = 0;
i < points;
i++)
set (
i,
real (v.
get (
i)));