[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: How strict is -set matastrict-?
I noticed that in Mata you can willy-nilly change the organizational type of
a declared variable, including one that is not declared a transmorphic
matrix, and even with -mata set matastrict on- (see below). It does lend
some flexibility, but I'm surprised that Mata lets you do it. Is the
philosophy behind this covered in the user's manual? I haven't run across
it. Is it a why-not philosophy?
Also, what is the intention of having three distinct vector organizational
type definitions (vector, rowvector and colvector)? Especially when you
can recast the variable so easily between row and column vectors after
having declared it the other? I'm still plodding through the manual, so it
might all be in there yet.
: mata clear
: mata set matastrict on
: real colvector function flipem()
> real rowvector A // Why does this
> A = (1, 2, 3)
> A = A' // allow this?
1 | 1 |
2 | 2 |
3 | 3 |
: real colvector function expandem()
> real scalar B // Why does this
> B = 2
> B = J(B, 1, 1) // allow this?
1 | 1 |
2 | 1 |
* For searches and help try: