public static Vector <float> Vector(TestVector vector) { switch (vector) { case TestVector.Dense5: return(V.Dense(new float[] { 1, 2, 3, 4, 5 })); case TestVector.Dense5WithZeros: return(V.Dense(new float[] { 2, 0, 0, -5, 0 })); case TestVector.Sparse5: return(V.SparseOfEnumerable(new float[] { 1, 2, 3, 4, 5 })); case TestVector.Sparse5WithZeros: return(V.SparseOfEnumerable(new float[] { 2, 0, 0, -5, 0 })); case TestVector.Sparse5AllZeros: return(V.Sparse(5)); case TestVector.SparseMaxLengthAllZeros: return(V.Sparse(int.MaxValue)); default: throw new NotSupportedException(); } }
public static Vector <Complex32> Vector(TestVector vector) { switch (vector) { case TestVector.Dense5: return(V.Dense(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1), new Complex32(4, 1), new Complex32(5, 1) })); case TestVector.Dense5WithZeros: return(V.Dense(new[] { new Complex32(2, -1), new Complex32(0, 0), new Complex32(0, 2), new Complex32(-5, 1), new Complex32(0, 0) })); case TestVector.Sparse5: return(V.SparseOfEnumerable(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1), new Complex32(4, 1), new Complex32(5, 1) })); case TestVector.Sparse5WithZeros: return(V.SparseOfEnumerable(new[] { new Complex32(2, -1), new Complex32(0, 0), new Complex32(0, 2), new Complex32(-5, 1), new Complex32(0, 0) })); case TestVector.Sparse5AllZeros: return(V.Sparse(5)); case TestVector.SparseMaxLengthAllZeros: return(V.Sparse(int.MaxValue)); default: throw new NotSupportedException(); } }