Code Duplication    Length = 11-11 lines in 2 locations

src/Phpml/Math/Matrix.php 2 locations

@@ 145-155 (lines=11) @@
142
    /**
143
     * @return Matrix
144
     */
145
    public function transpose()
146
    {
147
        $newMatrix = [];
148
        for ($i = 0; $i < $this->rows; ++$i) {
149
            for ($j = 0; $j < $this->columns; ++$j) {
150
                $newMatrix[$j][$i] = $this->matrix[$i][$j];
151
            }
152
        }
153
154
        return new self($newMatrix, false);
155
    }
156
157
    /**
158
     * @param Matrix $matrix
@@ 189-199 (lines=11) @@
186
     *
187
     * @return Matrix
188
     */
189
    public function divideByScalar($value)
190
    {
191
        $newMatrix = array();
192
        for ($i = 0; $i < $this->rows; ++$i) {
193
            for ($j = 0; $j < $this->columns; ++$j) {
194
                $newMatrix[$i][$j] = $this->matrix[$i][$j] / $value;
195
            }
196
        }
197
198
        return new self($newMatrix, false);
199
    }
200
201
    /**
202
     * @return Matrix