Browse Source

plotting/plotit.c, xtend(), #3/7 complex assignment

pre-master-46
rlar 10 years ago
parent
commit
7c6fc1343b
  1. 12
      src/frontend/plotting/plotit.c

12
src/frontend/plotting/plotit.c

@ -109,16 +109,12 @@ xtend(struct dvec *v, int length)
oc = v->v_compdata;
v->v_compdata = TMALLOC(ngcomplex_t, length);
for (i = 0; i < v->v_length; i++) {
realpart(v->v_compdata[i]) = realpart(oc[i]);
imagpart(v->v_compdata[i]) = imagpart(oc[i]);
v->v_compdata[i] = oc[i];
}
realpart(c) = realpart(oc[i - 1]);
imagpart(c) = imagpart(oc[i - 1]);
c = oc[i - 1];
tfree(oc);
while (i < length) {
realpart(v->v_compdata[i]) = realpart(c);
imagpart(v->v_compdata[i++]) = imagpart(c);
}
while (i < length)
v->v_compdata[i++] = c;
}
v->v_length = length;

Loading…
Cancel
Save