Ejemplo n.º 1
0
 /**
  * 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'));
 }
Ejemplo n.º 2
0
 /**
  * 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));
 }
Ejemplo n.º 4
0
 /**
  * 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'));
 }
Ejemplo n.º 5
0
 /**
  * Tests LinAlg::inv cache
  */
 public function testInvCache()
 {
     $numArray = new NumArray(5);
     $numArray->setCache(LinAlg::CACHE_KEY_INVERSE, 8);
     $this->assertSame(8, LinAlg::inv($numArray));
 }
Ejemplo n.º 6
0
 /**
  * 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());
 }
Ejemplo n.º 7
0
 /**
  * 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));
 }