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

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

Multiplies an array, NumArray or numeric value to the existing NumArray
С версии: 1.0.0
public dot ( mixed $factor )
$factor mixed an other int, float, array or NumArray
    public function dot($factor)
    {
        if (!$factor instanceof NumArray) {
            $factor = new NumArray($factor);
        }
        $result = Dot::dotArray($this->data, $this->shape, $factor->getData(), $factor->getShape());
        $this->data = $result['data'];
        $this->shape = $result['shape'];
        $this->flushCache();
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Tests if cache will be flushed after using NumArray::dot
  */
 public function testDotCache()
 {
     $numArray = new NumArray(5);
     $numArray->setCache('key', 7);
     $numArray->dot(5);
     $this->assertFalse($numArray->inCache('key'));
 }
All Usage Examples Of NumPHP\Core\NumArray::dot