plotting/plotit.c, xtend(), #7/7 reorder
This commit is contained in:
parent
64d6a5d7c0
commit
5a678e38dc
|
|
@ -94,10 +94,12 @@ xtend(struct dvec *v, int length)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = v->v_length;
|
||||||
|
|
||||||
if (isreal(v)) {
|
if (isreal(v)) {
|
||||||
double d = NAN;
|
double d = NAN;
|
||||||
v->v_realdata = TREALLOC(double, v->v_realdata, length);
|
v->v_realdata = TREALLOC(double, v->v_realdata, length);
|
||||||
i = v->v_length;
|
v->v_length = length;
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
d = v->v_realdata[i - 1];
|
d = v->v_realdata[i - 1];
|
||||||
while (i < length)
|
while (i < length)
|
||||||
|
|
@ -105,14 +107,12 @@ xtend(struct dvec *v, int length)
|
||||||
} else {
|
} else {
|
||||||
ngcomplex_t c = {NAN, NAN};
|
ngcomplex_t c = {NAN, NAN};
|
||||||
v->v_compdata = TREALLOC(ngcomplex_t, v->v_compdata, length);
|
v->v_compdata = TREALLOC(ngcomplex_t, v->v_compdata, length);
|
||||||
i = v->v_length;
|
v->v_length = length;
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
c = v->v_compdata[i - 1];
|
c = v->v_compdata[i - 1];
|
||||||
while (i < length)
|
while (i < length)
|
||||||
v->v_compdata[i++] = c;
|
v->v_compdata[i++] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
v->v_length = length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue