public virtual string ToJson(params SuperArray[] sample_n) { SpaceSamples samples = new SpaceSamples(); foreach (var item in sample_n) { samples.Samples.Add(SampleArray.FromArray(item)); } return(Newtonsoft.Json.JsonConvert.SerializeObject(samples, Newtonsoft.Json.Formatting.Indented)); }
public static SampleArray FromArray(SuperArray x) { SampleArray result = new SampleArray() { Data = x.Data <float>(), Shape = x.Shape, DataType = x.ElementType }; return(result); }