node.py resolve.py
class method node.ident self.ident
matlab | fortran | python | |
---|---|---|---|
|
yes | yes | no |
|
yes | yes | no |
|
yes | no * | yes |
|
yes | no * | yes |
|
yes | yes | no |
matlab | fortran | python | |
---|---|---|---|
|
yes | no | no |
|
yes | ||
|
|||
|
|||
|
no | yes | no |
matlab | fortran | python | |
---|---|---|---|
|
yes | no * | yes |
|
no | yes | no |
|
|||
|
yes | no | yes |
|
yes | no | yes |
- Auto-expanding arrays
Matlab arrays are auto-magically resized on out-of-bounds update. Deprecated, this feature is widely used in legacy code. Supporting this feature is hard both in python and in fortran.
In fortran, the pattern should be somehow (how exactly?) detected in compile-time. In python
__setitem__
hidestry-catch
, withresize
called insidecatch
. Is try-catch in fortran?In numpy out-of-bounds assignment is an error. In smop, out-of-bounds assignment is supported for row and column matrices and their generalizations having shape
[1 1 ... N ... 1]These arrays may be resized along their only non-singular dimension. For other matrices, new columns can be added to F_CONTIGUOUS arrays, and new rows can be added to C_CONTIGUOUS arrays.
Finally, scalar array of any dimension, having shape
[1 1 ... 1]can be resized along any dimension.
- Update to create
In matlab, arrays may be created by updating a non existent array, as in the example:
>>> clear a >>> a(17)=42This unique feature is not supported by smop, but can be worked around by inserting assignments into the original matlab code:
>>> a=[] >>> a(17_=42