Skip to content

Commit

Permalink
#210: formatting and consistency across examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 26, 2023
1 parent cf96b9e commit 9d82978
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions packages/belos/tpetra/example/BlockCG/BlockCGTpetraExFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#include "BelosLinearProblem.hpp"
#include "BelosTpetraAdapter.hpp"


template <typename ScalarType>
int run(int argc, char *argv[]) {

Expand Down Expand Up @@ -130,13 +129,13 @@ int run(int argc, char *argv[]) {
// Get the problem
RCP<tcrsmatrix_t> A;
Tpetra::Utils::readHBMatrix(filename,Comm,A);
RCP<const tmap_t> Map = A->getDomainMap();
RCP<const tmap_t> map = A->getDomainMap();

// Create initial vectors
RCP<MV> B, X;
X = rcp( new MV(Map,numrhs) );
X = rcp( new MV(map,numrhs) );
MVT::MvRandom( *X );
B = rcp( new MV(Map,numrhs) );
B = rcp( new MV(map,numrhs) );
OPT::Apply( *A, *X, *B );
MVT::MvInit( *X, 0.0 );

Expand Down Expand Up @@ -197,7 +196,7 @@ int run(int argc, char *argv[]) {
bool badRes = false;
std::vector<ST> actualResids( numrhs );
std::vector<ST> rhsNorm( numrhs );
MV resid(Map, numrhs);
MV resid(map, numrhs);
OPT::Apply( *A, *X, resid );
MVT::MvAddMv( -1.0, resid, 1.0, *B, resid );
MVT::MvNorm( resid, actualResids );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
#include "BelosBlockGmresSolMgr.hpp"
#include "BelosLinearProblem.hpp"


template <typename ScalarType>
int run(int argc, char *argv[]) {

Expand Down
8 changes: 4 additions & 4 deletions packages/belos/tpetra/example/RCG/RCGTpetraExFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ int run(int argc, char *argv[])
// Get the problem
RCP<tcrsmatrix_t> A;
Tpetra::Utils::readHBMatrix(filename, comm, A);
RCP<const tmap_t> rowMap = A->getDomainMap();
RCP<const tmap_t> map = A->getDomainMap();

proc_verbose = ( verbose && (MyPID==0) );

// Construct initial guess and right-hand sides
RCP<tmultivector_t> B, X;
X = rcp(new MV(rowMap, numrhs));
X = rcp(new MV(map, numrhs));
MVT::MvRandom(*X);
B = rcp(new MV( rowMap, numrhs));
B = rcp(new MV( map, numrhs));
OPT::Apply( *A, *X, *B );
MVT::MvInit( *X, 0.0 );

Expand Down Expand Up @@ -188,7 +188,7 @@ int run(int argc, char *argv[])
bool badRes = false;
std::vector<ST> actual_resids( numrhs );
std::vector<ST> rhs_norm( numrhs );
MV resid(rowMap, numrhs);
MV resid(map, numrhs);
OPT::Apply( *A, *X, resid );
MVT::MvAddMv( -1.0, resid, 1.0, *B, resid );
MVT::MvNorm( resid, actual_resids );
Expand Down

0 comments on commit 9d82978

Please sign in to comment.