NumPHP\Core\NumArray::min PHP Метод

min() публичный Метод

Returns the min of the NumArray for the given axis
С версии: 1.0.0
public min ( integer $axis = null ) : NumArray
$axis integer given axis of min
Результат NumArray
    public function min($axis = null)
    {
        return Reduce::reduceArray($this, function ($data1, $data2) {
            return min($data1, $data2);
        }, $axis);
    }

Usage Example

Пример #1
0
 /**
  * Tests NumArray::min with a matrix and argument 1
  */
 public function testMinMatrixAxis1()
 {
     $numArray = new NumArray([[34, 346, -12], [56, -78, 12], [345, -6, 99]]);
     $expectedNumArray = new NumArray([-12, -78, -6]);
     $this->assertNumArrayEquals($expectedNumArray, $numArray->min(1));
 }