From: guido Date: Fri, 17 Sep 2004 09:09:55 +0000 (+0000) Subject: SliceVector -> VectorSlice X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4daa9792d63d2e127b4c7970386cf1570ec8fe50;p=dealii-svn.git SliceVector -> VectorSlice git-svn-id: https://svn.dealii.org/trunk@9626 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/Makefile b/deal.II/Makefile index 3da01bf749..27fb57d5fe 100644 --- a/deal.II/Makefile +++ b/deal.II/Makefile @@ -126,7 +126,7 @@ TAGS: @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 diff --git a/deal.II/base/include/base/slice_vector.h b/deal.II/base/include/base/vector_slice.h similarity index 79% rename from deal.II/base/include/base/slice_vector.h rename to deal.II/base/include/base/vector_slice.h index f0881c6e9c..0746cc563e 100644 --- a/deal.II/base/include/base/slice_vector.h +++ b/deal.II/base/include/base/vector_slice.h @@ -10,8 +10,8 @@ // 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 #include @@ -25,13 +25,13 @@ * 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& v) * { - * const SliceVector slice(v,...); + * const VectorSlice slice(v,...); * ... * } * @endcode @@ -39,11 +39,11 @@ * @author Guido Kanschat, 2004 */ template -class SliceVector +class VectorSlice { public: - SliceVector(VECTOR& v); - SliceVector(VECTOR& v, + VectorSlice(VECTOR& v); + VectorSlice(VECTOR& v, unsigned int start, unsigned int length); @@ -62,15 +62,15 @@ class SliceVector * Helper function for creating temporary objects without typing * template arguments. * - * @relates SliceVector + * @relates VectorSlice * @author Guido Kanschat, 2004 */ template inline -const SliceVector +const VectorSlice make_slice (VECTOR& v) { - const SliceVector r(v); + const VectorSlice r(v); return r; } @@ -80,15 +80,15 @@ make_slice (VECTOR& v) * Helper function for creating temporary objects without typing * template arguments. * - * @relates SliceVector + * @relates VectorSlice * @author Guido Kanschat, 2004 */ template inline -const SliceVector +const VectorSlice make_slice (VECTOR& v, unsigned int start, unsigned int length) { - const SliceVector r(v, start, length); + const VectorSlice r(v, start, length); return r; } @@ -99,14 +99,14 @@ make_slice (VECTOR& v, unsigned int start, unsigned int length) template inline -SliceVector::SliceVector(VECTOR& v) +VectorSlice::VectorSlice(VECTOR& v) : v(v), start(0), length(v.size()) {} template inline -SliceVector::SliceVector(VECTOR& v, +VectorSlice::VectorSlice(VECTOR& v, unsigned int start, unsigned int length) : v(v), start(start), length(length) @@ -119,7 +119,7 @@ SliceVector::SliceVector(VECTOR& v, template inline unsigned int -SliceVector::size() const +VectorSlice::size() const { return length; } @@ -128,7 +128,7 @@ SliceVector::size() const template inline typename VECTOR::reference -SliceVector::operator[](unsigned int i) +VectorSlice::operator[](unsigned int i) { Assert ((i::operator[](unsigned int i) template inline typename VECTOR::const_reference -SliceVector::operator[](unsigned int i) const +VectorSlice::operator[](unsigned int i) const { Assert ((i #include #include +#include #include #include #include @@ -661,7 +662,7 @@ class FEValuesBase : protected FEValuesData */ template void get_function_values (const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector& values) const; /** @@ -702,7 +703,7 @@ class FEValuesBase : protected FEValuesData */ template void get_function_values (const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector >& values) const; /** @@ -793,7 +794,7 @@ class FEValuesBase : protected FEValuesData */ template void get_function_grads (const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector >& gradients) const; /** @@ -804,7 +805,7 @@ class FEValuesBase : protected FEValuesData */ template void get_function_grads (const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector > >& gradients) const; /** diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index 98ad018d5c..edf4907105 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -403,7 +403,7 @@ template template void FEValuesBase::get_function_values ( const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector &values) const { Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); @@ -495,7 +495,7 @@ template template void FEValuesBase::get_function_values ( const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector >& values) const { // One value per quadrature point @@ -600,7 +600,7 @@ template template void FEValuesBase::get_function_grads ( const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector > &values) const { Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); @@ -691,7 +691,7 @@ template template void FEValuesBase::get_function_grads ( const InputVector& fe_function, - const std::vector& indices, + const VectorSlice >& indices, std::vector > >& values) const { // One value per quadrature point diff --git a/deal.II/deal.II/source/fe/fe_values.instance.h b/deal.II/deal.II/source/fe/fe_values.instance.h index d76e138945..f6647ce71c 100644 --- a/deal.II/deal.II/source/fe/fe_values.instance.h +++ b/deal.II/deal.II/source/fe/fe_values.instance.h @@ -24,10 +24,10 @@ void FEValuesBase::get_function_values (const IN&, std::vector&) const; template void FEValuesBase::get_function_values -(const IN&, const std::vector&, std::vector&) const; +(const IN&, const SliceVector >&, std::vector&) const; template void FEValuesBase::get_function_values -(const IN&, const std::vector&, std::vector&) const; +(const IN&, const SliceVector >&, std::vector&) const; template void FEValuesBase::get_function_values @@ -38,11 +38,11 @@ void FEValuesBase::get_function_values template void FEValuesBase::get_function_values -(const IN&, const std::vector&, +(const IN&, const SliceVector >&, std::vector > &) const; template void FEValuesBase::get_function_values -(const IN&, const std::vector&, +(const IN&, const SliceVector >&, std::vector > &) const; template @@ -50,7 +50,7 @@ void FEValuesBase::get_function_grads (const IN&, std::vector > &) const; template void FEValuesBase::get_function_grads -(const IN&, const std::vector&, +(const IN&, const SliceVector >&, std::vector > &) const; template @@ -58,7 +58,7 @@ void FEValuesBase::get_function_grads (const IN&, std::vector > > &) const; template void FEValuesBase::get_function_grads -(const IN&, const std::vector&, +(const IN&, const SliceVector >&, std::vector > > &) const; template diff --git a/deal.II/doc/news/c-5.0.html b/deal.II/doc/news/c-5.0.html index cb8963feae..0a9336bc58 100644 --- a/deal.II/doc/news/c-5.0.html +++ b/deal.II/doc/news/c-5.0.html @@ -107,7 +107,7 @@ inconvenience this causes.
    -
  1. New: a class template SliceVector allows +

  2. New: a class template VectorSlice allows access to consecutive portions os a vector.
    (GK 2004/09/16) diff --git a/tests/base/slice_vector.cc b/tests/base/slice_vector.cc index 5dce51d398..1e5ff8a148 100644 --- a/tests/base/slice_vector.cc +++ b/tests/base/slice_vector.cc @@ -12,7 +12,7 @@ //--------------------------------------------------------------------- -#include +#include #include #include @@ -21,7 +21,7 @@ void f(const std::vector& v) { - const SliceVector > s(v,2,3); + const VectorSlice > s(v,2,3); for (unsigned int i=0;i > s(v, 3, 4); + VectorSlice > s(v, 3, 4); for (unsigned int i=0;i > s2(v, 3, 5); + VectorSlice > s2(v, 3, 5); int n = s[4]; n += 3;