42 #ifndef THYRA_DESCRIBE_LINEAR_OP_HPP
43 #define THYRA_DESCRIBE_LINEAR_OP_HPP
45 #include "Thyra_describeLinearOp_def.hpp"
46 #include "Thyra_LinearOpBase.hpp"
47 #include "Thyra_MultiVectorBase.hpp"
48 #include "Thyra_VectorStdOps.hpp"
49 #include "Thyra_AssertOp.hpp"
50 #include "Thyra_AssertOp.hpp"
53 template<
class Scalar>
54 void Thyra::describeLinearOp(
55 const LinearOpBase<Scalar> &A,
65 RCP<FancyOStream> out =
rcp(&out_arg,
false);
67 *out << A.description() <<
"\n";
78 const Ordinal dimDomain = domain->dim(), dimRange = range->dim();
84 Array<Scalar> Md(dimRange*dimDomain);
90 for( j = 0; j < dimDomain; ++j ) {
91 Thyra::assign( e_j.
ptr(), DST::zero() );
92 Thyra::set_ele( j, DST::one(), e_j.
ptr() );
93 Thyra::apply<Scalar>(A,
NOTRANS, *e_j, t.
ptr());
94 t->acquireDetachedView(
Range1D(),&sv);
95 for( i = 0; i < dimRange; ++i ) Md[ i*cs + j*rs ] = sv(i);
96 t->releaseDetachedView(&sv);
99 for( i = 0; i < dimRange; ++i ) {
100 for( j = 0; j < dimDomain; ++j )
101 *out <<
" " << i <<
":" << j <<
":" << Md[ i + j*dimRange ];
113 #define THYRA_DESCRIBE_LINEAR_INSTANT(SCALAR) \
115 template void describeLinearOp( \
116 const LinearOpBase<SCALAR > &A, \
117 Teuchos::FancyOStream &out_arg, \
118 const Teuchos::EVerbosityLevel verbLevel \
123 #endif // THYRA_DESCRIBE_LINEAR_OP_HPP
basic_OSTab< char > OSTab
basic_FancyOStream< char > FancyOStream
Use the non-transposed operator.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
RCP< VectorBase< Scalar > > createMember(const RCP< const VectorSpaceBase< Scalar > > &vs, const std::string &label="")
Create a vector member from the vector space.