const Vector<TYPE2> &,
TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::precondition_TSOR (Vector<TYPE2> &,
+ const Vector<TYPE2> &,
+ TYPEMAT) const;
+
template void SparseMatrix<TYPEMAT>::precondition_Jacobi (Vector<TYPE2> &,
const Vector<TYPE2> &,
TYPEMAT) const;
template void SparseMatrix<TYPEMAT>::SOR (Vector<TYPE2> &, TYPEMAT) const;
+template void SparseMatrix<TYPEMAT>::TSOR (Vector<TYPE2> &, TYPEMAT) const;
template void SparseMatrix<TYPEMAT>::SSOR (Vector<TYPE2> &, TYPEMAT) const;
template void SparseMatrix<TYPEMAT>::SOR_step (Vector<TYPE2> &, const Vector<TYPE2> &, TYPEMAT) const;
template void SparseMatrix<TYPEMAT>::TSOR_step (Vector<TYPE2> &, const Vector<TYPE2> &, TYPEMAT) const;
const Vector<somenumber> &src,
const number om = 1.) const;
+ /**
+ * Apply transpose SOR preconditioning matrix to @p{src}.
+ * The result of this method is
+ * $dst = (om D - U)^{-1} src$.
+ */
+ template <typename somenumber>
+ void precondition_TSOR (Vector<somenumber> &dst,
+ const Vector<somenumber> &src,
+ const number om = 1.) const;
+
/**
* Perform SSOR preconditioning
* in-place. Apply the
*/
template <typename somenumber>
void SOR (Vector<somenumber> &v,
+ const number om = 1.) const;
+
+ /**
+ * Perform a transpose SOR preconditioning in-place.
+ * The result is $v = (\omega D - L)^{-1} v$.
+ * @p{omega} is the damping parameter.
+ */
+ template <typename somenumber>
+ void TSOR (Vector<somenumber> &v,
const number om = 1.) const;
/**
};
+template <typename number>
+template <typename somenumber>
+void
+SparseMatrix<number>::precondition_TSOR (Vector<somenumber>& dst, const Vector<somenumber>& src,
+ const number om) const
+{
+ Assert (cols != 0, ExcMatrixNotInitialized());
+ Assert (val != 0, ExcMatrixNotInitialized());
+ Assert (m() == n(), ExcMatrixNotSquare());
+
+ dst = src;
+ TSOR(dst,om);
+};
+
+
template <typename number>
template <typename somenumber>
void
}
+template <typename number>
+template <typename somenumber>
+void
+SparseMatrix<number>::TSOR (Vector<somenumber>& dst, const number om) const
+{
+ Assert (cols != 0, ExcMatrixNotInitialized());
+ Assert (val != 0, ExcMatrixNotInitialized());
+ Assert (m() == n(), ExcMatrixNotSquare());
+ Assert (m() == dst.size(), ExcDimensionsDontMatch(m(),dst.size()));
+
+ for (unsigned int row=m(); row!=0;)
+ {
+ --row;
+ somenumber s = dst(row);
+ for (unsigned int j=cols->rowstart[row]; j<cols->rowstart[row+1]; ++j)
+ if (cols->colnums[j] > row)
+ s -= val[j] * dst(cols->colnums[j]);
+
+ dst(row) = s * om / val[cols->rowstart[row]];
+ }
+}
+
+
template <typename number>
template <typename somenumber>
void