Open nncarlson opened 4 hours ago
The parameter_list
type already supports complex variables via the set
and get_any
methods. The only missing piece is specific get
methods for complex arguments. This is trivial to add.
Adding support for complex data to parameter_list_json
is more difficult as JSON has no intrinsic notion of complex numbers. I see two options (not necessarily exclusive):
{re: 1.0, im: 2.0}
;[1.0, 2.0]
.The main difference between the two is on where the capability is implemented.
In option 1, the parameter list reader will need to examine each sublist it reads, and when it finds this special structure, replace the sublist with a complex-valued parameter. No change is needed to parameter_list
.
With option 2, no change to the parameter list reader is needed. Instead the parameter_list%get
method for complex arguments needs to be extended to allow a size-2 array to be mapped to a complex value.
Add support for complex-valued parameters.