APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
convolutionmap.h
Go to the documentation of this file.
1//
2// APFEL++ 2017
3//
4// Author: Valerio Bertone: valerio.bertone@cern.ch
5//
6
7#pragma once
8
9#include "apfel/matrix.h"
10
11#include <map>
12#include <string>
13#include <iostream>
14
15namespace apfel
16{
22 {
23 public:
27 struct rule
28 {
30 int object;
32 bool operator == (rule const& r) const
33 {
34 if (r.operand != operand) return false;
35 if (r.object != object) return false;
36 if (r.coefficient != coefficient) return false;
37 return true;
38 }
39 };
40
45 ConvolutionMap(std::string const& name);
46
51
55 void SetRules(std::map<int, std::vector<rule>> const& rules) { _rules = rules; }
57
62
66 std::string const& GetName() const { return _name; }
67
72 std::map<int, std::vector<rule>> const& GetRules() const { return _rules; }
73
79
86
90 void Print() const { std::cout << *this << std::endl; }
92 protected:
93 std::map<int, std::vector<rule>> _rules;
94 std::string _name;
95
96 friend std::ostream& operator << (std::ostream& os, ConvolutionMap const& cm);
97 };
98
102 std::ostream& operator << (std::ostream& os, ConvolutionMap const& cm);
103}
The ConvolutionMap class encapsulates the set of rules to multiply a sets of operators with a set of ...
Definition convolutionmap.h:22
void Print() const
Print the Operator object.
Definition convolutionmap.h:90
matrix< std::vector< double > > const GetRuleMatrix() const
Retrieve the full set of rules for the multiplications in the form of a matrix.
ConvolutionMap(std::string const &name)
ConvolutionMap constructor.
std::string _name
the name of the derived class
Definition convolutionmap.h:94
std::map< int, std::vector< rule > > const & GetRules() const
Retrieve the full set of rules for the multiplications.
Definition convolutionmap.h:72
std::string const & GetName() const
Retrieve the name of the map.
Definition convolutionmap.h:66
matrix< std::vector< int > > const GetRuleIndices() const
Retrieve the operand indices of the full set of rules for the multiplications in the form of a matrix...
void SetRules(std::map< int, std::vector< rule > > const &rules)
Set the rule of the convolution map.
Definition convolutionmap.h:55
friend std::ostream & operator<<(std::ostream &os, ConvolutionMap const &cm)
Method which prints ConvolutionMap with cout <<.
std::map< int, std::vector< rule > > _rules
the map container
Definition convolutionmap.h:93
The matrix class is a simple implementation of 2d arrays based on a continous memory allocation....
Definition matrix.h:23
Namespace for all APFEL++ functions and classes.
Definition alphaqcd.h:14
std::ostream & operator<<(std::ostream &os, ConvolutionMap const &cm)
Method which prints ConvolutionMap with cout <<.
This structure contains the attribute of a single rule.
Definition convolutionmap.h:28
int object
Definition convolutionmap.h:30
bool operator==(rule const &r) const
Definition convolutionmap.h:32
double coefficient
Definition convolutionmap.h:31
int operand
Definition convolutionmap.h:29