<commit_before>﻿namespace MathelSharp
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Matrix
    {
        private double[][] elements;

        public static Matrix Unity(int nrows)
        {
            double[][] elements = new double[nrows][];

            for (int k = 0; k < nrows; k++)
            {
                elements[k] = new double[nrows];
                elements[k][k] = 1.0;
            }

            return new Matrix(elements, true);
        }

        public Matrix(IList<IList<double>> elements)
        {
            this.elements = new double[elements.Count][];

            for (int k = 0; k < elements.Count; k++)
                this.elements[k] = elements[k].ToArray();
        }

        private Matrix(double[][] elements, Boolean nocopy)
        {
            this.elements = elements;
        }

        private Matrix(double[][] elements)
        {
            this.elements = elements;
        }

        public int Size { get { return this.elements.Length * this.elements[0].Length; } }

        public double[][] Elements 
        { 
            get 
            {
                double[][] newelements;

                newelements = new double[this.elements.Length][];<commit_msg>Matrix constructor refactor<commit_after>﻿namespace MathelSharp
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Matrix
    {
        private double[][] elements;

        public static Matrix Unity(int nrows)
        {
            double[][] elements = new double[nrows][];

            for (int k = 0; k < nrows; k++)
            {
                elements[k] = new double[nrows];
                elements[k][k] = 1.0;
            }

            return new Matrix(elements, true);
        }

        public Matrix(IList<IList<double>> elements)
        {
            this.elements = new double[elements.Count][];

            for (int k = 0; k < elements.Count; k++)
                this.elements[k] = elements[k].ToArray();
        }

        private Matrix(double[][] elements, Boolean nocopy)
        {
            if (nocopy)
                this.elements = elements;
            else
            {
                this.elements = new double[elements.Length][];

                for (int k = 0; k < elements.Length; k++)
                    this.elements[k] = elements[k].ToArray();
            }
        }

        private Matrix(double[][] elements)
        {
            this.elements = elements;
        }

        public int Size { get { return this.elements.Length * this.elements[0].Length; } }

        public double[][] Elements 
        { 
            get 
            {
                double[][] newelements;

                newelements = new double[this.elements.Length][];
{'fraction_non_alphanumeric': 0.11499475707794478, 'fraction_numerical': 0.003844809507165327, 'mean_word_length': 1.4800693240901213, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 7, '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': '324660', 'n_tokens_mistral': 789, 'n_tokens_neox': 737, 'n_words': 184}