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, 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,
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.size() > 0) {
135 if (!config.outputs.count(default_output)) {
136 throw NNConfigurationException("no output node" + default_output);
137 }
138 m_default_output = config.outputs.at(default_output).node_index;
139 } else if (config.outputs.size() == 1) {
140 m_default_output = config.outputs.begin()->second.node_index;
141 } else {
142 throw NNConfigurationException("you must specify a default output");
143 }
144 }
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 146 of file FastGraph.cxx.

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

◆ 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 162 of file FastGraph.cxx.

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

◆ compute() [2/2]

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

Definition at line 158 of file FastGraph.cxx.

159 {
160 return compute(nodes, seq, m_default_output);
161 }
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: