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

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

Returns a string representing the NumArray
С версии: 1.0.0
public __toString ( ) : string
Результат string
    public function __toString()
    {
        return "NumArray(" . StringHelper::toString($this->data) . ")\n";
    }

Usage Example

Пример #1
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $matrixA = new NumArray([[49, -525, 7, -315], [-525, 6921, -3279, 3483], [7, -3279, 8178, -328], [-315, 3483, -328, 624556]]);
     $output->writeln('<comment>Matrix A:</comment>');
     $output->writeln($matrixA->__toString());
     $output->writeln('<info>Cholesky:</info>');
     $time = microtime(true);
     $matrixL = LinAlg::cholesky($matrixA);
     $timeDiff = microtime(true) - $time;
     $output->writeln($matrixL->__toString());
     $output->writeln('<info>Time for calculation: ' . $timeDiff . ' sec</info>');
 }
All Usage Examples Of NumPHP\Core\NumArray::__toString