コード例 #1
0
ファイル: SubTest.php プロジェクト: raslin/NumPHP
 /**
  * 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'));
 }
コード例 #2
0
ファイル: AbsTest.php プロジェクト: buaa556/gongkesheng
 /**
  * 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'));
 }
コード例 #3
0
 public function testCholeskyCache()
 {
     $numArray = new NumArray(5);
     $numArray->setCache(LinAlg\CholeskyDecomposition::CACHE_KEY_CHOLESKY, 8);
     $this->assertSame(8, LinAlg::cholesky($numArray));
 }
コード例 #4
0
ファイル: CacheTest.php プロジェクト: raslin/NumPHP
 /**
  * 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'));
 }
コード例 #5
0
ファイル: LinAlgTest.php プロジェクト: buaa556/gongkesheng
 /**
  * Tests LinAlg::inv cache
  */
 public function testInvCache()
 {
     $numArray = new NumArray(5);
     $numArray->setCache(LinAlg::CACHE_KEY_INVERSE, 8);
     $this->assertSame(8, LinAlg::inv($numArray));
 }
コード例 #6
0
ファイル: TransposeTest.php プロジェクト: raslin/NumPHP
 /**
  * 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());
 }
コード例 #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));
 }