NumPHP\Core\NumPHP::ones PHP Method

ones() public static method

Returns a NumArray filled with 1
Since: 1.0.0
public static ones ( ) : NumArray
return NumArray
    public static function ones()
    {
        $args = func_get_args();
        return new NumArray(Generate::generateArray($args, 1));
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function run()
 {
     $result = [];
     for ($i = 100; $i <= 1000; $i += 100) {
         $numArray = NumPHP::ones($i, $i);
         $time = microtime(true);
         $numArray->abs();
         $timeDiff = microtime(true) - $time;
         $result[$i] = new TestRun($i, $timeDiff);
     }
     return $result;
 }
All Usage Examples Of NumPHP\Core\NumPHP::ones