/** * Tests if cache will be flushed after use of NumArray::sub */ public function testSubCache() { $numArray = new NumArray(5); $numArray->setCache('key', 7); $numArray->sub(3); $this->assertFalse($numArray->inCache('key')); }
/** * Tests if cache will be flushed after using NumArray::abs */ public function testAbsCache() { $numArray = new NumArray(5); $numArray->setCache('key', 6); $numArray->abs(); $this->assertFalse($numArray->inCache('key')); }
public function testCholeskyCache() { $numArray = new NumArray(5); $numArray->setCache(LinAlg\CholeskyDecomposition::CACHE_KEY_CHOLESKY, 8); $this->assertSame(8, LinAlg::cholesky($numArray)); }
/** * Tests Cache::flushCache */ public function testFlushCacheKey() { $numArray = new NumArray(5); $numArray->setCache('key1', 7); $numArray->setCache('key2', 8); $numArray->flushCache('key2'); $this->assertSame(7, $numArray->getCache('key1')); $this->assertFalse($numArray->inCache('key2')); }
/** * Tests LinAlg::inv cache */ public function testInvCache() { $numArray = new NumArray(5); $numArray->setCache(LinAlg::CACHE_KEY_INVERSE, 8); $this->assertSame(8, LinAlg::inv($numArray)); }
/** * Tests caching of NumArray::getTranspose */ public function testTransposeCache() { $numArray = new NumArray(5); $numArray->setCache(NumArray\Transpose::CACHE_KEY_TRANSPOSE, 8); $this->assertSame(8, $numArray->getTranspose()); }
/** * Tests cache of LinAlg::lud */ public function testLUDecompositionCache() { $numArray = new NumArray(5); $numArray->setCache(LUDecomposition::CACHE_KEY_LU_DECOMPOSITION, 8); $this->assertSame(8, LinAlg::lud($numArray)); }