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"
20void Thyra::describeLinearOp(
21 const LinearOpBase<Scalar> &A,
31 RCP<FancyOStream> out =
rcp(&out_arg,
false);
33 *out << A.description() <<
"\n";
44 const Ordinal dimDomain = domain->dim(), dimRange = range->dim();
50 Array<Scalar> Md(dimRange*dimDomain);
56 for( j = 0; j < dimDomain; ++j ) {
57 Thyra::assign( e_j.
ptr(), DST::zero() );
58 Thyra::set_ele( j, DST::one(), e_j.
ptr() );
59 Thyra::apply<Scalar>(A, NOTRANS, *e_j, t.
ptr());
60 t->acquireDetachedView(
Range1D(),&sv);
61 for( i = 0; i < dimRange; ++i ) Md[ i*cs + j*rs ] = sv(i);
62 t->releaseDetachedView(&sv);
65 for( i = 0; i < dimRange; ++i ) {
66 for( j = 0; j < dimDomain; ++j )
67 *out <<
" " << i <<
":" << j <<
":" << Md[ i + j*dimRange ];
79#define THYRA_DESCRIBE_LINEAR_INSTANT(SCALAR) \
81 template void describeLinearOp( \
82 const LinearOpBase<SCALAR > &A, \
83 Teuchos::FancyOStream &out_arg, \
84 const Teuchos::EVerbosityLevel verbLevel \
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
basic_OSTab< char > OSTab
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)