json-fortran icon indicating copy to clipboard operation
json-fortran copied to clipboard

Matrices

Open jacobwilliams opened this issue 8 years ago • 5 comments

Add get routines for getting matrices (integer, real, etc.) from json files and objects. This could be used, for example, to easily get a variable like:

{
    "matrix": [
        [1,2,3,4],
        [1,2,3,4],
        [1,2,3,4]
    ]
}

Could also have optional inputs to indicate if the matrix is stored in column-major (Fortran-style) or row-major (C-style) order.

Would also have to check to make sure each row has the same number of columns and are all the same variable type.

Also add the corresponding set routines.

jacobwilliams avatar Oct 06 '15 22:10 jacobwilliams

See: #212. Added a matrix_info routine to check if a variable is a valid matrix.

jacobwilliams avatar Jun 26 '16 05:06 jacobwilliams

A corresponding set routine would be a huge plus 👍

derdrdirk avatar Jan 18 '18 11:01 derdrdirk

Just checking to see if this was a dead feature request or not. The matrix_info routine works fine to check to see if a matrix exists and gets some sizes but really would love to have some get routines to read in something like this:

    "fooList":
    [
        [
            [ 0.2,0.01,0.02,0.04],
            [ 50.1,30.2,0.01,0.02,0.04],
            [ 50.1,30.2,0.01,0.02,0.04],
            [ 0.2,0.01,0.02,0.04]
        ],
        [
            [ 0.2,0.01,0.02,0.04],
            [ 50.1,30.2,0.01,0.02,0.04],
            [ 50.1,30.2,0.01,0.02,0.04],
            [ 0.2,0.01,0.02,0.04]
        ],
    ],

porteri avatar Aug 14 '18 01:08 porteri

It's not dead... I'm just not looking forward to having to add all the wrapper for all the different variable types. :) I'll try to get to it when I can.

jacobwilliams avatar Aug 22 '18 14:08 jacobwilliams

See: #426

jacobwilliams avatar Jul 29 '19 02:07 jacobwilliams