<commit_before>﻿//
// Program: BtreeStress01.cs
// Purpose: Brute force testing of insertions and deletions using permutations.
//

using System;
using System.Threading;
using Kaos.Collections;
using Kaos.Combinatorics;

namespace KwDataBench
{
    class BtreeBench03
    {
        static void Main()
        {
            var tree = new BtreeDictionary<int, int> (5);
            

            for (int w = 1; w < 21; ++w)
            {
                foreach (Permutation permAdd in new Permutation (w).GetRows())
                {
                    foreach (Permutation permDel in permAdd.GetRows())
                    {
                        for (int m = 0; m < permAdd.Picks; ++m)
                        {
                            tree.Add (permAdd[m], permAdd[m] + 100);

#if DEBUG
                            if (permDel.Rank == 0)
                            {
                                try
                                {
                                    tree.SanityCheck();
                                }
                                catch (DataMisalignedException ex)
                                {
                                    Console.WriteLine ("Insanity found: {0}", ex.Message);
                                    Console.WriteLine ("Order={0} add.Rank={1} m={2}", w, permAdd.Rank, m);
                                    throw;
                                }
                            }
#endif
                        }
                        //VERBOSE Console.WriteLine ("Added {0}", permAdd);

                        for (int m = 0; m < permDel.Picks; ++m)
                        {
                            tree.Remove (permDel[m]);

#if DEBUG
                            try
                            {
                                tree.SanityCheck();
                            }
                            catch (DataMisalignedException ex)
                            {
                                Console.WriteLine ("Insanity found: {0}", ex.Message);
                                Console.WriteLine ("Order={0} add.Rank={1} del.Rank={2} m={3}",
                                                   w, permAdd.Rank, permDel.Rank, m);
                                throw;
                            }
#endif
                        }
                        //VERBOSE Console.WriteLine ("  Del {0}", permDel);

#if DEBUG
                        if (tree.Count != 0)
                            throw new DataMisalignedException ("Count should be zero");
#endif
                        tree.Clear();
                    }
                }

                Console.WriteLine ("{2} - Completed Order {0} = {1}", w, new Permutation (w), DateTime.Now);
                Thread.Sleep (250);
            }
        }
    }
}<commit_msg>change names and edit whitespace<commit_after>﻿//
// Program: BtreeStress01.cs
// Purpose: Brute force testing of insertions and deletions using permutations.
//

using System;
using System.Threading;
using Kaos.Collections;
using Kaos.Combinatorics;

namespace BenchApp
{
    class BtreeStress01
    {
        static void Main()
        {
            var tree = new BtreeDictionary<int, int> (5);

            for (int w = 1; w < 21; ++w)
            {
                foreach (Permutation permAdd in new Permutation (w).GetRows())
                {
                    foreach (Permutation permDel in permAdd.GetRows())
                    {
                        for (int m = 0; m < permAdd.Picks; ++m)
                        {
                            tree.Add (permAdd[m], permAdd[m] + 100);

#if DEBUG
                            if (permDel.Rank == 0)
                            {
                                try
                                {
                                    tree.SanityCheck();
                                }
                                catch (DataMisalignedException ex)
                                {
                                    Console.WriteLine ("Insanity found: {0}", ex.Message);
                                    Console.WriteLine ("Order={0} add.Rank={1} m={2}", w, permAdd.Rank, m);
                                    throw;
                                }
                            }
#endif
                        }

                        for (int m = 0; m < permDel.Picks; ++m)
                        {
                            tree.Remove (permDel[m]);
#if DEBUG
                            try
                            {
                                tree.SanityCheck();
                            }
                            catch (DataMisalignedException ex)
                            {
                                Console.WriteLine ("Insanity found: {0}", ex.Message);
                                Console.WriteLine ("Order={0} add.Rank={1} del.Rank={2} m={3}",
                                                   w, permAdd.Rank, permDel.Rank, m);
                                throw;
                            }
#endif
                        }
#if DEBUG
                        if (tree.Count != 0)
                            throw new DataMisalignedException ("Count should be zero");
#endif
                        tree.Clear();
                    }
                }

                Console.WriteLine ("{2} - Completed Order {0} = {1}", w, new Permutation (w), DateTime.Now);
                Thread.Sleep (250);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.09276844411979547, 'fraction_numerical': 0.011322132943754566, 'mean_word_length': 0.7747893713545042, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6701756', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1213, 'n_words': 308}