Multiplication
extends Operator
in package
Table of Contents
Properties
- $columns : mixed
- Number of columns in the matrix
- $matrix : mixed
- Stored internally as a 2-dimension array of values
- $rows : mixed
- Number of rows in the matrix
Methods
- __construct() : mixed
- Create an new handler object for the operation
- execute() : $this
- Execute the multiplication
- result() : Matrix
- Return the result of the operation
- multiplyMatrix() : $this
- Execute the multiplication for a matrix
- multiplyScalar() : $this
- Execute the multiplication for a scalar
- validateMatchingDimensions() : void
- Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction
- validateReflectingDimensions() : void
- Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division
Properties
$columns
Number of columns in the matrix
protected
mixed
$columns
$matrix
Stored internally as a 2-dimension array of values
protected
mixed
$matrix
$rows
Number of rows in the matrix
protected
mixed
$rows
Methods
__construct()
Create an new handler object for the operation
public
__construct(Matrix $matrix) : mixed
Parameters
- $matrix : Matrix
-
The base Matrix object on which the operation will be performed
execute()
Execute the multiplication
public
execute(mixed $value[, string $type = 'multiplication' ]) : $this
Parameters
- $value : mixed
-
The matrix or numeric value to multiply the current base value by
- $type : string = 'multiplication'
Tags
Return values
$this —The operation object, allowing multiple multiplications to be chained
result()
Return the result of the operation
public
result() : Matrix
Return values
MatrixmultiplyMatrix()
Execute the multiplication for a matrix
protected
multiplyMatrix(Matrix $value[, string $type = 'multiplication' ]) : $this
Parameters
- $value : Matrix
-
The numeric value to multiply with the current base value
- $type : string = 'multiplication'
Tags
Return values
$this —The operation object, allowing multiple mutiplications to be chained
multiplyScalar()
Execute the multiplication for a scalar
protected
multiplyScalar(mixed $value[, string $type = 'multiplication' ]) : $this
Parameters
- $value : mixed
-
The numeric value to multiply with the current base value
- $type : string = 'multiplication'
Return values
$this —The operation object, allowing multiple mutiplications to be chained
validateMatchingDimensions()
Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction
protected
validateMatchingDimensions(Matrix $matrix) : void
Parameters
- $matrix : Matrix
-
The second Matrix object on which the operation will be performed
Tags
validateReflectingDimensions()
Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division
protected
validateReflectingDimensions(Matrix $matrix) : void
Parameters
- $matrix : Matrix
-
The second Matrix object on which the operation will be performed