コード例 #1
0
        public void Count_ShouldSucceed()
        {
            var A = new VectorXD(new double[] { 1, 3, -1, 0, double.PositiveInfinity, -1 }).ToSparse();

            Assert.Equal(1, A.Count(x => x == 0));
            Assert.Equal(2, A.Count(x => x == -1));
            Assert.Equal(1, A.Count(x => double.IsInfinity(x)));
        }
コード例 #2
0
        public void Count_ShouldSucceed()
        {
            var A = new VectorXD(new double[] { 1, 3, double.NaN, 0, double.PositiveInfinity, double.NaN });

            Assert.Equal(1, A.Count(x => x == 0));
            Assert.Equal(2, A.Count(x => double.IsNaN(x)));
            Assert.Equal(1, A.Count(x => double.IsInfinity(x)));
        }