// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
class SparsityPattern;
template <typename number> class FullMatrix;
template <typename number> class SparseMatrix;
+template <class VECTOR> class VectorSlice;
+
class CompressedSparsityPattern;
*/
SparsityPattern (const unsigned int m,
const unsigned int n,
- const std::vector<unsigned int> &row_lengths,
+ const std::vector<unsigned int>& row_lengths,
const bool optimize_diagonal = true);
/**
* see optimize_diagonal().
*/
SparsityPattern (const unsigned int m,
- const std::vector<unsigned int> &row_lengths,
+ const std::vector<unsigned int>& row_lengths,
const bool optimize_diagonal = true);
/**
* optimized access in relaxation
* methods of SparseMatrix.
*/
+ void reinit (const unsigned int m,
+ const unsigned int n,
+ const VectorSlice<const std::vector<unsigned int> > &row_lengths,
+ const bool optimize_diagonal = true);
+
+ /**
+ * Wrapper since the conversion
+ * of std::vector to const
+ * VectorSlice does not work.
+ */
void reinit (const unsigned int m,
const unsigned int n,
const std::vector<unsigned int> &row_lengths,
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
//
//---------------------------------------------------------------------------
-
+#include <base/vector_slice.h>
#include <lac/sparsity_pattern.h>
#include <lac/full_matrix.h>
#include <lac/compressed_sparsity_pattern.h>
-SparsityPattern::SparsityPattern (const unsigned int m,
- const unsigned int n,
- const std::vector<unsigned int> &row_lengths,
- const bool optimize_diag)
+SparsityPattern::SparsityPattern (
+ const unsigned int m,
+ const unsigned int n,
+ const std::vector<unsigned int>& row_lengths,
+ const bool optimize_diag)
:
max_dim(0),
max_vec_len(0),
-SparsityPattern::SparsityPattern (const unsigned int m,
- const std::vector<unsigned int> &row_lengths,
- const bool optimize_diag)
+SparsityPattern::SparsityPattern (
+ const unsigned int m,
+ const std::vector<unsigned int>& row_lengths,
+ const bool optimize_diag)
:
max_dim(0),
max_vec_len(0),
void
-SparsityPattern::reinit (const unsigned int m,
- const unsigned int n,
- const std::vector<unsigned int> &row_lengths,
- const bool optimize_diag)
+SparsityPattern::reinit (
+ const unsigned int m,
+ const unsigned int n,
+ const VectorSlice<const std::vector<unsigned int> >&row_lengths,
+ const bool optimize_diag)
{
Assert (row_lengths.size() == m, ExcInvalidNumber (m));
}
+void
+SparsityPattern::reinit (
+ const unsigned int m,
+ const unsigned int n,
+ const std::vector<unsigned int>& row_lengths,
+ const bool optimize_diag)
+{
+ reinit(m, n, make_slice(row_lengths), optimize_diag);
+}
+
+
bool
SparsityPattern::empty () const