json-fortran
json-fortran copied to clipboard
Matrices
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.
See: #212. Added a matrix_info
routine to check if a variable is a valid matrix.
A corresponding set
routine would be a huge plus 👍
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]
],
],
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.
See: #426