<commit_before><?php
namespace math\LinearAlgebra;

class DiagonalMatrix extends Matrix
{

    /**
     * A Diagonal Matrix is constucted from a single-row array.
     * The elements of this array are placed on the diagonal of a
     * square matrix.
     */
    public function __construct(array $D)
    {
        $this->m = count($D);
        $this->n = $this->m;
        $A = [];
        for($i = 0; $i < $this->m; $i++){
            for($j = 0; $j < $this->m; $j++){
                if ($i == $j){
                    $A[$i][$j] = $D[$i];
                }
                else {
                    $A[$i][$j] = 0;
                }
            }
        }
        $this->A = $A;<commit_msg>Update DiagonalMatrix.php<commit_after><?php
namespace Math\LinearAlgebra;

class DiagonalMatrix extends Matrix
{

    /**
     * A Diagonal Matrix is constucted from a single-row array.
     * The elements of this array are placed on the diagonal of a
     * square matrix.
     */
    public function __construct(array $D)
    {
        $this->m = count($D);
        $this->n = $this->m;
        $A = [];
        for($i = 0; $i < $this->m; $i++){
            for($j = 0; $j < $this->m; $j++){
                if ($i == $j){
                    $A[$i][$j] = $D[$i];
                }
                else {
                    $A[$i][$j] = 0;
                }
            }
        }
        $this->A = $A;
{'fraction_non_alphanumeric': 0.1631054131054131, 'fraction_numerical': 0.004273504273504274, 'mean_word_length': 1.2995090016366613, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '6421945', 'n_tokens_mistral': 460, 'n_tokens_neox': 440, 'n_words': 118}