Code Coverage for /src/SciPhp/NdArray/Decorator.php

 
Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Decorator
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __call
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1 <?php
2
3 declare(strict_types=1);
4
5 namespace SciPhp\NdArray;
6
7 use ArrayAccess;
8 use SciPhp\NumPhp as np;
9
10 /**
11  * Multiple inheritance for NdArray
12  *
13  * @method \SciPhp\NdArray reciprocal() Return the reciprocal of the argument, element-wise. {@link http://sciphp.org/ndarray.reciprocal}
14  * @method int|float|array trace(int $k = 0) Sum along diagonals {@link http://sciphp.org/ndarray.trace}.
15  * @method \SciPhp\NdArray tril(int $k = 0) Lower triangle of an array {@link http://sciphp.org/ndarray.tril}
16  * @method \SciPhp\NdArray triu(int $k = 0) Upper triangle of an array {@link http://sciphp.org/ndarray.triu}
17  * @method \SciPhp\NdArray vander(int $num = null) Generate a Vandermonde matrix. {@link http://sciphp.org/ndarray.vander}
18  * @method \SciPhp\NdArray signbit() Returns element-wise true where signbit is set (less than zero). {@link http://sciphp.org/ndarray.signbit}
19  * @method \SciPhp\NdArray log(int|float $base = M_E) Natural logarithm, element-wise. {@link http://sciphp.org/ndarray.log}
20  * @method \SciPhp\NdArray log10() Base-10 logarithm, element-wise. {@link http://sciphp.org/ndarray.log10}
21  * @method \SciPhp\NdArray log2() Base-2 logarithm, element-wise. {@link http://sciphp.org/ndarray.log2}
22  * @method \SciPhp\NdArray negative() Numerical negative, element-wise. {@link http://sciphp.org/ndarray.negative}
23  * @method bool            is_square() Is current matrix a square matrix. {@link http://sciphp.org/ndarray.is_square}
24  * @method \SciPhp\NdArray expm1() Calculate exp(x) - 1 for all elements in the array. {@link http://sciphp.org/ndarray.expm1}
25  * @method \SciPhp\NdArray exp2() Calculate 2**p for all p in the input array. {@link http://sciphp.org/ndarray.exp2}
26  * @method \SciPhp\NdArray power(float|int $exponent) Matrix elements raised to powers. {@link http://sciphp.org/ndarray.power}
27  * @method \SciPhp\NdArray square() The element-wise square of the input. {@link http://sciphp.org/ndarray.square}
28  * @method \SciPhp\NdArray sqrt() The non-negative square-root of an array, element-wise. {@link http://sciphp.org/ndarray.sqrt}
29  * @method int|float|array trapz() Integrate along the given axis using the composite trapezoidal rule. {@link http://sciphp.org/ndarray.trapz}
30  * @method int|float|\SciPhp\NdArray sum(int|null $axis, bool $keepdims) Sum all elements. {@link http://sciphp.org/ndarray.sum}
31  * @method \SciPhp\NdArray subtract(\SciPhp\NdArray|array|float|int $input) Subtract input from matrix. {@link http://sciphp.org/ndarray.subtract}
32  * @method \SciPhp\NdArray multiply(\SciPhp\NdArray|array|float|int $input) Multiply matrix by a given input, element-wise. {@link http://sciphp.org/ndarray.multiply}
33  * @method \SciPhp\NdArray copysign(\SciPhp\NdArray|array|float|int $m) Change the sign to that of given matrix, element-wise. {@link http://sciphp.org/ndarray.copysign}
34  * @method \SciPhp\NdArray cos() Cosine element-wise. {@link http://sciphp.org/ndarray.cos}
35  * @method \SciPhp\NdArray sin() Trigonometric sine, element-wise. {@link http://sciphp.org/ndarray.sin}
36  * @method \SciPhp\NdArray tan() Compute tangent element-wise. {@link http://sciphp.org/ndarray.tan}
37  * @method \SciPhp\NdArray transform() Transform a PHP array in a NdArray if needed
38  */
39 abstract class Decorator implements ArrayAccess, IndexInterface
40 {
41     use ArithmeticTrait;
42     use AttributeTrait;
43     use BasicTrait;
44     use IndexTrait;
45     use ShapeTrait;
46     use VisitorTrait;
47
48     /**
49      * Call a np function
50      *
51      * @return mixed
52      */
53     final public function __call(string $name, ?array $arguments = null)
54     {
55         return np::$name($this, ...$arguments);
56     }
57 }