FlatVector.hpp 478 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <vector>

namespace AMDiS
{
  /// Flat data vector to be used in assembling as element vector
  template <class T, class Allocator = std::allocator<T>>
  class FlatVector
      : public std::vector<T,Allocator>
  {
  public:
    using std::vector<T,Allocator>::vector;

    /// Assign value `s` to all entries of the vector
    FlatVector& operator=(T s)
    {
      this->assign(this->size(), s);
      return *this;
    }
  };

} // end namespace AMDiS