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 DependsOn
looks 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
UncNumber
for mathematical calculations, similar, I could use Complex Structure . - ,
UncNumber
. : UncNumber[,] Dot(UncNumber[,] a, UncNumber[,] b)
. UncNumber
.UncNumber
16 (8 8 / ).
?