functions The following are real functions:
Example of ID01 Equation E_p3_s (all,c,COM) ID01(Sum{s,SRC, V3PUR(c,s)})*p3_s(c) = Sum{s,SRC, V3PUR(c,s)*p3(c,s)}; The ID01 ensures a non-zero coefficient on p3_s in all cases. These three functions turn real numbers into integers (can be used for mappings): ROUND(x) is the nearest integer to the real number x. ROUND(3.1)=3, ROUND(3.6)=4, ROUND(-3.1)=-3, ROUND(-3.6)=-4. TRUNC0(x) truncates the real number x to the nearest integer towards 0. TRUNC0(3.1)=3, TRUNC0(3.0)=3, TRUNC0(3.6)=3, TRUNC0(-3.1)=-3, TRUNC0(-3.6)=-3. TRUNCB(x) truncates the real number x to the nearest integer which is below x. TRUNCB(3.1)=3, TRUNCB(3.0)=3, TRUNCB(3.6)=3, TRUNCB(-3.1)=-4, TRUNCB(-3.6)=-4. MINS and MAXS functions find minimum or maximum of a vector: (all,r,REG)(all,d,REG) DISTANCE2(r,d) = MINS[q,REG,DISTANCE(r,q)+DISTANCE(q,d)]; (all,r,REG: AREA(r) >3) COST(r) = MAXS[q,REG, DISTANCE(r,q)]; NB: MINS over an empty set is a very large positive number, about 10^38 ! See also MINS example: calculating the shortest route back to TABLO language contents URL of this topic: www.copsmodels.com/webhelp/tabmate/hc_functions.htm Link to full GEMPACK Manual Link to GEMPACK homepage |