44 FactoryMonitor m(*
this,
"Nullspace presmooth factory", currentLevel);
46 RCP<MultiVector> newB;
48 RCP<Matrix> A = Get<RCP<Matrix> >(currentLevel,
"A");
49 RCP<MultiVector> B = Get<RCP<MultiVector> >(currentLevel,
"Nullspace");
50 newB = MultiVectorFactory::Build(B->getMap(), B->getNumVectors());
57 A->apply(*B, *newB, Teuchos::NO_TRANS);
59 size_t numVec = newB->getNumVectors();
60 LO numElements = newB->getLocalLength();
61 for (
size_t j = 0; j < numVec; j++) {
62 Teuchos::ArrayRCP<const SC> Bj = B->getData(j);
63 Teuchos::ArrayRCP<SC> newBj = newB->getDataNonConst(j);
65 for (LO i = 0; i < numElements; i++)
66 newBj[i] = Bj[i] - damping * newBj[i] / D[i];
69 newB = Get<RCP<MultiVector> >(currentLevel,
"Nullspace");
73 Set(currentLevel,
"Nullspace", newB);
static Scalar PowerMethod(const Matrix &A, bool scaleByDiag=true, LocalOrdinal niters=10, Magnitude tolerance=1e-2, bool verbose=false, unsigned int seed=123)
Power method.