Does structure with an array make sense?

I have the following structure with an array as a second field:

public struct UncNumber
{
    private double _value;
    private DependsOn[] _dependencies;

    public double Value { get { return _value; } }
    public DependsOn[] Dependencies { get { return _dependencies; } }

    public UncNumber(double value, DependsOn[] dependencies)
    {
        _value = value;
        _dependencies = dependencies;
    }
}

By the way, the structure DependsOnlooks like this:

public struct DependsOn
{
    private int _input;
    private double _jacobi;

    public int Input { get { return _input; } }
    public double Jacobi { get { return _jacobi; } }

    public DependsOn(int input, double jacobi)
    {
        _input = input;
        _jacobi = jacobi;
    }
}

I looked at the following resources:

But I have not yet concluded if I should use a structure or class for UncNumber. I have the following additional comments why I think structure is the best choice in this case:

  • I use the above structure UncNumberfor mathematical calculations, similar, I could use Complex Structure .
  • , UncNumber. : UncNumber[,] Dot(UncNumber[,] a, UncNumber[,] b).
  • UncNumber .
  • UncNumber 16 (8 8 / ).

?

+4

Source: https://habr.com/ru/post/1687036/


All Articles