public void Random_ShouldSucceed() { VectorXD A = VectorXD.Random(10); Assert.True(A.Max() <= 1.0); Assert.True(A.Min() >= 0.0); Assert.Equal(10, A.Length); }
public void Linspace_ShouldSucceed() { VectorXD v = VectorXD.Linespace(1, 10, 10); Assert.Equal(10.0, v.Max()); Assert.Equal(1.0, v.Min()); Assert.Equal(10, v.Length); Assert.Equal(new VectorXD(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }), v); }
public void Ones_ShouldSucceed() { VectorXD v = VectorXD.Ones(4); Assert.True(v.Max() <= 1.0); Assert.True(v.Min() >= 1.0); Assert.Equal(4, v.Length); Assert.Equal(new VectorXD(new[] { 1.0, 1.0, 1.0, 1.0 }), v); }
public void Zeros_ShouldSucceed() { VectorXD v = VectorXD.Zeros(4); Assert.True(v.Max() <= 0.0); Assert.True(v.Min() >= 0.0); Assert.Equal(4, v.Length); Assert.Equal(new VectorXD(new[] { 0.0, 0.0, 0.0, 0.0 }), v); }
public void Identity_ShouldSucceed() { VectorXD v = VectorXD.Identity(3, 1); Assert.True(v.Max() <= 1.0); Assert.True(v.Min() >= 0.0); Assert.Equal(3, v.Length); Assert.Equal(1, v.Get(1)); Assert.Equal(0, v.Get(0)); Assert.Equal(0, v.Get(2)); }