@cd $D/common ; etags $D/base/source/*.cc \
$D/lac/source/*.cc $D/deal.II/source/*/*.cc \
$D/tests/*/*.cc $D/examples/*/*.cc \
- --language=none --regex='/.*/' \
+ --language=c++ \
$D/base/include/*/*.h $D/lac/include/*/*.h \
$D/deal.II/include/*/*.h $D/tests/*/*.h; \
perl -pi -e 's/ \* .*//g; s&[\t]*/\*.*&&g; s&[\t]*\*/.*&&g;' TAGS
// further information on this license.
//
//---------------------------------------------------------------------
-#ifndef __deal2__slice_vector_h
-#define __deal2__slice_vector_h
+#ifndef __deal2__vector_slice_h
+#define __deal2__vector_slice_h
#include <base/config.h>
#include <base/exceptions.h>
* every index.
*
* Some precautions have to be taken if it is used for a constant
- * vector: the SliceVector object has to be constant, too. The
+ * vector: the VectorSlice object has to be constant, too. The
* appropriate initalization sequence is like this:
*
* @code
* void f(const std::vector<int>& v)
* {
- * const SliceVector slice(v,...);
+ * const VectorSlice slice(v,...);
* ...
* }
* @endcode
* @author Guido Kanschat, 2004
*/
template <class VECTOR>
-class SliceVector
+class VectorSlice
{
public:
- SliceVector(VECTOR& v);
- SliceVector(VECTOR& v,
+ VectorSlice(VECTOR& v);
+ VectorSlice(VECTOR& v,
unsigned int start,
unsigned int length);
* Helper function for creating temporary objects without typing
* template arguments.
*
- * @relates SliceVector
+ * @relates VectorSlice
* @author Guido Kanschat, 2004
*/
template <class VECTOR>
inline
-const SliceVector<VECTOR>
+const VectorSlice<VECTOR>
make_slice (VECTOR& v)
{
- const SliceVector<VECTOR> r(v);
+ const VectorSlice<VECTOR> r(v);
return r;
}
* Helper function for creating temporary objects without typing
* template arguments.
*
- * @relates SliceVector
+ * @relates VectorSlice
* @author Guido Kanschat, 2004
*/
template <class VECTOR>
inline
-const SliceVector<VECTOR>
+const VectorSlice<VECTOR>
make_slice (VECTOR& v, unsigned int start, unsigned int length)
{
- const SliceVector<VECTOR> r(v, start, length);
+ const VectorSlice<VECTOR> r(v, start, length);
return r;
}
template <class VECTOR>
inline
-SliceVector<VECTOR>::SliceVector(VECTOR& v)
+VectorSlice<VECTOR>::VectorSlice(VECTOR& v)
: v(v), start(0), length(v.size())
{}
template <class VECTOR>
inline
-SliceVector<VECTOR>::SliceVector(VECTOR& v,
+VectorSlice<VECTOR>::VectorSlice(VECTOR& v,
unsigned int start,
unsigned int length)
: v(v), start(start), length(length)
template <class VECTOR>
inline
unsigned int
-SliceVector<VECTOR>::size() const
+VectorSlice<VECTOR>::size() const
{
return length;
}
template <class VECTOR>
inline
typename VECTOR::reference
-SliceVector<VECTOR>::operator[](unsigned int i)
+VectorSlice<VECTOR>::operator[](unsigned int i)
{
Assert ((i<length), ExcIndexRange(i, 0, length));
template <class VECTOR>
inline
typename VECTOR::const_reference
-SliceVector<VECTOR>::operator[](unsigned int i) const
+VectorSlice<VECTOR>::operator[](unsigned int i) const
{
Assert ((i<length), ExcIndexRange(i, 0, length));
#include <base/subscriptor.h>
#include <base/point.h>
#include <base/tensor.h>
+#include <base/vector_slice.h>
#include <base/quadrature.h>
#include <base/table.h>
#include <lac/vector.h>
*/
template <class InputVector, typename number>
void get_function_values (const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<number>& values) const;
/**
*/
template <class InputVector, typename number>
void get_function_values (const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<Vector<number> >& values) const;
/**
*/
template <class InputVector>
void get_function_grads (const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<Tensor<1,dim> >& gradients) const;
/**
*/
template <class InputVector>
void get_function_grads (const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<std::vector<Tensor<1,dim> > >& gradients) const;
/**
template <class InputVector, typename number>
void FEValuesBase<dim>::get_function_values (
const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<number> &values) const
{
Assert (this->update_flags & update_values, ExcAccessToUninitializedField());
template <class InputVector, typename number>
void FEValuesBase<dim>::get_function_values (
const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<Vector<number> >& values) const
{
// One value per quadrature point
template <class InputVector>
void FEValuesBase<dim>::get_function_grads (
const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<Tensor<1,dim> > &values) const
{
Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField());
template <class InputVector>
void FEValuesBase<dim>::get_function_grads (
const InputVector& fe_function,
- const std::vector<unsigned int>& indices,
+ const VectorSlice<const std::vector<unsigned int> >& indices,
std::vector<std::vector<Tensor<1,dim> > >& values) const
{
// One value per quadrature point
(const IN&, std::vector<float>&) const;
template
void FEValuesBase<deal_II_dimension>::get_function_values<IN>
-(const IN&, const std::vector<unsigned int>&, std::vector<double>&) const;
+(const IN&, const SliceVector<const std::vector<unsigned int> >&, std::vector<double>&) const;
template
void FEValuesBase<deal_II_dimension>::get_function_values<IN>
-(const IN&, const std::vector<unsigned int>&, std::vector<float>&) const;
+(const IN&, const SliceVector<const std::vector<unsigned int> >&, std::vector<float>&) const;
template
void FEValuesBase<deal_II_dimension>::get_function_values<IN>
template
void FEValuesBase<deal_II_dimension>::get_function_values<IN>
-(const IN&, const std::vector<unsigned int>&,
+(const IN&, const SliceVector<const std::vector<unsigned int> >&,
std::vector<Vector<double> > &) const;
template
void FEValuesBase<deal_II_dimension>::get_function_values<IN>
-(const IN&, const std::vector<unsigned int>&,
+(const IN&, const SliceVector<const std::vector<unsigned int> >&,
std::vector<Vector<float> > &) const;
template
(const IN&, std::vector<Tensor<1,deal_II_dimension> > &) const;
template
void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
-(const IN&, const std::vector<unsigned int>&,
+(const IN&, const SliceVector<const std::vector<unsigned int> >&,
std::vector<Tensor<1,deal_II_dimension> > &) const;
template
(const IN&, std::vector<std::vector<Tensor<1,deal_II_dimension> > > &) const;
template
void FEValuesBase<deal_II_dimension>::get_function_grads<IN>
-(const IN&, const std::vector<unsigned int>&,
+(const IN&, const SliceVector<const std::vector<unsigned int> >&,
std::vector<std::vector<Tensor<1,deal_II_dimension> > > &) const;
template
<ol>
- <li> <p> New: a class template <code class="class">SliceVector</code> allows
+ <li> <p> New: a class template <code class="class">VectorSlice</code> allows
access to consecutive portions os a vector.
<br>
(GK 2004/09/16)
//---------------------------------------------------------------------
-#include <base/slice_vector.h>
+#include <base/vector_slice.h>
#include <base/logstream.h>
#include <vector>
void f(const std::vector<int>& v)
{
- const SliceVector<const std::vector<int> > s(v,2,3);
+ const VectorSlice<const std::vector<int> > s(v,2,3);
for (unsigned int i=0;i<s.size();++i)
std::cerr << '\t' << s[i];
for (unsigned int i=0;i<v.size();++i)
v[i] = i;
- SliceVector<std::vector<int> > s(v, 3, 4);
+ VectorSlice<std::vector<int> > s(v, 3, 4);
for (unsigned int i=0;i<s.size();++i)
s[i] = i;
f(v);
- SliceVector<std::vector<int> > s2(v, 3, 5);
+ VectorSlice<std::vector<int> > s2(v, 3, 5);
int n = s[4];
n += 3;