MCordingley\LinearAlgebra\Matrix::getRowCount PHP Method

getRowCount() public method

public getRowCount ( ) : integer
return integer
    public function getRowCount() : int
    {
        return count($this->internal);
    }

Usage Example

示例#1
0
 /**
  * @param Matrix $source
  * @throws MatrixException
  */
 private function decompose(Matrix $source)
 {
     $decompositionLiteral = $source->toArray();
     if (!$source->isSquare()) {
         throw new MatrixException('Operation can only be called on square matrix: ' . print_r($decompositionLiteral, true));
     }
     $size = $source->getRowCount();
     for ($k = 0; $k < $size; $k++) {
         for ($i = $k + 1; $i < $size; $i++) {
             $decompositionLiteral[$i][$k] = $decompositionLiteral[$i][$k] / $decompositionLiteral[$k][$k];
         }
         for ($i = $k + 1; $i < $size; $i++) {
             for ($j = $k + 1; $j < $size; $j++) {
                 $decompositionLiteral[$i][$j] = $decompositionLiteral[$i][$j] - $decompositionLiteral[$i][$k] * $decompositionLiteral[$k][$j];
             }
         }
     }
     $this->decomposition = new Matrix($decompositionLiteral);
 }
All Usage Examples Of MCordingley\LinearAlgebra\Matrix::getRowCount