|
|
@ -60,9 +60,12 @@ com_meas(wordlist *wl) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
wl_count = wl; |
|
|
wl_count = wl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* check each wl entry, if it contain '=' and if the following token is |
|
|
/* check each wl entry, if it contain '=' and if the following token is |
|
|
a vector. If yes, replace this vector by its value */ |
|
|
|
|
|
|
|
|
a single valued vector. If yes, replace this vector by its value. |
|
|
|
|
|
Vectors may stem from other meas commands, or be generated elsewhere |
|
|
|
|
|
within the .control .endc script. All other right hand side vectors are |
|
|
|
|
|
treated in com_measure2.c. */ |
|
|
wl_index = wl; |
|
|
wl_index = wl; |
|
|
|
|
|
|
|
|
while ( wl_index) { |
|
|
while ( wl_index) { |
|
|
@ -79,7 +82,9 @@ com_meas(wordlist *wl) { |
|
|
if (err) { |
|
|
if (err) { |
|
|
/* check if vec_found is a valid vector */ |
|
|
/* check if vec_found is a valid vector */ |
|
|
d = vec_get(vec_found); |
|
|
d = vec_get(vec_found); |
|
|
if (d) { |
|
|
|
|
|
|
|
|
/* Only if we have a single valued vector, replacing |
|
|
|
|
|
of the rigt hand side does make sense */ |
|
|
|
|
|
if (d && (d->v_length == 1) && (d->v_numdims == 1)) { |
|
|
/* get its value */ |
|
|
/* get its value */ |
|
|
sprintf(newval, "%e", d->v_realdata[0]); |
|
|
sprintf(newval, "%e", d->v_realdata[0]); |
|
|
tfree(vec_found); |
|
|
tfree(vec_found); |
|
|
@ -95,7 +100,9 @@ com_meas(wordlist *wl) { |
|
|
INPevaluate( &vec_found, &err, 1 ); |
|
|
INPevaluate( &vec_found, &err, 1 ); |
|
|
if (err) { |
|
|
if (err) { |
|
|
d = vec_get(vec_found); |
|
|
d = vec_get(vec_found); |
|
|
if (d) { |
|
|
|
|
|
|
|
|
/* Only if we have a single valued vector, replacing |
|
|
|
|
|
of the rigt hand side does make sense */ |
|
|
|
|
|
if (d && (d->v_length == 1) && (d->v_numdims == 1)) { |
|
|
*equal_ptr = '\0'; |
|
|
*equal_ptr = '\0'; |
|
|
sprintf(newval, "%s=%e", token, d->v_realdata[0]); |
|
|
sprintf(newval, "%s=%e", token, d->v_realdata[0]); |
|
|
// memory leak with first part of vec_found ? |
|
|
// memory leak with first part of vec_found ? |
|
|
|