NumPHP\Core\NumArray::get PHP Метод

get() публичный Метод

Returns a sliced part the NumArray
С версии: 1.0.0
public get ( ) : NumArray
Результат NumArray
    public function get()
    {
        $args = func_get_args();
        return new NumArray(Get::getSubArray($this->data, $args));
    }

Usage Example

Пример #1
0
 /**
  * @param NumArray $matrix
  * @param NumArray $vector
  * @return NumArray
  */
 protected static function backSubstitution(NumArray $matrix, NumArray $vector)
 {
     $shape = $matrix->getShape();
     $xVector = \NumPHP\Core\NumPHP::zeros($shape[0]);
     for ($i = $shape[0] - 1; $i >= 0; $i--) {
         $sum = 0;
         for ($j = $i + 1; $j < $shape[0]; $j++) {
             $sum += $matrix->get($i, $j)->dot($xVector->get($j))->getData();
         }
         $xVector->set($i, ($vector->get($i)->getData() - $sum) / $matrix->get($i, $i)->getData());
     }
     return $xVector;
 }
All Usage Examples Of NumPHP\Core\NumArray::get