Overview

Namespaces

  • Chippyash
    • Math
      • Matrix
        • Attribute
        • Computation
          • Add
          • Div
          • Mul
          • Sub
        • Decomposition
        • Derivative
          • Strategy
            • Determinant
        • Exceptions
        • Formatter
          • DirectedGraph
        • Interfaces
        • Special
        • Traits
        • Transformation
          • Strategy
            • Invert

Classes

  • ComplexMatrix
  • FunctionMatrix
  • IdentityMatrix
  • MatrixFactory
  • NumericMatrix
  • RationalMatrix
  • ShiftMatrix
  • SpecialMatrix
  • ZeroMatrix
  • Overview
  • Namespace
  • Class
  • Tree

Class MatrixFactory

Static factory to create the various standard numerical matrices

Abstract
Namespace: Chippyash\Math\Matrix
Located at MatrixFactory.php
Methods summary
public static Chippyash\Math\Matrix\NumericMatrix
# create( string $type, array $data )

Parameters

$type
$data

Returns

Chippyash\Math\Matrix\NumericMatrix
public static Chippyash\Math\Matrix\ComplexMatrix
# createComplex( array $data )

Create and return a complex number matrix $data elements are either: - a ComplexType - string representations of complex number - a 2 item array representing r & i e.g. [2,-4] = '2-4i'

Create and return a complex number matrix $data elements are either: - a ComplexType - string representations of complex number - a 2 item array representing r & i e.g. [2,-4] = '2-4i'

Parameters

$data

Returns

Chippyash\Math\Matrix\ComplexMatrix

Throws

Chippyash\Math\Matrix\Exceptions\MathMatrixException
public static Chippyash\Math\Matrix\RationalMatrix
# createRational( array $data )

Create and return a rational number matrix $data elements are either: - a RationalType - string representations of rational number - a PHP float - a 2 item array representing numerator & denominator e.g. [2,-4] = '-2/4'

Create and return a rational number matrix $data elements are either: - a RationalType - string representations of rational number - a PHP float - a 2 item array representing numerator & denominator e.g. [2,-4] = '-2/4'

Parameters

$data

Returns

Chippyash\Math\Matrix\RationalMatrix

Throws

Chippyash\Math\Matrix\Exceptions\MathMatrixException
public static Chippyash\Math\Matrix\NumericMatrix
# createNumeric( array $data )

Create and return a numeric value matrix

Create and return a numeric value matrix

Parameters

$data

Returns

Chippyash\Math\Matrix\NumericMatrix
public static Chippyash\Math\Matrix\ComplexMatrix|Chippyash\Math\Matrix\NumericMatrix|Chippyash\Math\Matrix\RationalMatrix
# createFromFunction( callable $fn, Chippyash\Type\Number\IntType $rows, Chippyash\Type\Number\IntType $cols, string $type = 'numeric' )

Construct a complete matrix whose entries are a result of a function

Construct a complete matrix whose entries are a result of a function

The function must accept two parameters e.g. $function($row, $col) {return $row - $col;}

$row and $col are 1 based

Parameters

$fn
$rows
Number of required rows
$cols
Number or required columns
$type
['numeric'|'rational'|'complex']

Returns

Chippyash\Math\Matrix\ComplexMatrix|Chippyash\Math\Matrix\NumericMatrix|Chippyash\Math\Matrix\RationalMatrix

Throws

InvalidArgumentException
public static Chippyash\Math\Matrix\RationalMatrix
# createFromComplex( Chippyash\Type\Number\Complex\ComplexType $c )

Create a matrix representation of a complex number For z = a+bi Returns [[a, -b] [b, a]]

Create a matrix representation of a complex number For z = a+bi Returns [[a, -b] [b, a]]

Parameters

$c

Returns

Chippyash\Math\Matrix\RationalMatrix
Chippyash Math Matrix API documentation generated by ApiGen