\Matrix\OperatorsMultiplication

Summary

Methods
Properties
Constants
__construct()
result()
execute()
No public properties found
No constants found
validateMatchingDimensions()
validateReflectingDimensions()
multiplyScalar()
multiplyMatrix()
$matrix
$rows
$columns
N/A
No private methods found
No private properties found
N/A

Properties

$matrix

$matrix

Stored internally as a 2-dimension array of values

$rows

$rows

Number of rows in the matrix

$columns

$columns

Number of columns in the matrix

Methods

__construct()

__construct(\Matrix\Matrix  $matrix) : mixed

Create an new handler object for the operation

Parameters

\Matrix\Matrix $matrix

The base Matrix object on which the operation will be performed

Returns

mixed —

result()

result() : \Matrix\Matrix

Return the result of the operation

Returns

\Matrix\Matrix —

execute()

execute(mixed  $value) : $this

Execute the multiplication

Parameters

mixed $value

The matrix or numeric value to multiply the current base value by

Throws

\Matrix\Exception

If the provided argument is not appropriate for the operation

Returns

$this —

The operation object, allowing multiple multiplications to be chained

validateMatchingDimensions()

validateMatchingDimensions(\Matrix\Matrix  $matrix) : void

Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction

Parameters

\Matrix\Matrix $matrix

The second Matrix object on which the operation will be performed

Throws

\Matrix\Exception

validateReflectingDimensions()

validateReflectingDimensions(\Matrix\Matrix  $matrix) : void

Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division

Parameters

\Matrix\Matrix $matrix

The second Matrix object on which the operation will be performed

Throws

\Matrix\Exception

multiplyScalar()

multiplyScalar(mixed  $value) : $this

Execute the multiplication for a scalar

Parameters

mixed $value

The numeric value to multiply with the current base value

Returns

$this —

The operation object, allowing multiple mutiplications to be chained

multiplyMatrix()

multiplyMatrix(\Matrix\Matrix  $value) : $this

Execute the multiplication for a matrix

Parameters

\Matrix\Matrix $value

The numeric value to multiply with the current base value

Throws

\Matrix\Exception

If the provided argument is not appropriate for the operation

Returns

$this —

The operation object, allowing multiple mutiplications to be chained