10 #ifndef THYRA_DESCRIBE_LINEAR_OP_HPP
11 #define THYRA_DESCRIBE_LINEAR_OP_HPP
13 #include "Thyra_LinearOpBase.hpp"
14 #include "Thyra_MultiVectorBase.hpp"
15 #include "Thyra_VectorStdOps.hpp"
16 #include "Thyra_AssertOp.hpp"
17 #include "Thyra_AssertOp.hpp"
20 template<
class Scalar>
21 void Thyra::describeLinearOp(
22 const LinearOpBase<Scalar> &A,
32 RCP<FancyOStream> out =
rcp(&out_arg,
false);
34 *out << A.description() <<
"\n";
45 const Ordinal dimDomain = domain->dim(), dimRange = range->dim();
51 Array<Scalar> Md(dimRange*dimDomain);
57 for( j = 0; j < dimDomain; ++j ) {
58 Thyra::assign( e_j.
ptr(), DST::zero() );
59 Thyra::set_ele( j, DST::one(), e_j.
ptr() );
60 Thyra::apply<Scalar>(A,
NOTRANS, *e_j, t.
ptr());
61 t->acquireDetachedView(
Range1D(),&sv);
62 for( i = 0; i < dimRange; ++i ) Md[ i*cs + j*rs ] = sv(i);
63 t->releaseDetachedView(&sv);
66 for( i = 0; i < dimRange; ++i ) {
67 for( j = 0; j < dimDomain; ++j )
68 *out <<
" " << i <<
":" << j <<
":" << Md[ i + j*dimRange ];
80 #define THYRA_DESCRIBE_LINEAR_INSTANT(SCALAR) \
82 template void describeLinearOp( \
83 const LinearOpBase<SCALAR > &A, \
84 Teuchos::FancyOStream &out_arg, \
85 const Teuchos::EVerbosityLevel verbLevel \
90 #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.