1

Is there any way to find the dimensions of a vector (or even matrix) for a Vector data structure in the MathNet.Numerics namespace. Something along the lines of

int dimension = 3;
Vector<int> x = Vector<int>.Build.Dense(dimension);
int lengthOfX = x.Length();
Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
Sood
  • 149
  • 1
  • 1
  • 11

1 Answers1

2

The name of the respective property is a little bit counterintuitive, but it's there: Vector<T>.Count:

Gets the length or number of dimensions of this vector.

See the documentation.

For a Matrix<T> the properties are ColumnCount and RowCountdocumentation.

Ondrej Tucny
  • 27,626
  • 6
  • 70
  • 90