public Tensor ReadOne(GH_IReader reader, string Suffix)
    {
        var shape = new List <int>();
        int cnt   = reader.GetInt32("ShapeCount_" + Suffix);

        for (int i = 0, loopTo = cnt - 1; i <= loopTo; i += 1)
        {
            shape.Add(reader.GetInt32("S" + i + "_" + Suffix));
        }
        return(new Tensor(shape, reader.GetDoubleArray("Data_" + Suffix)));
    }
Beispiel #2
0
    public override bool Read(GH_IReader reader)
    {
        var shape = new List <int>();
        int cnt   = reader.GetInt32("ShapeCount");

        for (int i = 0, loopTo = cnt - 1; i <= loopTo; i += 1)
        {
            shape.Add(reader.GetInt32("S" + i));
        }
        this.Value = new Tensor(shape, reader.GetDoubleArray("Data"));
        return(true);
    }