10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Eldo Control Language<br />

Statement Overview<br />

To explicitly free (almost) the entirety of the memory used by a vector that is no longer needed,<br />

in the case that it is needed to do so before the task or function terminates, use:<br />

free (b)<br />

The free command frees the entire vector, whatever the number of dimensions.<br />

Vector Attributes<br />

A set of useful attributes is available on vectors:<br />

• imin to get the minimum index of the vector<br />

• imax to get the maximum index of the vector<br />

• size to get the size of the vector<br />

Example:<br />

set a[0,10] = 1<br />

fprint(stdout, "a.imin = %d\n", a.imin)<br />

fprint(stdout, "a.imax = %d\n", a.imax)<br />

fprint(stdout, "a.size = %d\n", a.size)<br />

Passing Vectors as Task Arguments<br />

Example using a vector as an input argument:<br />

.define_task my_vector_average (a[]=0, @avg=0)<br />

set tmp=0 i=0<br />

step (type=linear, param=i, start=a.imin, stop=a.imax, step=1)<br />

tmp = tmp + a[i]<br />

endstep<br />

avg = tmp / a.size<br />

.end_define_task<br />

The corresponding call from another task would be:<br />

set tprop[0,99]=0 tprop_avg=0<br />

my_vector_average (a=tprop, tprop_avg=@avg)<br />

Example using a vector as an output argument:<br />

830<br />

Eldo® User's Manual, 15.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!