// SmootherBase test
    ST::magnitudeType testApply_X1_RHS0(const Matrix& A, const SmootherBase & smoother, Teuchos::FancyOStream & out, bool & success) {
      RCP<MultiVector> X   = MultiVectorFactory::Build(A.getDomainMap(),1);
      RCP<MultiVector> RHS = MultiVectorFactory::Build(A.getRangeMap(),1);
      X->putScalar((SC) 1.0);
      RHS->putScalar((SC) 0.0);

      return testApply(A, smoother, *X, *RHS, out, success);
    }
예제 #2
0
파일: Storage-test.c 프로젝트: rlowrance/re
int 
main(int argc, char **argv)
{
  testApply();
  testFree();
  testNew();
  testNewCopy();
  testFill();
  testGetSet();
  testIncrementDecrement();
  testPrint();
  testPrintHeader();
  testResize();

  UnitTest_report();
}
    // SmootherBase test
    ST::magnitudeType testApply_X0_RandomRHS(const Matrix& A, const SmootherBase & smoother, Teuchos::FancyOStream & out, bool & success) {
      RCP<MultiVector> X   = MultiVectorFactory::Build(A.getDomainMap(),1);
      RCP<MultiVector> RHS = MultiVectorFactory::Build(A.getRangeMap(),1);

      // Random X
      X->setSeed(846930886);
      X->randomize();

      // Normalize X
      Array<ST::magnitudeType> norms(1); X->norm2(norms);
      X->scale(1/norms[0]);

      // Compute RHS corresponding to X
      A.apply(*X,*RHS, Teuchos::NO_TRANS,(SC)1.0,(SC)0.0);

      // Reset X to 0
      X->putScalar((SC) 0.0);

      return testApply(A, smoother, *X, *RHS, out, success);
    }