sum() public method

Summed all elements of an NumArray for the given axis
Since: 1.0.0
public sum ( integer $axis = null ) : NumArray
$axis integer given axis of sum
return NumArray
Exemplo n.º 1
0
 /**
  * Tests if InvalidArgumentException will be thrown by using NumArray::sum and a
  * wrong axis on a scalar value
  *
  * @expectedException        \NumPHP\Core\Exception\InvalidArgumentException
  * @expectedExceptionMessage Axis 1 out of bounds
  */
 public function testSumSingleAxis1()
 {
     $numArray = new NumArray(6);
     $numArray->sum(1);
 }