<commit_before>/// <reference path="../Runtime/Nullstone.js" />
/// CODE

//#region Matrix
var Matrix = Nullstone.Create("Matrix");

Matrix.Instance.Init = function (args) {
    if (args.length === 2) {
        this._Elements = args[0];
        this._Inverse = args[1];
        return;
    }
    this._Elements = [1, 0, 0, 0, 1, 0];
    this._Identity = true;
};

Matrix.Instance.GetInverse = function () {
    return new Matrix(this._Inverse, this._Elements);<commit_msg>Fixed issue with inverse if matrix was identity.<commit_after>/// <reference path="../Runtime/Nullstone.js" />
/// CODE

//#region Matrix
var Matrix = Nullstone.Create("Matrix");

Matrix.Instance.Init = function (args) {
    if (args.length === 2) {
        var els = args[0];
        this._Elements = els;
        this._Identity = els[0] === 1 && els[1] === 0 && els[2] === 0
            && els[3] === 0 && els[4] === 1 && els[5] === 0;
        this._Inverse = args[1];
        return;
    }
    this._Elements = [1, 0, 0, 0, 1, 0];
    this._Identity = true;
};

Matrix.Instance.GetInverse = function () {
    if (this._Identity)
        return new Matrix();
    return new Matrix(this._Inverse, this._Elements);
{'fraction_non_alphanumeric': 0.1821247892074199, 'fraction_numerical': 0.025295109612141653, 'mean_word_length': 2.5861027190332324, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2562107', 'n_tokens_mistral': 399, 'n_tokens_neox': 386, 'n_words': 97}