HumHub Documentation (unofficial)

Subtraction 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 subtraction
result()  : Matrix
Return the result of the operation
subtractMatrix()  : $this
Execute the subtraction for a matrix
subtractScalar()  : $this
Execute the subtraction 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 subtraction

public execute(mixed $value) : $this
Parameters
$value : mixed

The matrix or numeric value to subtract from the current base value

Tags
throws
Exception

If the provided argument is not appropriate for the operation

Return values
$this

The operation object, allowing multiple subtractions to be chained

subtractMatrix()

Execute the subtraction for a matrix

protected subtractMatrix(Matrix $value) : $this
Parameters
$value : Matrix

The numeric value to subtract from the current base value

Tags
throws
Exception

If the provided argument is not appropriate for the operation

Return values
$this

The operation object, allowing multiple subtractions to be chained

subtractScalar()

Execute the subtraction for a scalar

protected subtractScalar(mixed $value) : $this
Parameters
$value : mixed

The numeric value to subtracted from the current base value

Return values
$this

The operation object, allowing multiple additions 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
throws
Exception

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

Tags
throws
Exception

        
On this page

Search results