*
* @author Guido Kanschat, Franz-Theo Suttmeier, Wolfgang Bangerth, 1993-2004
*/
-template<typename number>
+template <typename number>
class FullMatrix : public Table<2,number>
{
public:
/**
- * Declare type of container size.
+ * A type of used to index into this container. Because we can not
+ * expect to store matrices bigger than what can be indexed by a regular
+ * unsigned integer, <code>unsigned int</code> is completely sufficient
+ * as an index type.
*/
- // A FullMatrix will never require to use unsigned long long int instead of
- // unsigned but because a ConstraintMatrix can be a SparseMatrix or a
- // FullMatrix, we need have the same interface.
- typedef types::global_dof_index size_type;
+ typedef unsigned int size_type;
/**
* Type of matrix entries. In analogy to
/**
* Variable assignment operator.
*/
- template<typename number2>
+ template <typename number2>
FullMatrix<number> &
operator = (const FullMatrix<number2> &);
*/
template <typename MatrixType>
void extract_submatrix_from (const MatrixType &matrix,
- const std::vector<size_type> &row_index_set,
- const std::vector<size_type> &column_index_set);
+ const std::vector<typename MatrixType::size_type> &row_index_set,
+ const std::vector<typename MatrixType::size_type> &column_index_set);
/**
* Copy the elements of the current matrix object into a specified
* determined either by the size
* of <tt>this</tt> or <tt>src</tt>.
*/
- template<typename number2>
+ template <typename number2>
void fill (const FullMatrix<number2> &src,
const size_type dst_offset_i = 0,
const size_type dst_offset_j = 0,
* Make function of base class
* available.
*/
- template<typename number2>
+ template <typename number2>
void fill (const number2 *);
/**
* possible to duplicate rows or
* columns by this method.
*/
- template<typename number2>
+ template <typename number2>
void fill_permutation (const FullMatrix<number2> &src,
const std::vector<size_type> &p_rows,
const std::vector<size_type> &p_cols);
* complex-valued, but not mixed, for
* this function to make sense.
*/
- template<typename number2>
+ template <typename number2>
number2 matrix_norm_square (const Vector<number2> &v) const;
/**
* complex-valued, but not mixed, for
* this function to make sense.
*/
- template<typename number2>
+ template <typename number2>
number2 matrix_scalar_product (const Vector<number2> &u,
const Vector<number2> &v) const;
* convertible to the data type
* of this matrix.
*/
- template<typename number2>
+ template <typename number2>
void add (const number a,
const FullMatrix<number2> &A);
* convertible to the data type
* of this matrix.
*/
- template<typename number2>
+ template <typename number2>
void add (const number a,
const FullMatrix<number2> &A,
const number b,
* is convertible to the data
* type of this matrix.
*/
- template<typename number2>
+ template <typename number2>
void add (const number a,
const FullMatrix<number2> &A,
const number b,
* size of <tt>this</tt> or <tt>src</tt>
* and the given offsets.
*/
- template<typename number2>
+ template <typename number2>
void add (const FullMatrix<number2> &src,
const number factor,
const size_type dst_offset_i = 0,
*
* <i>A += s B<sup>T</sup></i>
*/
- template<typename number2>
+ template <typename number2>
void Tadd (const number s,
const FullMatrix<number2> &B);
* of <tt>this</tt> or
* <tt>src</tt>.
*/
- template<typename number2>
+ template <typename number2>
void Tadd (const FullMatrix<number2> &src,
const number factor,
const size_type dst_offset_i = 0,
* and are indeed ignored in the
* implementation.
*/
- template <typename number2>
+ template <typename number2, typename index_type>
void add (const size_type row,
- const size_type n_cols,
- const size_type *col_indices,
+ const unsigned int n_cols,
+ const index_type *col_indices,
const number2 *values,
const bool elide_zero_values = true,
const bool col_indices_are_sorted = false);
* Assignment <tt>*this =
* a*A</tt>.
*/
- template<typename number2>
+ template <typename number2>
void equ (const number a,
const FullMatrix<number2> &A);
* Assignment <tt>*this = a*A +
* b*B</tt>.
*/
- template<typename number2>
+ template <typename number2>
void equ (const number a,
const FullMatrix<number2> &A,
const number b,
* Assignment <tt>*this = a*A +
* b*B + c*C</tt>.
*/
- template<typename number2>
+ template <typename number2>
void equ (const number a,
const FullMatrix<number2> &A,
const number b,
* usually results in considerable
* performance gains.
*/
- template<typename number2>
+ template <typename number2>
void mmult (FullMatrix<number2> &C,
const FullMatrix<number2> &B,
const bool adding=false) const;
* BLAS usually results in considerable
* performance gains.
*/
- template<typename number2>
+ template <typename number2>
void Tmmult (FullMatrix<number2> &C,
const FullMatrix<number2> &B,
const bool adding=false) const;
* usually results in considerable
* performance gains.
*/
- template<typename number2>
+ template <typename number2>
void mTmult (FullMatrix<number2> &C,
const FullMatrix<number2> &B,
const bool adding=false) const;
* BLAS usually results in considerable
* performance gains.
*/
- template<typename number2>
+ template <typename number2>
void TmTmult (FullMatrix<number2> &C,
const FullMatrix<number2> &B,
const bool adding=false) const;
* Source and destination must
* not be the same vector.
*/
- template<typename number2>
+ template <typename number2>
void vmult (Vector<number2> &w,
const Vector<number2> &v,
const bool adding=false) const;
* Source and destination must
* not be the same vector.
*/
- template<typename number2>
+ template <typename number2>
void vmult_add (Vector<number2> &w,
const Vector<number2> &v) const;
* Source and destination must
* not be the same vector.
*/
- template<typename number2>
+ template <typename number2>
void Tvmult (Vector<number2> &w,
const Vector<number2> &v,
const bool adding=false) const;
* Source and destination must
* not be the same vector.
*/
- template<typename number2>
+ template <typename number2>
void Tvmult_add (Vector<number2> &w,
const Vector<number2> &v) const;
* <i>dst</i> must not be the same
* vector.
*/
- template<typename number2, typename number3>
+ template <typename number2, typename number3>
number residual (Vector<number2> &dst,
const Vector<number2> &x,
const Vector<number3> &b) const;
* same object for @p dst and @p
* src.
*/
- template<typename number2>
+ template <typename number2>
void forward (Vector<number2> &dst,
const Vector<number2> &src) const;
* same object for @p dst and @p
* src.
*/
- template<typename number2>
+ template <typename number2>
void backward (Vector<number2> &dst,
const Vector<number2> &src) const;
inline
void
FullMatrix<number>::extract_submatrix_from (const MatrixType &matrix,
- const std::vector<size_type> &row_index_set,
- const std::vector<size_type> &column_index_set)
+ const std::vector<typename MatrixType::size_type> &row_index_set,
+ const std::vector<typename MatrixType::size_type> &column_index_set)
{
AssertDimension(row_index_set.size(), this->n_rows());
AssertDimension(column_index_set.size(), this->n_cols());
template <typename number>
-template<typename number2>
+template <typename number2>
void
FullMatrix<number>::vmult_add (Vector<number2> &w,
const Vector<number2> &v) const
template <typename number>
-template<typename number2>
+template <typename number2>
void
FullMatrix<number>::Tvmult_add (Vector<number2> &w,
const Vector<number2> &v) const
template <typename number>
-template <typename number2>
+template <typename number2, typename index_type>
inline
void
-FullMatrix<number>::add (const size_type row,
- const size_type n_cols,
- const size_type *col_indices,
- const number2 *values,
+FullMatrix<number>::add (const size_type row,
+ const unsigned int n_cols,
+ const index_type *col_indices,
+ const number2 *values,
const bool,
const bool)
{
template
void FullMatrix<S1>::fill<S2> (
- const FullMatrix<S2>&, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, size_type, size_type, size_type, size_type);
template
void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
template
const S1, const FullMatrix<S2>&);
template
void FullMatrix<S1>::add<S2> (
- const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, S1, size_type, size_type, size_type, size_type);
template
void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
template
void FullMatrix<S1>::Tadd<S2> (
- const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, S1, size_type, size_type, size_type, size_type);
template
void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
template
{
template
void FullMatrix<S1>::fill<S2> (
- const FullMatrix<S2>&, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, size_type, size_type, size_type, size_type);
template
void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
template
const S1, const FullMatrix<S2>&);
template
void FullMatrix<S1>::add<S2> (
- const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index, types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, S1, size_type, size_type, size_type, size_type);
template
void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
template
void FullMatrix<S1>::Tadd<S2> (
- const FullMatrix<S2>&, S1, types::global_dof_index, types::global_dof_index,
- types::global_dof_index, types::global_dof_index);
+ const FullMatrix<S2>&, S1, size_type, size_type,
+ size_type, size_type);
template
void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
template