Skip to content
Snippets Groups Projects
Commit 5d191424 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Add mtv() method

[[Imported from SVN: r1128]]
parent 5d397e50
No related branches found
No related tags found
No related merge requests found
......@@ -1026,6 +1026,19 @@ namespace Dune {
}
}
//! y = A^T x
template<class X, class Y>
void mtv (const X& x, Y& y) const
{
#ifdef DUNE_ISTL_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(ISTLError,"index out of range");
if (y.N()!=M()) DUNE_THROW(ISTLError,"index out of range");
#endif
for(int i=0; i<y.N(); ++i)
y[i]=0;
umtv(x,y);
}
//! y += A^T x
template<class X, class Y>
void umtv (const X& x, Y& y) const
......
......@@ -228,6 +228,13 @@ namespace Dune {
y[i] = diag_[i] * x[i];
}
//! y = A^T x
template<class X, class Y>
void mtv (const X& x, Y& y) const
{
mv(x, y);
}
//! y += A x
template<class X, class Y>
void umv (const X& x, Y& y) const
......
......@@ -347,6 +347,20 @@ namespace Dune {
}
}
//! y = A^T x
template<class X, class Y>
void mtv (const X& x, Y& y) const
{
#ifdef DUNE_ISTL_WITH_CHECKING
if (x.N()!=N()) DUNE_THROW(ISTLError,"index out of range");
if (y.N()!=M()) DUNE_THROW(ISTLError,"index out of range");
#endif
for(int i=0; i<y.N(); ++i)
y[i]=0;
umtv(x,y);
}
//! y += A x
template <class X, class Y>
void umv(const X& x, Y& y) const
......
......@@ -208,6 +208,13 @@ namespace Dune {
y[i] = p_ * x[i];
}
//! y = A^T x
template<class X, class Y>
void mtv (const X& x, Y& y) const
{
mv(x, y);
}
//! y += A x
template<class X, class Y>
void umv (const X& x, Y& y) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment