<commit_before>﻿// Original Work Copyright (c) <NAME> 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file

using System;

namespace EOLib.IO.Map
{
    public class Matrix<T> : IReadOnlyMatrix<T>
    {
        private readonly T[,] _arr;

        public int Rows { get; private set; }
        public int Cols { get; private set; }

        public Matrix(int rows, int cols)
        {
            Rows = rows;
            Cols = cols;
            _arr = new T[rows, cols];
        }

        public Matrix(int rows, int cols, T defaultValue)
            : this(rows, cols)
        {
            Fill(defaultValue);
        } 

        private void Fill(T value)
        {
            for (int row = 0; row < Rows; ++row)
                for (int col = 0; col < Cols; ++col)
                    _arr[row, col] = value;
        }<commit_msg>Add Empty matrix definition<commit_after>﻿// Original Work Copyright (c) <NAME> 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file

using System;

namespace EOLib.IO.Map
{
    public class Matrix<T> : IReadOnlyMatrix<T>
    {
        private static readonly Matrix<T> _empty = new Matrix<T>(0, 0);
        public static Matrix<T> Empty { get { return _empty; } }

        private readonly T[,] _arr;

        public int Rows { get; private set; }
        public int Cols { get; private set; }

        public Matrix(int rows, int cols)
        {
            Rows = rows;
            Cols = cols;
            _arr = new T[rows, cols];
        }

        public Matrix(int rows, int cols, T defaultValue)
            : this(rows, cols)
        {
            Fill(defaultValue);
        } 

        public Matrix(Matrix<T> other)
            : this(other.Rows, other.Cols)
        {
            for (int row = 0; row < other.Rows; ++row)
                for (int col = 0; col < other.Cols; ++col)
                    _arr[row, col] = other[row, col];
        }

        private void Fill(T value)
        {
            for (int row = 0; row < Rows; ++row)
                for (int col = 0; col < Cols; ++col)
                    _arr[row, col] = value;
        }
{'fraction_non_alphanumeric': 0.10631531122217174, 'fraction_numerical': 0.011812812358019082, 'mean_word_length': 1.6059171597633135, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 13, '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': '3704519', 'n_tokens_mistral': 694, 'n_tokens_neox': 647, 'n_words': 223}