@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * @param matrix|vector $d |
| 20 | 20 | * @return matrix|vector |
| 21 | 21 | */ |
| 22 | - public function max(matrix|vector $d): matrix|vector { |
|
| 22 | + public function max(matrix | vector $d): matrix | vector { |
|
| 23 | 23 | if ($this instanceof matrix && $d instanceof matrix && $this->checkShape($this, $d) && $this->checkDtype($this, $d)) { |
| 24 | 24 | $r = self::factory($this->row, $this->col, $this->dtype); |
| 25 | 25 | } elseif ($this instanceof vector && $d instanceof vector && $this->checkShape($this, $d) && $this->checkDtype($this, $d)) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param matrix|vector $d |
| 37 | 37 | * @return matrix|vector |
| 38 | 38 | */ |
| 39 | - public function min(matrix|vector $d): matrix|vector { |
|
| 39 | + public function min(matrix | vector $d): matrix | vector { |
|
| 40 | 40 | if ($this instanceof matrix && $d instanceof matrix && $this->checkShape($this, $d) && $this->checkDtype($this, $d)) { |
| 41 | 41 | $r = self::factory($this->row, $this->col, $this->dtype); |
| 42 | 42 | } elseif ($this instanceof vector && $d instanceof vector && $this->checkShape($this, $d) && $this->checkDtype($this, $d)) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param callable $func |
| 54 | 54 | * @return matrix|vector |
| 55 | 55 | */ |
| 56 | - public function map(callable $func): matrix|vector { |
|
| 56 | + public function map(callable $func): matrix | vector { |
|
| 57 | 57 | if ($this instanceof matrix) { |
| 58 | 58 | $r = self::factory($this->row, $this->col, $this->dtype); |
| 59 | 59 | } else { |
@@ -65,23 +65,23 @@ discard block |
||
| 65 | 65 | return $r; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function abs(): matrix|vector { |
|
| 68 | + public function abs(): matrix | vector { |
|
| 69 | 69 | return $this->map('abs'); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function sqrt(): matrix|vector { |
|
| 72 | + public function sqrt(): matrix | vector { |
|
| 73 | 73 | return $this->map('sqrt'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function exp(): matrix|vector { |
|
| 76 | + public function exp(): matrix | vector { |
|
| 77 | 77 | return $this->map('exp'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - public function exp1(): matrix|vector { |
|
| 80 | + public function exp1(): matrix | vector { |
|
| 81 | 81 | return $this->map('exp1'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function log(float $b = M_E): matrix|vector { |
|
| 84 | + public function log(float $b = M_E): matrix | vector { |
|
| 85 | 85 | $ar = $this->copy(); |
| 86 | 86 | for ($i = 0; $i < $ar->ndim; ++$i) { |
| 87 | 87 | log($ar->data[$i], $b); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | public function free():void { |
| 137 | - if($this instanceof matrix) { |
|
| 137 | + if ($this instanceof matrix) { |
|
| 138 | 138 | unset($this->row); |
| 139 | 139 | unset($this->col); |
| 140 | 140 | unset($this->ndim); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * make a copy of matrix|vector; |
| 151 | 151 | * @return matrix|vector |
| 152 | 152 | */ |
| 153 | - public function copy(): matrix|vector { |
|
| 153 | + public function copy(): matrix | vector { |
|
| 154 | 154 | return clone $this; |
| 155 | 155 | } |
| 156 | 156 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param float $max |
| 163 | 163 | * @return matrix |
| 164 | 164 | */ |
| 165 | - public function clip(float $min, float $max): matrix|vector { |
|
| 165 | + public function clip(float $min, float $max): matrix | vector { |
|
| 166 | 166 | if ($this instanceof matrix) { |
| 167 | 167 | $ar = self::factory($this->row, $this->col, $this->dtype); |
| 168 | 168 | } else { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param float $max |
| 210 | 210 | * @return matrix |
| 211 | 211 | */ |
| 212 | - public function clipUpper(float $max): matrix|vector { |
|
| 212 | + public function clipUpper(float $max): matrix | vector { |
|
| 213 | 213 | if ($this instanceof matrix) { |
| 214 | 214 | $ar = self::factory($this->row, $this->col, $this->dtype); |
| 215 | 215 | } else { |