80 FactoryMonitor m(*
this,
"Nullspace presmooth factory", currentLevel);
82 RCP<MultiVector> newB;
84 RCP<Matrix> A = Get< RCP<Matrix> > (currentLevel,
"A");
85 RCP<MultiVector> B = Get< RCP<MultiVector> >(currentLevel,
"Nullspace");
86 newB = MultiVectorFactory::Build(B->getMap(), B->getNumVectors());
93 A->apply(*B, *newB, Teuchos::NO_TRANS);
95 size_t numVec = newB->getNumVectors();
96 LO numElements = newB->getLocalLength();
97 for (
size_t j = 0; j < numVec; j++) {
98 Teuchos::ArrayRCP<const SC> Bj = B->getData(j);
99 Teuchos::ArrayRCP<SC> newBj = newB->getDataNonConst(j);
101 for (LO i = 0; i < numElements; i++)
102 newBj[i] = Bj[i] - damping*newBj[i]/D[i];
105 newB = Get< RCP<MultiVector> >(currentLevel,
"Nullspace");
109 Set(currentLevel,
"Nullspace", newB);
static Scalar PowerMethod(const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, bool scaleByDiag=true, LocalOrdinal niters=10, Magnitude tolerance=1e-2, bool verbose=false, unsigned int seed=123)