Example #1
0
    public bool WriteOne(Tensor tens, GH_IWriter writer, string Suffix)
    {
        writer.SetInt32("ShapeCount_" + Suffix, tens.ShapeCount);
        List <int> shape = tens.GetShape;

        for (int i = 0, loopTo = tens.ShapeCount - 1; i <= loopTo; i += 1)
        {
            writer.SetInt32("S" + i + "_" + Suffix, shape[i]);
        }
        writer.SetDoubleArray("Data_" + Suffix, tens.ToArray);
        return(true);
    }
Example #2
0
    public override bool Write(GH_IWriter writer)
    {
        writer.SetInt32("ShapeCount", this.Value.ShapeCount);
        List <int> shape = this.Value.GetShape;

        for (int i = 0, loopTo = this.Value.ShapeCount - 1; i <= loopTo; i += 1)
        {
            writer.SetInt32("S" + i, shape[i]);
        }
        writer.SetDoubleArray("Data", this.Value.ToArray);
        return(true);
    }