FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
snl_fei_RaggedTable_specialize.hpp
1 #ifndef _snl_fei_RaggedTable_specialize_hpp_
2 #define _snl_fei_RaggedTable_specialize_hpp_
3 
4 /*--------------------------------------------------------------------*/
5 /* Copyright 2005 Sandia Corporation. */
6 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
7 /* non-exclusive license for use of this work by or on behalf */
8 /* of the U.S. Government. Export of this program may require */
9 /* a license from the United States Government. */
10 /*--------------------------------------------------------------------*/
11 
12 #include <fei_macros.hpp>
13 #include <snl_fei_RaggedTable.hpp>
14 #include <fei_ctg_set.hpp>
15 #include <snl_fei_MapContig.hpp>
16 
17 namespace snl_fei {
18 
20 template<>
21 class RaggedTable<MapContig<fei::ctg_set<int>*>,fei::ctg_set<int> >
22  : public fei::IndexTable {
23 public:
24  RaggedTable(int firstKey, int lastKey);
25 
27 
28  typedef MapContig<fei::ctg_set<int>*> map_type;
30  typedef map_type::iterator iterator;
31 
32  virtual ~RaggedTable()
33  {
34  iterator it = begin();
35  iterator it_end = end();
36  for(; it!=it_end; ++it) {
37  poolAllocatorSet_.destroy( (*it).second );
38  poolAllocatorSet_.deallocate( (*it).second, 1 );
39  }
40  }
41 
42  void addDiagonals(int numIndices,
43  const int* indices);
44 
45  void addIndices(int row,
46  int numIndices,
47  const int* indices);
48 
49  void addIndices(int numRows,
50  const int* rows,
51  int numIndices,
52  const int* indices);
53 
54  map_type& getMap() { return( map_ ); }
55 
56  row_type* getRow(int row)
57  {
58  iterator m_end = map_.end();
59  iterator m_iter = map_.find(row);
60  return( m_end == m_iter ? NULL : (*m_iter).second );
61  }
62 
63  iterator begin() { return( map_.begin() ); }
64 
65  iterator end() { return( map_.end() ); }
66 
67  private:
68  map_type map_;
69  fei_Pool_alloc<row_type> poolAllocatorSet_;
70  row_type dummy;
71 };//RaggedTable<MapContig<fei::ctg_set<int>*> >
72 
73 }//namespace snl_fei
74 #endif
75 
void addDiagonals(int numIndices, const int *indices)
RaggedTable(int firstKey, int lastKey)
SET_TYPE * getRow(int row)
MAP_TYPE::iterator iterator
void addIndices(int row, int numIndices, const int *indices)