@@ -13,7 +13,7 @@ |
||
| 13 | 13 | /** |
| 14 | 14 | * @var \Np\matrix |
| 15 | 15 | */ |
| 16 | - protected $a,$b; |
|
| 16 | + protected $a, $b; |
|
| 17 | 17 | |
| 18 | 18 | public function setUp() : void { |
| 19 | 19 | $this->a = matrix::uniform(500, 500); |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Np\benchmarks\matrix\arithmetic; |
| 4 | 4 | |
| 5 | -use Np\{matrix,vector}; |
|
| 5 | +use Np\{matrix, vector}; |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * @Groups({"Arithmetic"}) |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Np\decompositions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Np\decompositions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Np\decompositions; |
| 6 | 6 | |
@@ -8,6 +8,6 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author ghost |
| 10 | 10 | */ |
| 11 | -class dtypeException extends invalidArgumentException{ |
|
| 11 | +class dtypeException extends invalidArgumentException { |
|
| 12 | 12 | //put your code here |
| 13 | 13 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Np\vector; |
| 6 | 6 | vector::time(); |
| 7 | 7 | vector::getMemory(); |
| 8 | -$v = vector::ar(range(random_int(1,2), random_int(99999,9999999))); |
|
| 8 | +$v = vector::ar(range(random_int(1, 2), random_int(99999, 9999999))); |
|
| 9 | 9 | |
| 10 | 10 | echo $v->sum() . PHP_EOL; |
| 11 | 11 | vector::getMemory(); |
@@ -398,7 +398,7 @@ |
||
| 398 | 398 | * @param \Np\vector|\Np\matrix $v |
| 399 | 399 | * @return \FFI\CData |
| 400 | 400 | */ |
| 401 | - public static function scale(float $alpha, \Np\vector|\Np\matrix $v) { |
|
| 401 | + public static function scale(float $alpha, \Np\vector | \Np\matrix $v) { |
|
| 402 | 402 | self::init(); |
| 403 | 403 | if ($v->dtype == \Np\vector::DOUBLE) { |
| 404 | 404 | return self::$ffi_blas->cblas_dscal($v->ndim, $alpha, $v->data, 1); |
@@ -30,21 +30,21 @@ |
||
| 30 | 30 | public $data; |
| 31 | 31 | protected $_time = null, $_mem = null; |
| 32 | 32 | |
| 33 | - public function checkDimensions(\Np\matrix|\Np\vector $Obj1, \Np\matrix $Obj2) { |
|
| 34 | - if($Obj1->col == $Obj2->row){ |
|
| 33 | + public function checkDimensions(\Np\matrix | \Np\vector $Obj1, \Np\matrix $Obj2) { |
|
| 34 | + if ($Obj1->col == $Obj2->row) { |
|
| 35 | 35 | return true; |
| 36 | 36 | } |
| 37 | 37 | self::_dimensionaMisMatchErr('Mismatch Dimensions of given Objects! Obj-A col & Obj-B row amount need to be the same!'); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function checkDtype(\Np\matrix|\Np\vector $Obj1, \Np\matrix|\Np\vector $Obj2){ |
|
| 41 | - if($Obj1->dtype == $Obj2->dtype) { |
|
| 40 | + public function checkDtype(\Np\matrix | \Np\vector $Obj1, \Np\matrix | \Np\vector $Obj2) { |
|
| 41 | + if ($Obj1->dtype == $Obj2->dtype) { |
|
| 42 | 42 | return true; |
| 43 | 43 | } |
| 44 | 44 | self::_dtypeErr('mismatch data type of given Np\Objects!'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function checkShape(\Np\matrix|\Np\vector $Obj1, \Np\matrix|\Np\vector $Obj2) { |
|
| 47 | + public function checkShape(\Np\matrix | \Np\vector $Obj1, \Np\matrix | \Np\vector $Obj2) { |
|
| 48 | 48 | if ($Obj1 instanceof \Np\vector && $Obj2 instanceof \Np\vector) { |
| 49 | 49 | if ($Obj1->col == $Obj2->col) { |
| 50 | 50 | return true; |