Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue4258 remove teuchos sdmatrix inheritance #4259

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/anasazi/epetra/test/OrthoManager/cxx_gentest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ int main(int argc, char *argv[])
MyOM->stream(Warnings) << " ||<Y1,X1> - <X1,Y1>|| : " << err << endl;
// test s.p.d. of <Y1,X1>: try to compute a cholesky
lapack.POTRF('U',yTx1.numCols(),yTx1.values(),yTx1.stride(),&info);
TEUCHOS_TEST_FOR_EXCEPTION(info != 0,std::runtime_error,
"New <Y1,X1> not s.p.d.: couldn't computed Cholesky: info == " << info
<< "\nyTx1: \n" << yTx1);
std::ostringstream msg("New <Y1,X1> not s.p.d.: couldn't computed Cholesky: info == ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'd rather not build the std::ostringstream each time if we only use it when info is nonzero. How about this?

if (info != 0) {
  // build the std::ostringstream
  yTx1.print (msg);
  TEUCHOS_TEST_FOR_EXCEPTION(true, std::runtime_error, msg); 
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize now that the above code is in a test, so I'm less worried about it.

msg << info << "\nyTx1: \n";
yTx1.print(msg);
TEUCHOS_TEST_FOR_EXCEPTION(info != 0,std::runtime_error, msg.str());

// X2 ortho to Y1
MVT::MvRandom(*X2);
Expand Down Expand Up @@ -345,9 +346,10 @@ int main(int argc, char *argv[])
MyOM->stream(Warnings) << " ||<Y2,X2> - <X2,Y2>|| : " << err << endl;
// test s.p.d. of <Y2,X2>: try to compute a cholesky
lapack.POTRF('U',yTx2.numCols(),yTx2.values(),yTx2.stride(),&info);
TEUCHOS_TEST_FOR_EXCEPTION(info != 0,std::runtime_error,
"New <Y2,X2> not s.p.d.: couldn't computed Cholesky: info == " << info
<< "\nyTx2: \n" << yTx2);
msg.str("New <Y2,X2> not s.p.d.: couldn't computed Cholesky: info == ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the suggestion to implement the operator<< is exactly what Mike did in Dakota. If I added one for Teuchos::SerialDenseMatrix&, that would remove the need to touch the other Trilinos packages but in a way that has proven overly prescriptive for Dakota. Is there a more attractive approach, eg a virtual operator<< ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is there a way to add Mike (Eldred) as a watcher of this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhoope You could just do an @-mention of this GitHub account name here. That should notify him.

Copy link
Contributor

@mhoemmen mhoemmen Jan 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhoope wrote:

Is there a more attractive approach, e.g., a virtual operator<< ?

Is the issue that you would like Dakota to be able to override any existing print behavior of Teuchos::SerialDenseMatrix, but still be able to use operator<< everywhere?

It's hard to do that when using an operator. Argument-dependent lookup means that you can't use the same input types (std::ostream&, const SDM&) and still get a different operator<<. However, you could achieve this effect in Dakota with a little wrapper that changes SDM into a different type. This is analogous to "function advising" in some other languages. Here is an example:

// Implementation detail; not for users
template<class OrdinalType, class ScalarType>
struct SerialDenseMatrixOutputWrapper {
  const SerialDenseMatrix<OrdinalType, ScalarType>& A;
};

// this is for Dakota developers
template<class OrdinalType, class ScalarType>
SerialDenseMatrixOutputWrapper<OrdinalType, ScalarType>
wrapSDM (const SerialDenseMatrix<OrdinalType, ScalarType>& A)
{
  return {A};
}

// Dakota would define this
template<class OrdinalType, class ScalarType>
std::ostream& operator<< (std::ostream& out, const SerialDenseMatrixOutputWrapper<OrdinalType, ScalarType>& A)
{
  // ... print A however Dakota likes to print it ...
  return out;
}

You would use the class this way:

SerialDenseMatrix<int, double> A ( /* whatever goes here */ );
// ... do stuff with A ...

std::cout << wrapSDM (A) << std::endl;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mseldre wrote:

Simply dropping the inheritance from Object nicely accomplishes that, and we noticed your comments in the base about the need to deprecate and retire this legacy code.

I very much appreciate your contributions here -- thanks!

This clash was historical and may have been due to "using namespace Teuchos" pollution somewhere in the header dependencies -- not sure.

Argument-dependent lookup (ADL) would normally pick up Teuchos::operator<<, since it is in the same namespace as one of its arguments. ADL would not normally pick up an overloaded Dakota::operator<<, even inside code in the Dakota namespace. This is true even without using namespace Teuchos; etc.

So my recommendation would be to delete Object and allow Teuchos clients to provide their own customized insertion/extraction operators.

I'm OK with this personally, but it does break backwards compatibility for downstream applications. It's very likely that you won't be able to test all possible combinations of build options even within Trilinos, so this may break some Trilinos packages. It may also break downstream apps.

Trilinos hasn't had an official minor release (!) since 12.12, around three years ago (!!!). This means that all bets are off in terms of deprecation and removal policy. (Feel free to express your opinions about that to @maherou. I have no control over it.) Lack of policy mainly just means that you'll have to manage the angry-grams from various apps if their builds break. If you're OK with that, we can merge this and file a separate issue where you will be listed as the point of contact for explaining how to work around any build issues that arise. It's no big deal, but I just want to make sure we document why we did this, that it does break backwards compatibility, and how to fix it. Is that OK?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pointer about ADL -- that explains what I was observing and, IMO, also strengthens the argument for not providing these operators.

I can't speak to internal Trilinos policy for deprecation or release management, but seems there needs to be some mechanism to move forward. From the Dakota side, we would of course like to see our local changes to Teuchos propagate upstream so that users can build with either our version or their own custom version of Trilinos, with minimal/no inconsistencies. I am fine with delaying this patch until the appropriate time when deprecations can be announced and managed -- in the meantime, we can get by with our local version. In terms of being the POC for Trilinos angry-grams, yes if that's necessary in the short term.

On a semi-related note, I was also eyeing the CompObject data that appears to go unused by SerialDense*. I added some (redundant) protection around the computation of FLOP increments since the flop accumulator that accepts them seems to always be NULL based on ctor initializers. It would be easy to manage ctor paths with and without meaningful FLOP counters, but it seems to currently be an afterthought. Am I missing context?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mseldre Thanks for the reply! In brief, I would say, go for it! :-D (Ditto for the CompObject changes, though please in a separate PR :-) .) If you're OK with getting a few questions about how to fix build errors, I'll be happy to approve this PR.

Long answer: @ikalash, @rrdrake, @theguruat12, @micahahoward, @rppawlo, or @trilinos/framework may wish to chime in, but I would summarize the de facto "Trilinos versioning" policy for many internal applications as follows:

  1. App either forks Trilinos, or picks a Trilinos "master" branch commit.
  2. App defines its own acceptance testing for Trilinos.
  3. When an app wants to update its Trilinos, it uses acceptance tests to decide when to merge / pull. Many apps facilitate this by testing the app nightly against current master Trilinos.

This implies that apps define their own "Trilinos versions." Apps actually use this model. That, along with open access to Trilinos' repo on GitHub, likely explains the lack of enthusiasm for official Trilinos releases. I've gotten about as many complains about deprecation warnings ("hey, we can't build warning-free") as I've gotten about actual interface changes, so it's likely less effort just to break the build than it is to do an official deprecation (how long? who knows, since no official releases!).

What's missing from this model is a way for an app to work correctly with multiple Trilinos versions at once. A few packages have added this feature themselves. For example, Kokkos has a CMake option and macro to help manage deprecation. Tpetra just recently added one. It may make sense for Teuchos to add this as well, but Teuchos is a big utility package without a single focus, so it may be hard to enforce the deprecation model and decide when to remove deprecated stuff.

Anyway, I hope the long explanation helps!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. Approving the PR sounds good to me. Happy to help with suggestions/examples of supplying ostream insertion operators for Vector,Matrix,SymMatrix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed some mods to make GCC 7.3.0 happy.

msg << info << "\nyTx2: \n";
yTx2.print(msg);
TEUCHOS_TEST_FOR_EXCEPTION(info != 0,std::runtime_error, msg.str());
}
MyOM->stream(Warnings) << endl;

Expand Down
6 changes: 3 additions & 3 deletions packages/anasazi/epetra/test/OrthoManager/cxx_mattest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,13 @@ int testProjectAndNormalizeMat(RCP<MatOrthoManager<ST,MV,OP> > OM,
if (err > ATOL*TOL) {
sout << "S\n" << *S << endl;
sout << "S_out\n" << *S_outs[o] << endl;
sout << "B_out\n" << *B_outs[o] << endl;
sout << "B_out\n"; B_outs[o]->print(sout); sout << endl;
if (C_outs[o].size() > 0) {
sout << "X1\n" << *X1 << endl;
sout << "C_out[1]\n" << *C_outs[o][0] << endl;
sout << "C_out[1]\n"; C_outs[o][0]->print(sout); sout << endl;
if (C_outs[o].size() > 1) {
sout << "X22n" << *X2 << endl;
sout << "C_out[2]\n" << *C_outs[o][1] << endl;
sout << "C_out[2]\n"; C_outs[o][1]->print(sout); sout << endl;
}
}
}
Expand Down
25 changes: 15 additions & 10 deletions packages/anasazi/src/AnasaziBlockDavidsonSolMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,9 @@ BlockDavidsonSolMgr<ScalarType,MV,OP>::solve() {
# ifdef TEUCHOS_DEBUG
{
std::stringstream os;
os << "KK before HEEV...\n"
<< *state.KK << "\n";
os << "KK before HEEV...\n";
state.KK->print(os);
os << "\n";
*out << os.str();
}
# endif
Expand All @@ -695,8 +696,9 @@ BlockDavidsonSolMgr<ScalarType,MV,OP>::solve() {
std::stringstream os;
*out << "Ritz values from heev(KK):\n";
for (unsigned int i=0; i<theta.size(); i++) *out << theta[i] << " ";
os << "\nRitz vectors from heev(KK):\n"
<< S << "\n";
os << "\nRitz vectors from heev(KK):\n";
S.print(os);
os << "\n";
*out << os.str();
}
# endif
Expand All @@ -715,8 +717,9 @@ BlockDavidsonSolMgr<ScalarType,MV,OP>::solve() {
std::stringstream os;
*out << "Ritz values from heev(KK) after sorting:\n";
std::copy(theta.begin(), theta.end(), std::ostream_iterator<ScalarType>(*out, " "));
os << "\nRitz vectors from heev(KK) after sorting:\n"
<< S << "\n";
os << "\nRitz vectors from heev(KK) after sorting:\n";
S.print(os);
os << "\n";
*out << os.str();
}
# endif
Expand All @@ -726,8 +729,9 @@ BlockDavidsonSolMgr<ScalarType,MV,OP>::solve() {
# ifdef TEUCHOS_DEBUG
{
std::stringstream os;
os << "Significant primitive Ritz vectors:\n"
<< Sr << "\n";
os << "Significant primitive Ritz vectors:\n";
Sr.print(os);
os << "\n";
*out << os.str();
}
# endif
Expand Down Expand Up @@ -756,8 +760,9 @@ BlockDavidsonSolMgr<ScalarType,MV,OP>::solve() {
# ifdef TEUCHOS_DEBUG
{
std::stringstream os;
os << "Sr'*KK*Sr:\n"
<< newKK << "\n";
os << "Sr'*KK*Sr:\n";
newKK.print(os);
os << "\n";
*out << os.str();
}
# endif
Expand Down
6 changes: 3 additions & 3 deletions packages/anasazi/src/AnasaziIRTR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,15 +889,15 @@ namespace Anasazi {
MVT::MvTransMv(ONE,*this->delta_,*this->Adelta_,AA);
MVT::MvTransMv(ONE,*this->delta_,*this->Bdelta_,BB);
}
this->om_->stream(Debug) << "AA: " << std::endl << AA << std::endl;;
this->om_->stream(Debug) << "BB: " << std::endl << BB << std::endl;;
this->om_->stream(Debug) << "AA: " << std::endl; AA.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;
this->om_->stream(Debug) << "BB: " << std::endl; BB.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;
{
#ifdef ANASAZI_TEUCHOS_TIME_MONITOR
TimeMonitor lcltimer( *this->timerDS_ );
#endif
ret = Utils::directSolver(AA.numRows(),AA,Teuchos::rcpFromRef(BB),S,newtheta,rank,1);
}
this->om_->stream(Debug) << "S: " << std::endl << S << std::endl;;
this->om_->stream(Debug) << "S: " << std::endl; S.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;
TEUCHOS_TEST_FOR_EXCEPTION(ret != 0,std::logic_error,"Anasazi::IRTR::iterate(): failure solving projected eigenproblem after retraction. ret == " << ret);
TEUCHOS_TEST_FOR_EXCEPTION(rank != AA.numRows(),RTRRitzFailure,"Anasazi::IRTR::iterate(): retracted iterate failed in Ritz analysis. rank == " << rank);

Expand Down
11 changes: 7 additions & 4 deletions packages/anasazi/src/AnasaziSIRTR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,8 @@ namespace Anasazi {
#endif
MVT::MvTransMv(ONE,*XpEta,*XpEta,BB);
}
this->om_->stream(Debug) << "AA: " << std::endl << AA << std::endl;;
this->om_->stream(Debug) << "BB: " << std::endl << BB << std::endl;;
this->om_->stream(Debug) << "AA: " << std::endl; AA.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;
this->om_->stream(Debug) << "BB: " << std::endl; BB.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;
// do the direct solve
// save old theta first
std::vector<MagnitudeType> oldtheta(this->theta_);
Expand All @@ -936,8 +936,11 @@ namespace Anasazi {
#endif
ret = Utils::directSolver(this->blockSize_,AA,Teuchos::rcpFromRef(BB),S,this->theta_,rank,1);
}
this->om_->stream(Debug) << "S: " << std::endl << S << std::endl;;
TEUCHOS_TEST_FOR_EXCEPTION(ret != 0,std::logic_error,"Anasazi::SIRTR::iterate(): failure solving projected eigenproblem after retraction. ret == " << ret << "AA: " << AA << std::endl << "BB: " << BB << std::endl);
this->om_->stream(Debug) << "S: " << std::endl; S.print(this->om_->stream(Debug)); this->om_->stream(Debug) << std::endl;;
std::ostringstream msg("Anasazi::SIRTR::iterate(): failure solving projected eigenproblem after retraction. ret == ");
msg << ret << "AA: "; AA.print(msg);
msg << std::endl << "BB: "; BB.print(msg); msg << std::endl;
TEUCHOS_TEST_FOR_EXCEPTION(ret != 0,std::logic_error, msg.str());
TEUCHOS_TEST_FOR_EXCEPTION(rank != this->blockSize_,RTRRitzFailure,"Anasazi::SIRTR::iterate(): retracted iterate failed in Ritz analysis. rank == " << rank);

//
Expand Down
4 changes: 2 additions & 2 deletions packages/belos/src/BelosLSQRIter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,13 @@ class LSQRIter : virtual public Belos::Iteration<ScalarType,MV,OP> {
// 2. confirm that U is a unit vector
Teuchos::SerialDenseMatrix<int,ScalarType> uotuo(1,1);
MVT::MvTransMv( one, *U_, *U_, uotuo );
std::cout << "<U, U> = " << uotuo << std::endl;
std::cout << "<U, U> = "; uotuo.print(std::cout); std::cout << std::endl;
// 3. print alpha = <V, A'U>
std::cout << "alpha = " << alpha[0] << std::endl;
// 4. compute < AV, U> which ought to be alpha
Teuchos::SerialDenseMatrix<int,ScalarType> utav(1,1);
MVT::MvTransMv( one, *AV, *U_, utav );
std::cout << "<AV, U> = alpha = " << utav << std::endl;
std::cout << "<AV, U> = alpha = "; utav.print(std::cout); std::cout << std::endl;
}

MVT::MvAddMv( one, *AV, -alpha[0], *U_, *U_ ); // uNew := Av - uOld alphaOld
Expand Down
8 changes: 4 additions & 4 deletions packages/rol/adapters/teuchos/test/function/test_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ int main( int argc, char *argv[] ) {
}
}

*outStream << "\nA = " << *A;
*outStream << "\nb = " << *b;
*outStream << "\nC = " << *C;
*outStream << "\nd = " << *d;
*outStream << "\nA = "; A->print(*outStream);
*outStream << "\nb = "; b->print(*outStream);
*outStream << "\nC = "; C->print(*outStream);
*outStream << "\nd = "; d->print(*outStream);


auto x = rcp( new Vector{Nopt,1} );
Expand Down
4 changes: 2 additions & 2 deletions packages/rol/example/dense-hessian/example_01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ int main(int argc, char *argv[]) {
// Compute dense Hessian.
Teuchos::SerialDenseMatrix<int, RealT> H = ROL::computeDenseHessian(obj, x);
Teuchos::SerialDenseMatrix<int, RealT> H_scaled = ROL::computeScaledDenseHessian(obj, x);
*outStream << H;
*outStream << H_scaled;
H.print(*outStream);
H_scaled.print(*outStream);

// Compute Hessian error.
Teuchos::SerialDenseMatrix<int, RealT> H_true(2, 2);
Expand Down
6 changes: 3 additions & 3 deletions packages/rythmos/src/Rythmos_ExplicitRKStepper_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ void ExplicitRKStepper<Scalar>::describe(
}
out << "ktemp_vector = " << std::endl;
out << Teuchos::describe(*ktemp_vector_,verbLevel);
out << "ERK Butcher Tableau A matrix: " << erkButcherTableau_->A() << std::endl;
out << "ERK Butcher Tableau b vector: " << erkButcherTableau_->b() << std::endl;
out << "ERK Butcher Tableau c vector: " << erkButcherTableau_->c() << std::endl;
out << "ERK Butcher Tableau A matrix: "; erkButcherTableau_->A().print(out); out << std::endl;
out << "ERK Butcher Tableau b vector: "; erkButcherTableau_->b().print(out); out << std::endl;
out << "ERK Butcher Tableau c vector: "; erkButcherTableau_->c().print(out); out << std::endl;
out << "t = " << t_ << std::endl;
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/rythmos/src/Rythmos_RKButcherTableau.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ class RKButcherTableauDefaultBase :
out << this->description() << std::endl;
out << this->getMyDescription() << std::endl;
out << "number of Stages = " << this->numStages() << std::endl;
out << "A = " << this->A() << std::endl;
out << "b = " << this->b() << std::endl;
out << "c = " << this->c() << std::endl;
out << "A = "; this->A().print(out); out << std::endl;
out << "b = "; this->b().print(out); out << std::endl;
out << "c = "; this->c().print(out); out << std::endl;
out << "order = " << this->order() << std::endl;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ print(std::ostream& os) const
{
os << "Gram-Schmidt basis of order " << p << ", dimension " << d
<< ", and size " << sz << ". Matrix coefficients:\n";
os << Qp << std::endl;
Qp.print(os); os << std::endl;
os << "Basis vector norms (squared):\n\t";
for (ordinal_type i=0; i<sz; i++)
os << norms[i] << " ";
Expand Down
2 changes: 1 addition & 1 deletion packages/stokhos/src/Stokhos_GramSchmidtBasisImp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ print(std::ostream& os) const
{
os << "Gram-Schmidt basis of order " << p << ", dimension " << d
<< ", and size " << sz << ". Matrix coefficients:\n";
os << gs_mat << std::endl;
gs_mat.print(os); os << std::endl;
os << "Basis vector norms (squared):\n\t";
for (ordinal_type i=0; i<sz; i++)
os << norms[i] << " ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ print(std::ostream& os) const
{
os << "Gram-Schmidt basis of order " << p << ", dimension " << d
<< ", and size " << sz << ". Matrix coefficients:\n";
os << Qp << std::endl;
Qp.print(os); os << std::endl;
os << "Basis vector norms (squared):\n\t";
for (ordinal_type i=0; i<sz; i++)
os << norms[i] << " ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ print(std::ostream& os) const
os << "Product Lanczos Gram-Schmidt basis of order " << p << ", dimension "
<< d
<< ", and size " << sz << ". Matrix coefficients:\n";
os << Qp << std::endl;
Qp.print(os); os << std::endl;
os << "Basis vector norms (squared):\n\t";
for (ordinal_type i=0; i<sz; i++)
os << norms[i] << " ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ namespace GramSchmidtTest {
if (!success) {
out << "\n Error, mat.normInf() < tol = " << mat.normInf()
<< " < " << tol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace HermiteBasisUnitTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ namespace BASENAME ## TAG { \
if (!success) { \
out << "\n Error, mat.normInf() < atol = " << mat.normInf() \
<< " < " << setup.atol << ": failed!\n"; \
out << "mat = " << mat << std::endl; \
out << "mat = "; mat.print(out); out << std::endl; \
} \
} \
\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace LegendreBasisUnitTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace HermiteBasisUnitTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace LegendreBasisUnitTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace StieltjesCosTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down Expand Up @@ -285,7 +285,7 @@ namespace StieltjesSinTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down Expand Up @@ -368,7 +368,7 @@ namespace StieltjesExpTest {
if (!success) {
out << "\n Error, mat.normInf() < atol = " << mat.normInf()
<< " < " << setup.atol << ": failed!\n";
out << "mat = " << mat << std::endl;
out << "mat = "; mat.print(out); out << std::endl;
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/tempus/src/Tempus_RKButcherTableau.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ class RKButcherTableau :
out << this->description() << std::endl;
out << this->getDescription() << std::endl;
out << "number of Stages = " << this->numStages() << std::endl;
out << "A = " << this->A() << std::endl;
out << "b = " << this->b() << std::endl;
out << "c = " << this->c() << std::endl;
out << "bstar = " << this->bstar() << std::endl;
out << "A = "; this->A().print(out); out << std::endl;
out << "b = "; this->b().print(out); out << std::endl;
out << "c = "; this->c().print(out); out << std::endl;
out << "bstar = "; this->bstar().print(out); out << std::endl;
out << "order = " << this->order() << std::endl;
out << "orderMin = " << this->orderMin() << std::endl;
out << "orderMax = " << this->orderMax() << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions packages/teuchos/numerics/example/DenseMatrix/cxx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ int main(int argc, char* argv[])
std::cout << "Teuchos::SerialDenseSolver::solve() returned : " << info << std::endl;

// A matrix can be sent to the output stream:
std::cout<< std::endl << My_Matrix << std::endl;
std::cout<< X << std::endl;
std::cout<< std::endl; My_Matrix.print(std::cout); std::cout << std::endl;
std::cout; X.print(std::cout); std::cout << std::endl;

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ int main(int argc, char* argv[])
Teuchos::symMatTripleProduct<int,double>( Teuchos::TRANS, alpha, A2, W, C2 );

// A matrix can be sent to the output stream:
std::cout<< My_Matrix << std::endl;
std::cout<< X << std::endl;
std::cout<< std::endl; My_Matrix.print(std::cout); std::cout << std::endl;
std::cout; X.print(std::cout); std::cout << std::endl;

return 0;
}
2 changes: 1 addition & 1 deletion packages/teuchos/numerics/example/LAPACK/cxx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int main(int argc, char* argv[])
ipiv, My_Vector.values(), My_Vector.stride(), &info );

// Print out the solution.
std::cout << My_Vector << std::endl;
My_Vector.print(std::cout); std::cout << std::endl;

return 0;
}
Loading