ATLAS Offline Software
Loading...
Searching...
No Matches
lwt::atlas::FastGraph Class Reference

#include <FastGraph.h>

Collaboration diagram for lwt::atlas::FastGraph:

Public Types

typedef std::vector< Eigen::VectorXd > NodeVec
typedef std::vector< Eigen::MatrixXd > SeqNodeVec

Public Member Functions

 FastGraph (const GraphConfig &config, const InputOrder &order, const std::string &default_output="")
 ~FastGraph ()
 FastGraph (FastGraph &)=delete
FastGraphoperator= (FastGraph &)=delete
Eigen::VectorXd compute (const NodeVec &, const SeqNodeVec &={}) const
Eigen::VectorXd compute (const NodeVec &, const SeqNodeVec &, size_t) const

Private Types

typedef FastInputPreprocessor IP
typedef FastInputVectorPreprocessor IVP
typedef std::vector< IP * > Preprocs
typedef std::vector< IVP * > VecPreprocs

Private Attributes

Graph * m_graph
Preprocs m_preprocs
VecPreprocs m_vec_preprocs
size_t m_default_output
SourceIndices m_input_indices

Detailed Description

Definition at line 32 of file FastGraph.h.

Member Typedef Documentation

◆ IP

Definition at line 57 of file FastGraph.h.

◆ IVP

Definition at line 58 of file FastGraph.h.

◆ NodeVec

typedef std::vector<Eigen::VectorXd> lwt::atlas::FastGraph::NodeVec

Definition at line 36 of file FastGraph.h.

◆ Preprocs

typedef std::vector<IP*> lwt::atlas::FastGraph::Preprocs
private

Definition at line 59 of file FastGraph.h.

◆ SeqNodeVec

typedef std::vector<Eigen::MatrixXd> lwt::atlas::FastGraph::SeqNodeVec

Definition at line 37 of file FastGraph.h.

◆ VecPreprocs

typedef std::vector<IVP*> lwt::atlas::FastGraph::VecPreprocs
private

Definition at line 60 of file FastGraph.h.

Constructor & Destructor Documentation

◆ FastGraph() [1/2]

lwt::atlas::FastGraph::FastGraph ( const GraphConfig & config,
const InputOrder & order,
const std::string & default_output = "" )

Definition at line 109 of file FastGraph.cxx.

110 :
111 m_graph(new Graph(config.nodes, config.layers))
112 {
113
114 m_input_indices.scalar = get_node_indices(
115 order.scalar, config.inputs);
116
117 m_input_indices.sequence = get_node_indices(
118 order.sequence, config.input_sequences);
119
120 for (size_t i = 0; i < config.inputs.size(); i++) {
121 const lwt::InputNodeConfig& node = config.inputs.at(i);
122 size_t input_node = m_input_indices.scalar.at(i);
123 std::vector<std::string> varorder = order.scalar.at(input_node).second;
124 m_preprocs.emplace_back(
125 new FastInputPreprocessor(node.variables, varorder));
126 }
127 for (size_t i = 0; i < config.input_sequences.size(); i++) {
128 const lwt::InputNodeConfig& node = config.input_sequences.at(i);
129 size_t input_node = m_input_indices.sequence.at(i);
130 std::vector<std::string> varorder = order.sequence.at(input_node).second;
131 m_vec_preprocs.emplace_back(
132 new FastInputVectorPreprocessor(node.variables, varorder));
133 }
134 if (!default_output.empty()) {
135 auto it = config.outputs.find(default_output);
136 if (it == config.outputs.end()) {
137 throw NNConfigurationException("no output node" + default_output);
138 }
139 m_default_output = it->second.node_index;
140 } else if (config.outputs.size() == 1) {
141 m_default_output = config.outputs.begin()->second.node_index;
142 } else {
143 throw NNConfigurationException("you must specify a default output");
144 }
145 }
SourceIndices m_input_indices
Definition FastGraph.h:67
VecPreprocs m_vec_preprocs
Definition FastGraph.h:64
order
Configure Herwig7.

◆ ~FastGraph()

lwt::atlas::FastGraph::~FastGraph ( )

Definition at line 147 of file FastGraph.cxx.

147 {
148 delete m_graph;
149 for (auto& preproc: m_preprocs) {
150 delete preproc;
151 preproc = 0;
152 }
153 for (auto& preproc: m_vec_preprocs) {
154 delete preproc;
155 preproc = 0;
156 }
157 }

◆ FastGraph() [2/2]

lwt::atlas::FastGraph::FastGraph ( FastGraph & )
delete

Member Function Documentation

◆ compute() [1/2]

VectorXd lwt::atlas::FastGraph::compute ( const NodeVec & nodes,
const SeqNodeVec & seq,
size_t idx ) const

Definition at line 163 of file FastGraph.cxx.

165 {
166 LazySource source(nodes, seq, m_preprocs, m_vec_preprocs,
168 return m_graph->compute(source, idx);
169 }

◆ compute() [2/2]

VectorXd lwt::atlas::FastGraph::compute ( const NodeVec & nodes,
const SeqNodeVec & seq = {} ) const

Definition at line 159 of file FastGraph.cxx.

160 {
161 return compute(nodes, seq, m_default_output);
162 }
Eigen::VectorXd compute(const NodeVec &, const SeqNodeVec &={}) const

◆ operator=()

FastGraph & lwt::atlas::FastGraph::operator= ( FastGraph & )
delete

Member Data Documentation

◆ m_default_output

size_t lwt::atlas::FastGraph::m_default_output
private

Definition at line 65 of file FastGraph.h.

◆ m_graph

Graph* lwt::atlas::FastGraph::m_graph
private

Definition at line 62 of file FastGraph.h.

◆ m_input_indices

SourceIndices lwt::atlas::FastGraph::m_input_indices
private

Definition at line 67 of file FastGraph.h.

◆ m_preprocs

Preprocs lwt::atlas::FastGraph::m_preprocs
private

Definition at line 63 of file FastGraph.h.

◆ m_vec_preprocs

VecPreprocs lwt::atlas::FastGraph::m_vec_preprocs
private

Definition at line 64 of file FastGraph.h.


The documentation for this class was generated from the following files: