MCordingley\LinearAlgebra\Matrix::lower PHP Method

lower() public method

public lower ( boolean $unitriangular ) : self
$unitriangular boolean True to have ones along the diagonal. False to include parent matrix values, instead.
return self
    public function lower(bool $unitriangular) : self
    {
        return $this->map(function (float $element, int $i, int $j) use($unitriangular) {
            if ($unitriangular && $i === $j) {
                return 1;
            }
            return $i < $j ? 0 : $element;
        });
    }

Usage Example

Example #1
0
 /**
  * @return Matrix
  */
 public function lower() : Matrix
 {
     return $this->decomposition->lower(true);
 }
All Usage Examples Of MCordingley\LinearAlgebra\Matrix::lower