Exemplo n.º 1
0
 /**
  * Axiom: |x|∞ ≤ |x|₁ ≤ √n |x|∞
  * Max norm is less than equal to l₁-norm which is less than equal to sqrt n * max norm.
  *
  * @dataProvider dataProviderForSingleVector
  */
 public function testMaxNormLessThanEqualL1NormLessThanEqualSqrtNMaxNorm(array $V)
 {
     $V = new Vector($V);
     $n = $V->getN();
     $max_norm = $V->maxNorm();
     $l₁norm = $V->l1Norm();
     $√n_max_norm = $n * $max_norm;
     $this->assertLessThanOrEqual($l₁norm, $max_norm);
     $this->assertLessThanOrEqual($√n_max_norm, $l₁norm);
     $this->assertLessThanOrEqual($√n_max_norm, $max_norm);
 }
Exemplo n.º 2
0
 /**
  * @dataProvider dataProviderForMaxNorm
  */
 public function testMaxNorm(array $A, $maxnorm)
 {
     $A = new Vector($A);
     $this->assertEquals($maxnorm, $A->maxNorm(), '', 0.0001);
 }