ATLAS Offline Software
Source.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SOURCE_HH_TAURECTOOLS
6 #define SOURCE_HH_TAURECTOOLS
7 
8 #include <Eigen/Dense>
9 
10 #include <vector>
11 
12 namespace lwtDev {
13  using Eigen::VectorXd;
14  using Eigen::MatrixXd;
15 
16  // this is called by input nodes to get the inputs
17  class ISource
18  {
19  public:
20  virtual ~ISource() = default;
21  virtual VectorXd at(size_t index) const = 0;
22  virtual MatrixXd matrix_at(size_t index) const = 0;
23  };
24 
25  class VectorSource: public ISource
26  {
27  public:
28  VectorSource(std::vector<VectorXd>&&, std::vector<MatrixXd>&& = {});
29  virtual VectorXd at(size_t index) const override;
30  virtual MatrixXd matrix_at(size_t index) const override;
31  private:
32  std::vector<VectorXd> m_inputs;
33  std::vector<MatrixXd> m_matrix_inputs;
34  };
35 
36  class DummySource: public ISource
37  {
38  public:
39  DummySource(const std::vector<size_t>& input_sizes,
40  const std::vector<std::pair<size_t, size_t> >& = {});
41  virtual VectorXd at(size_t index) const override;
42  virtual MatrixXd matrix_at(size_t index) const override;
43  private:
44  std::vector<size_t> m_sizes;
45  std::vector<std::pair<size_t, size_t> > m_matrix_sizes;
46  };
47 }
48 
49 #endif //SOURCE_HH_TAURECTOOLS
lwtDev::DummySource::at
virtual VectorXd at(size_t index) const override
Definition: Graph.cxx:42
lwtDev::DummySource::DummySource
DummySource(const std::vector< size_t > &input_sizes, const std::vector< std::pair< size_t, size_t > > &={})
Definition: Graph.cxx:36
lwtDev::DummySource::m_matrix_sizes
std::vector< std::pair< size_t, size_t > > m_matrix_sizes
Definition: Source.h:45
index
Definition: index.py:1
lwtDev::VectorSource::at
virtual VectorXd at(size_t index) const override
Definition: Graph.cxx:21
lwtDev::DummySource::matrix_at
virtual MatrixXd matrix_at(size_t index) const override
Definition: Graph.cxx:54
lwtDev::VectorSource::m_matrix_inputs
std::vector< MatrixXd > m_matrix_inputs
Definition: Source.h:33
lwtDev::VectorSource::VectorSource
VectorSource(std::vector< VectorXd > &&, std::vector< MatrixXd > &&={})
Definition: Graph.cxx:15
lwtDev
Definition: Reconstruction/tauRecTools/Root/lwtnn/Exceptions.cxx:8
lwtDev::VectorSource::m_inputs
std::vector< VectorXd > m_inputs
Definition: Source.h:32
lwtDev::ISource::at
virtual VectorXd at(size_t index) const =0
lwtDev::ISource
Definition: Source.h:18
lwtDev::DummySource::m_sizes
std::vector< size_t > m_sizes
Definition: Source.h:44
lwtDev::ISource::~ISource
virtual ~ISource()=default
lwtDev::DummySource
Definition: Source.h:37
lwtDev::ISource::matrix_at
virtual MatrixXd matrix_at(size_t index) const =0
lwtDev::VectorSource::matrix_at
virtual MatrixXd matrix_at(size_t index) const override
Definition: Graph.cxx:28
lwtDev::VectorSource
Definition: Source.h:26