functions


The following are real functions:

ABS(-2.3) = 2.3

absolute value

EXP(1.5) = 4.48

inverse of natural log

LOG10(10) = 1

log base 10

LOGE(4.48) = 1.5

natural log

MAX(2.1,3.3) = 3.3

maximum of two

MIN(2.1,3.3) = 2.1

minimum of two

NORMAL, CUMNORMAL

normal distribution functions

LOGNORMAL, CUMLOGNORMAL

normal distribution functions new for GEMPACK 10

GPERF and GPERFC

normal distribution functions new for GEMPACK 10

RANDOM(1,100)

random real number uniform between 1 and 100

SQRT(60) = 7.75

square root

ID01(3.4) = 3.4 ID01(0) = 1

maps nonzero X to X, else 1

ID0V(3.4,7) = 3.4 ID0V(0,7) = 7

maps nonzero X to X, else 2nd arg

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