Am 06.11.2012 23:37, schrieb Allin Cottrell:
On Sun, 4 Nov 2012, Allin Cottrell wrote:

On Sun, 4 Nov 2012, Pindar wrote:

matrix mtestm = (ytestm.>0) ? 10 : 2 #this works not
Yes, it is guaranteed by hansl syntax that it "works not".
Second thoughts about this. We want to support as many uses of the 
various operators in hansl as make good sense (in the context of a 
variety of types). And I can see that your statement could make good 
sense -- on condition that ytestm is an (m x n) matrix and that
mtestm should be a matrix of the same dimensions.

In gretl CVS we now support a matrix condition for the ternary "?" 
operator. Here's an example that now works:
Dear Allin,

hansl is the best scripting language I know, and now it's even better - that's great!
I wanted to reproduce the advanced mle script in matrix form and that's how I came across this statement.

Have a nice day
Leon
<hansl>
matrix M = I(3)
matrix A = M .> 0 ? 10 : -2
print A
</hansl>

which gives

? print A
A (3 x 3)

   10   -2   -2
   -2   10   -2
   -2   -2   10

This is not yet in the snapshots for Windows and OS X, but it will 
be before long.

Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users