<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NumCIL.Float;
using NumCIL;
using T = System.Single;

namespace UnitTest
{
    public class BenchmarkTests
    {
        public static void RunTests()
        {
            var jacobiResult = Tester.JacobiSolver.Solve(100, 100, true, 10);
            if (Math.Abs(jacobiResult - 6529.6474649484189) > 0.01)
                throw new Exception(string.Format("Jacobi solver failed: {0}, diff: {1}", jacobiResult, Math.Abs(jacobiResult - 6529.6474649484189)));

            var blackScholesResult = Tester.BlackScholesSolver.Solve(36000, 10, false);
            if (Math.Abs(blackScholesResult - 51.855494520660294) > 0.01)
                throw new Exception(string.Format("BlackScholes solver failed: {0}, diff: {1}", blackScholesResult, Math.Abs(blackScholesResult - 51.855494520660294)));

            var kNNResult = Tester.kNNSolver.Solve(100, 64, 4, false).Sum();
            if (Math.Abs(kNNResult - 2460) > 0.01)
                throw new Exception(string.Format("kNN solver failed: {0}, diff: {1}", kNNResult, Math.Abs(kNNResult - 9969336320)));

            var shallowWaterResult = Tester.ShallowWaterSolver.Solve(200, 4);
            if (Math.Abs(shallowWaterResult - 204.04741883859941) > 0.01)
                throw new Exception(string.Format("ShallowWater solver failed: {0}, diff {1}", shallowWaterResult, Math.Abs(shallowWaterResult - 204.04741883859941)));

        }
    }
}
<commit_msg>Updated NumCIL unit test to also run the nbody C# sample<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NumCIL.Float;
using NumCIL;
using T = System.Single;

namespace UnitTest
{
    public class BenchmarkTests
    {
        public static void RunTests()
        {
            var jacobiResult = Tester.JacobiSolver.Solve(100, 100, true, 10);
            if (Math.Abs(jacobiResult - 6529.6474649484189) > 0.01)
                throw new Exception(string.Format("Jacobi solver failed: {0}, diff: {1}", jacobiResult, Math.Abs(jacobiResult - 6529.6474649484189)));

            var blackScholesResult = Tester.BlackScholesSolver.Solve(36000, 10, false);
            if (Math.Abs(blackScholesResult - 51.855494520660294) > 0.01)
                throw new Exception(string.Format("BlackScholes solver failed: {0}, diff: {1}", blackScholesResult, Math.Abs(blackScholesResult - 51.855494520660294)));

            var kNNResult = Tester.kNNSolver.Solve(100, 64, 4, false).Sum();
            if (Math.Abs(kNNResult - 2460) > 0.01)
                throw new Exception(string.Format("kNN solver failed: {0}, diff: {1}", kNNResult, Math.Abs(kNNResult - 9969336320)));

            var shallowWaterResult = Tester.ShallowWaterSolver.Solve(200, 4);
            if (Math.Abs(shallowWaterResult - 204.04741883859941) > 0.01)
                throw new Exception(string.Format("ShallowWater solver failed: {0}, diff {1}", shallowWaterResult, Math.Abs(shallowWaterResult - 204.04741883859941)));

            Tester.nBodySolver.Solve(100, 2);
        }
    }
}

{'fraction_non_alphanumeric': 0.11837511900983815, 'fraction_numerical': 0.10345921929546176, 'mean_word_length': 2.8865598027127004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3205852', 'n_tokens_mistral': 1234, 'n_tokens_neox': 980, 'n_words': 222}