Passed
Push — main ( 595812...39c26d )
by Shubham
01:50
created
benchmarks/vector/signalProcessing/convolveBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@
 block discarded – undo
21 21
     protected $b;
22 22
 
23 23
     public function setUp() : void {
24
-        $this->a = matrix::uniform(500,500);
24
+        $this->a = matrix::uniform(500, 500);
25 25
 
26
-        $this->b = matrix::uniform(50,50);
26
+        $this->b = matrix::uniform(50, 50);
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
benchmarks/matrix/arithmetic/sumMatrixBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
benchmarks/matrix/arithmetic/matrixVectorMultiplyBench.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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"})
Please login to merge, or discard this patch.
src/reductions/rref.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,10 @@
 block discarded – undo
26 26
         $lead = 0;
27 27
         $ar = $m->copyMatrix();
28 28
         for ($r = 0; $r < $ar->row; ++$r) {
29
-            if ($lead >= $ar->col)
30
-                break; {
29
+            if ($lead >= $ar->col) {
30
+                            break;
31
+            }
32
+            {
31 33
                 $i = $r;
32 34
                 while ($ar->data[$i * $ar->col + $lead] == 0) {
33 35
                     $i++;
Please login to merge, or discard this patch.
src/reductions/ref.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
 
20 20
 class ref { 
21 21
     
22
-     /**
23
-      * 
24
-      * @param \Np\matrix $m
25
-      * @return matrix|null
26
-      */
22
+        /**
23
+         * 
24
+         * @param \Np\matrix $m
25
+         * @return matrix|null
26
+         */
27 27
     public static function factory(\Np\matrix $m): matrix|null {
28 28
         $ipiv = vector::factory(min($m->row, $m->col), vector::INT);
29 29
         $ar = $m->copyMatrix();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
       * @param \Np\matrix $m
25 25
       * @return matrix|null
26 26
       */
27
-    public static function factory(\Np\matrix $m): matrix|null {
27
+    public static function factory(\Np\matrix $m): matrix | null {
28 28
         $ipiv = vector::factory(min($m->row, $m->col), vector::INT);
29 29
         $ar = $m->copyMatrix();
30
-        if($m->dtype == matrix::FLOAT) {
30
+        if ($m->dtype == matrix::FLOAT) {
31 31
             $lp = lapack::sgetrf($ar, $ipiv);
32 32
             if ($lp != 0) {
33 33
                 return null;
Please login to merge, or discard this patch.
src/decompositions/svd.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare (strict_types=1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Np\decompositions;
6 6
 
Please login to merge, or discard this patch.
src/decompositions/cholesky.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare (strict_types=1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace Np\decompositions;
6 6
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @return matrix|null
29 29
      * @throws RuntimeException
30 30
      */
31
-    public static function factory(matrix $m): matrix|null {
31
+    public static function factory(matrix $m): matrix | null {
32 32
         if ($m->isSquare()) {
33 33
             $ar = $m->copyMatrix();
34 34
             $lp = lapack::potrf($ar);
Please login to merge, or discard this patch.
src/convolve.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
                 $r->data[$i] = $sigma;
29 29
             }
30 30
             return $r;
31
-        }
32
-        else {
31
+        } else {
33 32
             throw new \Exception('Err::given vectors has diffrent data type!');
34 33
         }
35 34
     }
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
                 }
71 70
             }
72 71
             return $rc;
73
-        }
74
-        else {
72
+        } else {
75 73
             throw new \Exception('Err::given matrixes has different data type!');
76 74
         }
77 75
     }
Please login to merge, or discard this patch.
src/core/blas.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -439,7 +439,7 @@
 block discarded – undo
439 439
      * @param \Np\vector|\Np\matrix $v
440 440
      * @return type
441 441
      */
442
-    public static function scale(float $alpha, \Np\vector|\Np\matrix $v) {
442
+    public static function scale(float $alpha, \Np\vector | \Np\matrix $v) {
443 443
         self::init();
444 444
         if ($v->dtype == \Np\vector::DOUBLE) {
445 445
             return self::$ffi_blas->cblas_dscal($v->ndim, $alpha, $v->data, 1);
Please login to merge, or discard this patch.