Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneInterface
Tool
IndexVectorMapTool.h
Go to the documentation of this file.
1
// IndexVectorMapTool.h
2
3
// David Adams
4
// June 2018
5
// June 2020: Change get to return by balue instead of ref.
6
//
7
// Interface for tools that map one index to a vector of indices.
8
9
#ifndef IndexVectorMapTool_H
10
#define IndexVectorMapTool_H
11
12
#include <vector>
13
#include <algorithm>
14
15
class
IndexVectorMapTool
{
16
17
public
:
18
19
using
Index
=
unsigned
int
;
20
using
IndexVector
= std::vector<Index>;
21
22
static
Index
badIndex
() {
return
-1; }
23
24
virtual
~IndexVectorMapTool
() =
default
;
25
26
// Return the vector for an index.
27
virtual
IndexVector
get
(
Index
idx)
const
=0;
28
29
// Return if the vector for an index contains a value.
30
virtual
bool
contains
(
Index
idx,
Index
val
) {
31
IndexVector
vec =
get
(idx);
32
return
find(vec.begin(), vec.end(),
val
) != vec.end();
33
}
34
35
};
36
37
#endif
IndexVectorMapTool::IndexVector
std::vector< Index > IndexVector
Definition:
IndexVectorMapTool.h:20
val
Definition:
registry_via_id_test_2.cc:15
IndexVectorMapTool::~IndexVectorMapTool
virtual ~IndexVectorMapTool()=default
IndexVectorMapTool::Index
unsigned int Index
Definition:
IndexVectorMapTool.h:19
IndexVectorMapTool
Definition:
IndexVectorMapTool.h:15
testsqlite3.val
list val
Definition:
testsqlite3.py:13
IndexVectorMapTool::contains
virtual bool contains(Index idx, Index val)
Definition:
IndexVectorMapTool.h:30
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
IndexVectorMapTool::badIndex
static Index badIndex()
Definition:
IndexVectorMapTool.h:22
Generated by
1.8.11