Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Phpml\Math\Matrix Class Reference

Public Member Functions

 __construct (array $matrix, bool $validate=true)
 
 add (self $other)
 Element-wise addition of the matrix with another one.
 
 crossOut (int $row, int $column)
 
 divideByScalar ($value)
 
 frobeniusNorm ()
 Frobenius norm (Hilbert–Schmidt norm, Euclidean norm) (‖A‖F) Square root of the sum of the square of all elements.
 
 getColumns ()
 
 getColumnValues (int $column)
 
 getDeterminant ()
 
 getRows ()
 
 inverse ()
 
 isSingular ()
 
 isSquare ()
 
 multiply (self $matrix)
 
 multiplyByScalar ($value)
 
 subtract (self $other)
 Element-wise subtracting of another matrix from this one.
 
 toArray ()
 
 toScalar ()
 
 transpose ()
 

Static Public Member Functions

static dot (array $array1, array $array2)
 Returns the dot product of two arrays
Matrix\dot(x, y) ==> x.y'.
 
static fromFlatArray (array $array)
 
static transposeArray (array $array)
 Returns the transpose of given array.
 

Constructor & Destructor Documentation

◆ __construct()

Phpml\Math\Matrix::__construct ( array $matrix,
bool $validate = true )
Exceptions
InvalidArgumentException

Member Function Documentation

◆ divideByScalar()

Phpml\Math\Matrix::divideByScalar ( $value)
Parameters
float | int$value

◆ frobeniusNorm()

Phpml\Math\Matrix::frobeniusNorm ( )

Frobenius norm (Hilbert–Schmidt norm, Euclidean norm) (‖A‖F) Square root of the sum of the square of all elements.

https://en.wikipedia.org/wiki/Matrix_norm#Frobenius_norm

     _____________
    /ᵐ   ⁿ

‖A‖F = √ Σ Σ |aᵢⱼ|² ᵢ₌₁ ᵢ₌₁

◆ getColumnValues()

Phpml\Math\Matrix::getColumnValues ( int $column)
Exceptions
MatrixException

◆ getDeterminant()

Phpml\Math\Matrix::getDeterminant ( )
Return values
float|int
Exceptions
MatrixException

◆ multiplyByScalar()

Phpml\Math\Matrix::multiplyByScalar ( $value)
Parameters
float | int$value

The documentation for this class was generated from the following file: