What do you all think about adding a matrix class.
It would be really usefull to have it as a class..

Pseudo code:

        new P0, Matrix, 3, 3    
        set P0, 0, 0, 1
        set P0, 0, 1, 3
        set P0, 0, 2, 1
        set P0, 1, 0, 2
        set P0, 1, 1, 2
        set P0, 1, 2, 2
        set P0, 2, 0, 3
        set P0, 2, 0, 1
        set P0, 2, 0, 3
        
        print P0 would then give:
           1  2  3
           3  2  1
           1  2  3

Or another way could be using matlab like syntax (treated as a string):

        new P0, Matrix, 3, 3
        set P0, "[1 2 3; 3 2 1; 1 2 3]"


A third option maybe (if its possible) would be to actually adding above
syntax to the assembler but that would probably look to ugly

       new P0, Matrix, 3, 3                                                    
       set P0, [1 2 3; 3 2 1; 1 2 3]

Maybe one could use (...) and "## args" in c to possible create a syntax
like :
        new P0, Matrix, 3, 3
        set P0, 1,2,3,,3,2,1,,1,2,3 


What do you all think about this..
It would be really usefull to have builtin vector operations like
transpose eigevects etc...



/josef

Reply via email to