One of the features designed to make PM convenient for numerical computation is its notation for subexpressions. Any PM expression may be followed by a list of subexpressions introduced by the where keyword. Hdist = 1 –sqrt( 2*s1*s2/ss) * exp ( - (m1-m2)**2 / ss / 4 ) where ss = s1**2 + S2**2 Subexpressions may not refer to each other in the same list, but you can add any number of lists after a given expression: Hdist = 1 –sqrt( 2*s1*s2/ss) * exp ( - (m1-m2)**2 / ss / 4 ) where ss = s1**2 + S2**2 where m1=mean(x), m2=mean(y), s1=stddev(x), s2=stddev(y) In some contexts where clauses apply to a list of expressions, for example: for i in a[r], j in b[r], k in c[r] where r=grid(xlo..xhi,ylo..yhi,zlo..zhi) do … endfor A PM expression may also be combined with an assertion by placing a check clause between the expression and any following subexpressions: x=solve(f,y) check f(x)-y < tolerance The check clau...
This blog will cover the development of the PM Programming Language. This is a new language designed to simplify the coding of numerical models on parallel systems of all kinds. Project details may be found at: www.pm-lang.org