SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AssocMode.h
Go to the documentation of this file.
1 
18 #ifndef _SEIMPLEMENTATION_PLUGIN_ASSOCMODE_ASSOCMODE_H_
19 #define _SEIMPLEMENTATION_PLUGIN_ASSOCMODE_ASSOCMODE_H_
20 
21 #include "NdArray/NdArray.h"
22 
23 #include "SEUtils/Types.h"
26 
27 namespace SourceXtractor {
28 
33 class AssocMode : public Property {
34 public:
35  template<typename T>
37 
41  virtual ~AssocMode() = default;
42 
43  AssocMode() : m_has_assoc(false), m_assoc_data(std::vector<size_t>({0})) {
44  }
45 
46  AssocMode(bool has_assoc, const std::vector<double>& assoc_data) :
47  m_has_assoc(has_assoc), m_assoc_data(std::vector<size_t>({assoc_data.size()})) {
48  for (size_t i=0; i<assoc_data.size(); i++) {
49  m_assoc_data.at(i) = assoc_data[i];
50  }
51  }
52 
53  bool getMatch() const {
54  return m_has_assoc;
55  }
56 
58  return m_assoc_data;
59  }
60 
61 private:
63 
65 };
66 
67 } /* namespace SourceXtractor */
68 
69 #endif /* _SEIMPLEMENTATION_PLUGIN_ASSOCMODE_ASSOCMODE_H_ */
NdArray< SeFloat > m_assoc_data
Definition: AssocMode.h:64
virtual ~AssocMode()=default
Destructor.
Base class for all Properties. (has no actual content)
Definition: Property.h:33
Euclid::NdArray::NdArray< T > NdArray
Definition: AssocMode.h:36
bool getMatch() const
Definition: AssocMode.h:53
const NdArray< SeFloat > & getAssocValues() const
Definition: AssocMode.h:57
T size(T...args)
T & at(const std::vector< size_t > &coords)
STL class.