KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
pointer_vector_set.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 //
13 
14 #pragma once
15 
16 // System includes
17 #include <vector>
18 #include <string>
19 #include <iostream>
20 #include <sstream>
21 #include <cstddef>
22 #include <utility>
23 
24 // External includes
25 #include <boost/iterator/indirect_iterator.hpp>
26 
27 // Project includes
28 #include "includes/define.h"
29 #include "includes/serializer.h"
31 
32 namespace Kratos
33 {
34 
37 
41 
45 
49 
53 
65 template<class TDataType,
66  class TGetKeyType = SetIdentityFunction<TDataType>,
67  class TCompareType = std::less<decltype(std::declval<TGetKeyType>()(std::declval<TDataType>()))>,
68  class TEqualType = std::equal_to<decltype(std::declval<TGetKeyType>()(std::declval<TDataType>()))>,
69  class TPointerType = typename TDataType::Pointer,
70  class TContainerType = std::vector<TPointerType>>
71 class PointerVectorSet final
72 {
73 public:
76 
79 
81  using key_type = typename std::remove_reference<decltype(std::declval<TGetKeyType>()(std::declval<TDataType>()))>::type;
82 
83  // Data type stored in this container.
84  using data_type = TDataType;
85  using value_type = TDataType;
86  using key_compare = TCompareType;
87  using pointer = TPointerType;
88  using reference = TDataType&;
89  using const_reference = const TDataType&;
90  using ContainerType = TContainerType;
91 
95  using iterator = boost::indirect_iterator<typename TContainerType::iterator>;
96  using const_iterator = boost::indirect_iterator<typename TContainerType::const_iterator>;
97  using reverse_iterator = boost::indirect_iterator<typename TContainerType::reverse_iterator>;
98  using const_reverse_iterator = boost::indirect_iterator<typename TContainerType::const_reverse_iterator>;
99 
103  using size_type = typename TContainerType::size_type;
104  using ptr_iterator = typename TContainerType::iterator;
105  using ptr_const_iterator = typename TContainerType::const_iterator;
106  using ptr_reverse_iterator = typename TContainerType::reverse_iterator;
107  using ptr_const_reverse_iterator = typename TContainerType::const_reverse_iterator;
108  using difference_type = typename TContainerType::difference_type;
109 
113 
115  PointerVectorSet() : mData(), mSortedPartSize(size_type()), mMaxBufferSize(1) {}
116 
125  template <class TInputIteratorType>
126  PointerVectorSet(TInputIteratorType First, TInputIteratorType Last, size_type NewMaxBufferSize = 1)
127  : mSortedPartSize(size_type()), mMaxBufferSize(NewMaxBufferSize)
128  {
129  for (; First != Last; ++First)
130  insert(begin(), *First);
131  }
132 
138  : mData(rOther.mData), mSortedPartSize(rOther.mSortedPartSize), mMaxBufferSize(rOther.mMaxBufferSize) {}
139 
145  explicit PointerVectorSet(const TContainerType& rContainer) : mData(rContainer), mSortedPartSize(size_type()), mMaxBufferSize(1)
146  {
147  Sort();
148  std::unique(mData.begin(), mData.end(), EqualKeyTo());
149  }
150 
153 
157 
165  {
166  mData = rOther.mData;
167  mSortedPartSize = rOther.mSortedPartSize;
168 
169  return *this;
170  }
171 
179  TDataType& operator[](const key_type& Key)
180  {
181  ptr_iterator sorted_part_end;
182 
183  if (mData.size() - mSortedPartSize >= mMaxBufferSize) {
184  Sort();
185  sorted_part_end = mData.end();
186  } else {
187  sorted_part_end = mData.begin() + mSortedPartSize;
188  }
189 
190  ptr_iterator i(std::lower_bound(mData.begin(), sorted_part_end, Key, CompareKey()));
191  if (i == sorted_part_end) {
192  mSortedPartSize++;
193  return **mData.insert(sorted_part_end, TPointerType(new TDataType(Key)));
194  }
195 
196  if (!EqualKeyTo(Key)(*i)) {
197  if ((i = std::find_if(sorted_part_end, mData.end(), EqualKeyTo(Key))) == mData.end()) {
198  mData.push_back(TPointerType(new TDataType(Key)));
199  return **(mData.end() - 1);
200  }
201  }
202 
203  return **i;
204  }
205 
215  {
216  ptr_iterator sorted_part_end;
217 
218  if (mData.size() - mSortedPartSize >= mMaxBufferSize) {
219  Sort();
220  sorted_part_end = mData.end();
221  } else
222  sorted_part_end = mData.begin() + mSortedPartSize;
223 
224  ptr_iterator i(std::lower_bound(mData.begin(), sorted_part_end, Key, CompareKey()));
225  if (i == sorted_part_end) {
226  mSortedPartSize++;
227  return *mData.insert(sorted_part_end, TPointerType(new TDataType(Key)));
228  }
229 
230  if (!EqualKeyTo(Key)(*i))
231  if ((i = std::find_if(sorted_part_end, mData.end(), EqualKeyTo(Key))) == mData.end()) {
232  mData.push_back(TPointerType(new TDataType(Key)));
233  return *(mData.end() - 1);
234  }
235 
236  return *i;
237  }
238 
247  bool operator==(const PointerVectorSet& r) const noexcept
248  {
249  assert( !empty() );
250  if (size() != r.size())
251  return false;
252  else
253  return std::equal(mData.begin(), mData.end(), r.mData.begin(), EqualKeyTo());
254  }
255 
264  bool operator<(const PointerVectorSet& r) const noexcept
265  {
266  assert( !empty() );
267  return std::lexicographical_compare(mData.begin(), mData.end(), r.mData.begin(), r.mData.end(), CompareKey());
268  }
269 
273 
279  {
280  return iterator( mData.begin() );
281  }
282 
288  {
289  return const_iterator( mData.begin() );
290  }
291 
297  {
298  return const_iterator(mData.begin());
299  }
300 
306  {
307  return const_iterator(mData.begin());
308  }
309 
315  {
316  return iterator( mData.end() );
317  }
318 
324  {
325  return const_iterator( mData.end() );
326  }
327 
333  {
334  return const_iterator(mData.end());
335  }
336 
342  {
343  return const_iterator(mData.end());
344  }
345 
351  {
352  return reverse_iterator( mData.rbegin() );
353  }
354 
360  {
361  return const_reverse_iterator( mData.rbegin() );
362  }
363 
369  {
370  return reverse_iterator( mData.rend() );
371  }
372 
378  {
379  return const_reverse_iterator( mData.rend() );
380  }
381 
387  {
388  return mData.begin();
389  }
390 
396  {
397  return mData.begin();
398  }
399 
405  {
406  return mData.end();
407  }
408 
414  {
415  return mData.end();
416  }
417 
423  {
424  return mData.rbegin();
425  }
426 
432  {
433  return mData.rbegin();
434  }
435 
441  {
442  return mData.rend();
443  }
444 
450  {
451  return mData.rend();
452  }
453 
459  reference front() noexcept
460  {
461  assert( !empty() );
462  return *(mData.front());
463  }
464 
471  {
472  assert( !empty() );
473  return *(mData.front());
474  }
475 
481  reference back() noexcept
482  {
483  assert( !empty() );
484  return *(mData.back());
485  }
486 
493  {
494  assert( !empty() );
495  return *(mData.back());
496  }
497 
502  size_type size() const
503  {
504  return mData.size();
505  }
506 
512  {
513  return mData.max_size();
514  }
515 
522  {
523  return TCompareType();
524  }
525 
532  void swap(PointerVectorSet& rOther)
533  {
534  std::swap(mSortedPartSize, rOther.mSortedPartSize);
535  std::swap(mMaxBufferSize, rOther.mMaxBufferSize);
536  mData.swap(rOther.mData);
537  }
538 
544  void push_back(TPointerType x)
545  {
546  mData.push_back(x);
547  }
548 
554  void pop_back()
555  {
556  mData.pop_back();
557  if (mSortedPartSize > mData.size())
558  mSortedPartSize = mData.size();
559  }
560 
569  iterator insert(iterator Position, const TPointerType pData)
570  {
571  ptr_iterator sorted_part_end;
572 
573  key_type key = KeyOf(*pData);
574 
575  if (mData.size() - mSortedPartSize >= mMaxBufferSize) {
576  Sort();
577  sorted_part_end = mData.end();
578  } else
579  sorted_part_end = mData.begin() + mSortedPartSize;
580 
581  ptr_iterator i(std::lower_bound(mData.begin(), sorted_part_end, key, CompareKey()));
582  if (i == sorted_part_end) {
583  mSortedPartSize++;
584  return mData.insert(sorted_part_end, pData);
585  }
586 
587  if (!EqualKeyTo(key)(*i))
588  if ((i = std::find_if(sorted_part_end, mData.end(), EqualKeyTo(key))) == mData.end()) {
589  mData.push_back(pData);
590  return iterator(mData.end() - 1);
591  }
592 
593  *i = pData;
594  return i;
595  }
596 
604  template <class InputIterator>
605  void insert(InputIterator First, InputIterator Last)
606  {
607  for (; First != Last; ++First)
608  insert(begin(), *First);
609  }
610 
621  {
622  if (pos.base() == mData.end())
623  return mData.end();
624  iterator new_end = iterator(mData.erase(pos.base()));
625  mSortedPartSize = mData.size();
626  return new_end;
627  }
628 
638  {
639  iterator new_end = iterator(mData.erase(first.base(), last.base()));
640  // TODO: Sorted part size must change
641  mSortedPartSize = mData.size();
642  return new_end;
643  }
644 
654  {
655  return erase(find(k));
656  }
657 
663  void clear()
664  {
665  mData.clear();
666  mSortedPartSize = size_type();
667  mMaxBufferSize = 1;
668  }
669 
678  iterator find(const key_type& Key)
679  {
680  ptr_iterator sorted_part_end;
681 
682  if (mData.size() - mSortedPartSize >= mMaxBufferSize) {
683  Sort();
684  sorted_part_end = mData.end();
685  } else
686  sorted_part_end = mData.begin() + mSortedPartSize;
687 
688  ptr_iterator i(std::lower_bound(mData.begin(), sorted_part_end, Key, CompareKey()));
689  if (i == sorted_part_end || (!EqualKeyTo(Key)(*i)))
690  if ((i = std::find_if(sorted_part_end, mData.end(), EqualKeyTo(Key))) == mData.end())
691  return mData.end();
692 
693  return i;
694  }
695 
704  const_iterator find(const key_type& Key) const
705  {
706  ptr_const_iterator sorted_part_end(mData.begin() + mSortedPartSize);
707 
708  ptr_const_iterator i(std::lower_bound(mData.begin(), sorted_part_end, Key, CompareKey()));
709  if (i == sorted_part_end || (!EqualKeyTo(Key)(*i)))
710  if ((i = std::find_if(sorted_part_end, mData.end(), EqualKeyTo(Key))) == mData.end())
711  return mData.end();
712 
713  return const_iterator(i);
714  }
715 
724  {
725  return find(Key) == mData.end() ? 0 : 1;
726  }
727 
733  void reserve(int reservedsize)
734  {
735  mData.reserve(reservedsize);
736  }
737 
743  int capacity()
744  {
745  return mData.capacity();
746  }
747 
753  void Sort()
754  {
755  std::sort(mData.begin(), mData.end(), CompareKey());
756  mSortedPartSize = mData.size();
757  }
758 
764  void Unique()
765  {
766  typename TContainerType::iterator end_it = mData.end();
767  std::sort(mData.begin(), mData.end(), CompareKey());
768  typename TContainerType::iterator new_end_it = std::unique(mData.begin(), mData.end(), EqualKeyTo());
769  mData.erase(new_end_it, end_it);
770  mSortedPartSize = mData.size();
771  }
772 
776 
778  TContainerType& GetContainer()
779  {
780  return mData;
781  }
782 
784  const TContainerType& GetContainer() const
785  {
786  return mData;
787  }
788 
793  {
794  return mMaxBufferSize;
795  }
796 
802  void SetMaxBufferSize(const size_type NewSize)
803  {
804  mMaxBufferSize = NewSize;
805  }
806 
811  {
812  return mSortedPartSize;
813  }
814 
819  void SetSortedPartSize(const size_type NewSize)
820  {
821  mSortedPartSize = NewSize;
822  }
823 
827 
833  bool empty() const
834  {
835  return mData.empty();
836  }
837 
843  bool IsSorted() const
844  {
845  return (mSortedPartSize == mData.size());
846  }
847 
851 
853  std::string Info() const
854  {
855  std::stringstream buffer;
856  buffer << "Pointer vector set (size = " << size() << ") : ";
857 
858  return buffer.str();
859  }
860 
861 
863  void PrintInfo(std::ostream& rOStream) const
864  {
865  rOStream << Info();
866  }
867 
869  void PrintData(std::ostream& rOStream) const
870  {
871  std::copy(begin(), end(), std::ostream_iterator<TDataType>(rOStream, "\n "));
872  }
873 
877 
879 private:
881 
887  class CompareKey
888  {
889  public:
897  bool operator()(key_type a, TPointerType b) const
898  {
899  return TCompareType()(a, TGetKeyType()(*b));
900  }
901 
909  bool operator()(TPointerType a, key_type b) const
910  {
911  return TCompareType()(TGetKeyType()(*a), b);
912  }
913 
921  bool operator()(TPointerType a, TPointerType b) const
922  {
923  return TCompareType()(TGetKeyType()(*a), TGetKeyType()(*b));
924  }
925  };
926 
932  class EqualKeyTo
933  {
934  key_type mKey;
935  public:
940  EqualKeyTo() : mKey() {}
941 
947  explicit EqualKeyTo(key_type Key) : mKey(Key) {}
948 
955  bool operator()(TPointerType a) const
956  {
957  return TEqualType()(mKey, TGetKeyType()(*a));
958  }
959 
967  bool operator()(TPointerType a, TPointerType b) const
968  {
969  return TEqualType()(TGetKeyType()(*a), TGetKeyType()(*b));
970  }
971  };
972 
976 
980 
982  TContainerType mData;
983 
985  size_type mSortedPartSize;
986 
988  size_type mMaxBufferSize;
989 
993 
997 
1004  key_type KeyOf(iterator i)
1005  {
1006  return TGetKeyType()(*i);
1007  }
1008 
1015  key_type KeyOf(ptr_iterator i)
1016  {
1017  return TGetKeyType()(**i);
1018  }
1019 
1026  key_type KeyOf(const TDataType &i)
1027  {
1028  return TGetKeyType()(i);
1029  }
1030 
1034 
1039  friend class Serializer;
1040 
1045  virtual void save(Serializer& rSerializer) const
1046  {
1047  size_type local_size = mData.size();
1048 
1049  rSerializer.save("size", local_size);
1050 
1051  for(size_type i = 0 ; i < local_size ; i++)
1052  rSerializer.save("E", mData[i]);
1053 
1054  rSerializer.save("Sorted Part Size",mSortedPartSize);
1055  rSerializer.save("Max Buffer Size",mMaxBufferSize);
1056  }
1057 
1062  virtual void load(Serializer& rSerializer)
1063  {
1065 
1066  rSerializer.load("size", local_size);
1067 
1068  mData.resize(local_size);
1069 
1070  for(size_type i = 0 ; i < local_size ; i++)
1071  rSerializer.load("E", mData[i]);
1072 
1073  rSerializer.load("Sorted Part Size",mSortedPartSize);
1074  rSerializer.load("Max Buffer Size",mMaxBufferSize);
1075  }
1076 
1080 
1084 
1088 
1090 
1091 }; // Class PointerVectorSet
1092 
1094 
1097 
1101 
1103 template<class TDataType,
1104  class TGetKeyType,
1105  class TCompareType,
1106  class TEqualType,
1107  class TPointerType,
1108  class TContainerType>
1109 inline std::istream& operator >> (std::istream& rIStream,
1111 
1113 template<class TDataType,
1114  class TGetKeyType,
1115  class TCompareType,
1116  class TEqualType,
1117  class TPointerType,
1118  class TContainerType>
1119 inline std::ostream& operator << (std::ostream& rOStream,
1121 {
1122  rThis.PrintInfo(rOStream);
1123  rOStream << std::endl;
1124  rThis.PrintData(rOStream);
1125 
1126  return rOStream;
1127 }
1129 
1130 } // namespace Kratos.
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
void Unique()
Remove duplicate elements from the set.
Definition: pointer_vector_set.h:764
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: pointer_vector_set.h:869
TDataType & reference
Definition: pointer_vector_set.h:88
typename TContainerType::reverse_iterator ptr_reverse_iterator
Definition: pointer_vector_set.h:106
ptr_reverse_iterator ptr_rbegin()
Returns a reverse iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:422
bool empty() const
Check if the data container is empty.
Definition: pointer_vector_set.h:833
bool IsSorted() const
Check if the data container is sorted.
Definition: pointer_vector_set.h:843
const_iterator cend() const
Returns a constant iterator pointing to the end of the container.
Definition: pointer_vector_set.h:341
TCompareType key_compare
Definition: pointer_vector_set.h:86
const_iterator cbegin() const
Returns a constant iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:305
iterator erase(iterator pos)
Erase an element at the specified position.
Definition: pointer_vector_set.h:620
const_iterator end() const
Returns a constant iterator pointing to the end of the container.
Definition: pointer_vector_set.h:323
const TDataType & const_reference
Definition: pointer_vector_set.h:89
typename TContainerType::const_reverse_iterator ptr_const_reverse_iterator
Definition: pointer_vector_set.h:107
size_type max_size() const
Returns the maximum possible number of elements the container can hold.
Definition: pointer_vector_set.h:511
typename TContainerType::const_iterator ptr_const_iterator
Definition: pointer_vector_set.h:105
int capacity()
Get the current capacity of the underlying data container.
Definition: pointer_vector_set.h:743
void SetSortedPartSize(const size_type NewSize)
Set the sorted part size of buffer used in the container.
Definition: pointer_vector_set.h:819
ptr_iterator ptr_end()
Returns an iterator pointing to the end of the underlying data container.
Definition: pointer_vector_set.h:404
void clear()
Clear the set, removing all elements.
Definition: pointer_vector_set.h:663
ptr_const_iterator ptr_end() const
Returns a constant iterator pointing to the end of the underlying data container.
Definition: pointer_vector_set.h:413
reference front() noexcept
Returns a reference to the first element in the container.
Definition: pointer_vector_set.h:459
reference back() noexcept
Returns a reference to the last element in the container.
Definition: pointer_vector_set.h:481
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
ptr_iterator ptr_begin()
Returns an iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:386
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
void swap(PointerVectorSet &rOther)
Swaps the contents of this PointerVectorSet with another.
Definition: pointer_vector_set.h:532
typename TContainerType::difference_type difference_type
Definition: pointer_vector_set.h:108
const TContainerType & GetContainer() const
Definition: pointer_vector_set.h:784
void pop_back()
Removes the last element from the set.
Definition: pointer_vector_set.h:554
const_reference front() const noexcept
Returns a constant reference to the first element in the container.
Definition: pointer_vector_set.h:470
ptr_const_reverse_iterator ptr_rend() const
Returns a constant reverse iterator pointing to the end of the underlying data container.
Definition: pointer_vector_set.h:449
TDataType data_type
Definition: pointer_vector_set.h:84
boost::indirect_iterator< typename TContainerType::reverse_iterator > reverse_iterator
Definition: pointer_vector_set.h:97
void Sort()
Sort the elements in the set.
Definition: pointer_vector_set.h:753
const_iterator begin() const
Returns a constant iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:287
~PointerVectorSet()
Destructor.
Definition: pointer_vector_set.h:152
ptr_const_iterator ptr_begin() const
Returns a constant iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:395
void insert(InputIterator First, InputIterator Last)
Insert elements from a range of iterators.
Definition: pointer_vector_set.h:605
reverse_iterator rend()
Returns a reverse iterator pointing to the end of the container.
Definition: pointer_vector_set.h:368
TDataType & operator[](const key_type &Key)
Accesses an element by key and returns a reference.
Definition: pointer_vector_set.h:179
const_reverse_iterator rend() const
Returns a constant reverse iterator pointing to the end of the container.
Definition: pointer_vector_set.h:377
iterator insert(iterator Position, const TPointerType pData)
Inserts a pointer at the specified position.
Definition: pointer_vector_set.h:569
size_type count(const key_type &Key)
Count the number of elements with the specified key.
Definition: pointer_vector_set.h:723
boost::indirect_iterator< typename TContainerType::const_reverse_iterator > const_reverse_iterator
Definition: pointer_vector_set.h:98
size_type GetMaxBufferSize() const
Get the maximum size of buffer used in the container.
Definition: pointer_vector_set.h:792
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
TContainerType & GetContainer()
Definition: pointer_vector_set.h:778
const_iterator cend()
Returns a constant iterator pointing to the end of the container.
Definition: pointer_vector_set.h:332
typename TContainerType::size_type size_type
Definition: pointer_vector_set.h:103
bool operator<(const PointerVectorSet &r) const noexcept
Less than comparison operator for two PointerVectorSet objects.
Definition: pointer_vector_set.h:264
KRATOS_CLASS_POINTER_DEFINITION(PointerVectorSet)
Pointer definition of PointerVectorSet.
TContainerType ContainerType
Definition: pointer_vector_set.h:90
ptr_reverse_iterator ptr_rend()
Returns a reverse iterator pointing to the end of the underlying data container.
Definition: pointer_vector_set.h:440
PointerVectorSet()
Default constructor.
Definition: pointer_vector_set.h:115
size_type GetSortedPartSize() const
Get the sorted part size of buffer used in the container.
Definition: pointer_vector_set.h:810
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
PointerVectorSet(const PointerVectorSet &rOther)
Copy constructor for PointerVectorSet.
Definition: pointer_vector_set.h:137
boost::indirect_iterator< typename TContainerType::const_iterator > const_iterator
Definition: pointer_vector_set.h:96
iterator find(const key_type &Key)
Find an element with the specified key.
Definition: pointer_vector_set.h:678
PointerVectorSet & operator=(const PointerVectorSet &rOther)
Assignment operator for PointerVectorSet.
Definition: pointer_vector_set.h:164
PointerVectorSet(TInputIteratorType First, TInputIteratorType Last, size_type NewMaxBufferSize=1)
Constructs a PointerVectorSet from a range of elements.
Definition: pointer_vector_set.h:126
ptr_const_reverse_iterator ptr_rbegin() const
Returns a constant reverse iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:431
std::string Info() const
Turn back information as a string.
Definition: pointer_vector_set.h:853
const_reference back() const noexcept
Returns a constant reference to the last element in the container.
Definition: pointer_vector_set.h:492
reverse_iterator rbegin()
Returns a reverse iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:350
bool operator==(const PointerVectorSet &r) const noexcept
Equality comparison operator for two PointerVectorSet objects.
Definition: pointer_vector_set.h:247
void reserve(int reservedsize)
Reserves memory for a specified number of elements.
Definition: pointer_vector_set.h:733
const_iterator cbegin()
Returns a constant iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:296
const_iterator find(const key_type &Key) const
Find an element with the specified key (const version).
Definition: pointer_vector_set.h:704
TDataType value_type
Definition: pointer_vector_set.h:85
iterator erase(const key_type &k)
Erase an element with the specified key.
Definition: pointer_vector_set.h:653
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
iterator erase(iterator first, iterator last)
Erase a range of elements defined by iterators.
Definition: pointer_vector_set.h:637
PointerVectorSet(const TContainerType &rContainer)
Constructs a PointerVectorSet from a container.
Definition: pointer_vector_set.h:145
pointer & operator()(const key_type &Key)
Function for inserting or retrieving a pointer associated with a key.
Definition: pointer_vector_set.h:214
void SetMaxBufferSize(const size_type NewSize)
Set the maximum size of buffer used in the container.
Definition: pointer_vector_set.h:802
typename TContainerType::iterator ptr_iterator
Definition: pointer_vector_set.h:104
key_compare key_comp() const
Returns the key comparison function used for ordering elements in the container.
Definition: pointer_vector_set.h:521
const_reverse_iterator rbegin() const
Returns a constant reverse iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:359
TPointerType pointer
Definition: pointer_vector_set.h:87
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: pointer_vector_set.h:863
typename std::remove_reference< decltype(std::declval< TGetKeyType >()(std::declval< TDataType >()))>::type key_type
Key type for searching in this container.
Definition: pointer_vector_set.h:81
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
type
Definition: generate_gid_list_file.py:35
a
Definition: generate_stokes_twofluid_element.py:77
int local_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:17
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
def load(f)
Definition: ode_solve.py:307
tuple const
Definition: ode_solve.py:403
int k
Definition: quadrature.py:595
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17