21        if (is_array($value)) {
 
   22            $value = 
new Matrix($value);
 
   25        if (is_object($value) && ($value instanceof 
Matrix)) {
 
   27        } elseif (is_numeric($value)) {
 
   31        throw new Exception(
"Invalid argument for $type");
 
   45                    $this->matrix[
$row][$column] *= $value;
 
   48        } 
catch (Throwable $e) {
 
   49            throw new Exception(
"Invalid argument for $type");
 
   72                for ($column = 0; $column < $newColumns; ++$column) {
 
   73                    $columnData = $value->
getColumns($column + 1)->toArray();
 
   74                    foreach ($this->matrix[
$row] as 
$key => $valueData) {
 
   79        } 
catch (Throwable $e) {
 
   80            throw new Exception(
"Invalid argument for $type");
 
An exception for terminatinating execution or to throw for unit testing.
static createFilledMatrix($fillValue, $rows, $columns=null)
Create a new matrix of specified dimensions, and filled with a specified value If the column argument...
getColumns(int $column, int $columnCount=1)
Return a new matrix as a subset of columns from this matrix, starting at column number $column,...
columns()
Returns a Generator that will yield each column of the matrix in turn as a vector matrix or the value...
multiplyScalar($value, string $type='multiplication')
Execute the multiplication for a scalar.
multiplyMatrix(Matrix $value, string $type='multiplication')
Execute the multiplication for a matrix.
execute($value, string $type='multiplication')
Execute the multiplication.
validateReflectingDimensions(Matrix $matrix)
Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/...
$rows
Number of rows in the matrix.
$columns
Number of columns in the matrix.
Class for the creating "special" Matrices.