Exemple #1
0
        public void ResetCalculationState()
        {
            var criterion = new ResidualStopCriterion <Complex32>(1e-3f, 10);

            var solution = new DenseVector(new[] { new Complex32(0.001f, 1), new Complex32(0.001f, 1), new Complex32(0.002f, 1) });
            var source   = new DenseVector(new[] { new Complex32(0.001f, 1), new Complex32(0.001f, 1), new Complex32(0.002f, 1) });
            var residual = new DenseVector(new[] { new Complex32(1.000f, 0), new Complex32(1.000f, 0), new Complex32(2.001f, 0) });

            var status = criterion.DetermineStatus(5, solution, source, residual);

            Assert.AreEqual(IterationStatus.Continue, status, "Should be running");

            criterion.Reset();
            Assert.AreEqual(IterationStatus.Continue, criterion.Status, "Should not have started");
        }
        public void ResetCalculationState()
        {
            var criterion = new ResidualStopCriterion <double>(1e-3, 10);

            var solution = Vector <double> .Build.Dense(new[] { 0.001, 0.001, 0.002 });

            var source = Vector <double> .Build.Dense(new[] { 0.001, 0.001, 0.002 });

            var residual = Vector <double> .Build.Dense(new[] { 1.000, 1.000, 2.001 });

            var status = criterion.DetermineStatus(5, solution, source, residual);

            Assert.AreEqual(IterationStatus.Continue, status, "Should be running");

            criterion.Reset();
            Assert.AreEqual(IterationStatus.Continue, criterion.Status, "Should not have started");
        }
        public void ResetCalculationState()
        {
            var criterion = new ResidualStopCriterion<double>(1e-3, 10);

            var solution = Vector<double>.Build.Dense(new[] { 0.001, 0.001, 0.002 });
            var source = Vector<double>.Build.Dense(new[] { 0.001, 0.001, 0.002 });
            var residual = Vector<double>.Build.Dense(new[] { 1.000, 1.000, 2.001 });

            var status = criterion.DetermineStatus(5, solution, source, residual);
            Assert.AreEqual(IterationStatus.Continue, status, "Should be running");

            criterion.Reset();
            Assert.AreEqual(IterationStatus.Continue, criterion.Status, "Should not have started");
        }
        public void ResetCalculationState()
        {
            var criterion = new ResidualStopCriterion<float>(1e-3f, 10);

            var solution = new DenseVector(new[] { 0.001f, 0.001f, 0.002f });
            var source = new DenseVector(new[] { 0.001f, 0.001f, 0.002f });
            var residual = new DenseVector(new[] { 1.000f, 1.000f, 2.001f });

            var status = criterion.DetermineStatus(5, solution, source, residual);
            Assert.AreEqual(IterationStatus.Continue, status, "Should be running");

            criterion.Reset();
            Assert.AreEqual(IterationStatus.Continue, criterion.Status, "Should not have started");
        }
        public void ResetCalculationState()
        {
            var criterion = new ResidualStopCriterion<Complex>(1e-3, 10);

            var solution = new DenseVector(new[] { new Complex(0.001, 1), new Complex(0.001, 1), new Complex(0.002, 1) });
            var source = new DenseVector(new[] { new Complex(0.001, 1), new Complex(0.001, 1), new Complex(0.002, 1) });
            var residual = new DenseVector(new[] { new Complex(1.000, 0), new Complex(1.000, 0), new Complex(2.001, 0) });

            var status = criterion.DetermineStatus(5, solution, source, residual);
            Assert.AreEqual(IterationStatus.Continue, status, "Should be running");

            criterion.Reset();
            Assert.AreEqual(IterationStatus.Continue, criterion.Status, "Should not have started");
        }