APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
grid.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/subgrid.h"
10
11#include <memory>
12
13namespace apfel
14{
21 class Grid
22 {
23 public:
28 Grid(std::vector<SubGrid> const& grs);
29
34
37 int nGrids() const { return _GlobalGrid.size(); }
38
42 std::vector<std::pair<int, int>> const& SubToJointMap() const { return _SubToJointMap; }
43
47 std::vector<std::vector<int>> const& JointToSubMap() const { return _JointToSubMap; }
48
52 std::vector<int> const& TransitionPoints() const { return _TransPoints; }
53
57 std::vector<SubGrid> const& GetSubGrids() const { return _GlobalGrid; }
58
62 SubGrid const& GetSubGrid(int ig) const { return _GlobalGrid[ig]; }
63
67 SubGrid const& GetJointGrid() const { return *_JointGrid; }
68
72 void Print() const { std::cout << *this << std::endl; }
74
80 bool operator == (Grid const& g) const;
81 bool operator != (Grid const& g) const;
83
84 private:
91
92 private:
93 std::vector<std::pair<int, int>> _SubToJointMap;
94 std::vector<std::vector<int>> _JointToSubMap;
95 std::vector<int> _TransPoints;
96 std::vector<SubGrid> _GlobalGrid;
97 std::unique_ptr<SubGrid> _JointGrid;
98
99 friend std::ostream& operator << (std::ostream& os, Grid const& gr);
100 };
101
106 std::ostream& operator << (std::ostream& os, Grid const& gr);
107}
The Grid class defines ab object that is essentially a collection of "SubGrid" objects plus other glo...
Definition grid.h:22
std::vector< std::pair< int, int > > const & SubToJointMap() const
Definition grid.h:42
std::vector< std::pair< int, int > > _SubToJointMap
Vector of pairs corresponding to grid- and node-indices on the subgrids.
Definition grid.h:93
std::vector< int > _TransPoints
Vector of indices corresponding to the transition from one subgrid to the other.
Definition grid.h:95
std::vector< SubGrid > const & GetSubGrids() const
Definition grid.h:57
std::vector< std::vector< int > > const & JointToSubMap() const
Definition grid.h:47
int nGrids() const
Definition grid.h:37
bool operator!=(Grid const &g) const
friend std::ostream & operator<<(std::ostream &os, Grid const &gr)
Overload the << operator to print the parameters of the grid.
void Print() const
Print the Grid object.
Definition grid.h:72
SubGrid CreateJointGrid()
Fill in the joint grid object with the appropriate grid nodes.
Grid(std::vector< SubGrid > const &grs)
The Grid constructor.
std::unique_ptr< SubGrid > _JointGrid
Container for the joint grid.
Definition grid.h:97
std::vector< std::vector< int > > _JointToSubMap
Vector of indices from the subgrids to the joint grid.
Definition grid.h:94
bool operator==(Grid const &g) const
std::vector< SubGrid > _GlobalGrid
Vector with sub-grids.
Definition grid.h:96
SubGrid const & GetJointGrid() const
Definition grid.h:67
std::vector< int > const & TransitionPoints() const
Definition grid.h:52
SubGrid const & GetSubGrid(int ig) const
Definition grid.h:62
Class for the x-space interpolation SubGrids.
Definition subgrid.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 <<.