a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
DoublyIndexedMultipleEntriesBlock.hpp
Go to the documentation of this file.
1/*
2 * DoublyIndexedMultipleEntriesBlock.hpp
3 *
4 * Created on: Apr 1, 2012 (really!)
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#ifndef DOUBLYINDEXEDMULTIPLEENTRIESBLOCK_HPP_
15#define DOUBLYINDEXEDMULTIPLEENTRIESBLOCK_HPP_
16
17#include "../../MEC/ExtendedMass.hpp"
20
21namespace LHPC
22{
23 namespace SLHA
24 {
25 /* this template class interprets all the blocks with the same name, though
26 * differing scale values, which are interpreted as having a single int
27 * index which does not have to have entries for each value (nor even
28 * necessarily positive index values), allowing for multiple entries with
29 * the same index.
30 */
31 template< class ValueClass >
33 ValueClass,
34 InterpreterClass::MultipleDoublyIndexed< ValueClass > >
35 {
36 public:
38 ValueClass const& defaultUnsetValue,
39 bool const isVerbose = false,
40 int const firstIndexDigits = 5,
41 int const secondIndexDigits = 5 );
42 virtual
44
45 std::list< ValueClass* >
46 operator()( std::pair< int, int > const& indexPair );
47 // this returns operator() of the lowest-scale interpreter.
48 std::list< ValueClass const* >
49 operator()( std::pair< int, int > const& indexPair ) const;
50 // const version of above.
51 std::list< ValueClass* >
52 operator()( int const firstIndex,
53 int const secondIndex )
54 { return (*this)( std::make_pair( firstIndex,
55 secondIndex ) ); }
56 std::list< ValueClass const* >
57 operator()( int const firstIndex,
58 int const secondIndex ) const
59 { return (*this)( std::make_pair( firstIndex,
60 secondIndex ) ); }
61 bool
62 hasEntry( std::pair< int, int > const& indexPair ) const;
63 // this returns hasEntry( indexPair ) of the lowest-scale interpreter.
64 bool
65 hasEntry( int const firstIndex,
66 int const secondIndex ) const
67 { return hasEntry( std::make_pair( firstIndex,
68 secondIndex ) ); }
69 };
70
71
72
73
74
75 template< class ValueClass >
76 inline
77 DoublyIndexedMultipleEntriesBlock< ValueClass
79 std::string const& blockName,
80 ValueClass const& defaultUnsetValue,
81 bool const isVerbose,
82 int const firstIndexDigits,
83 int const secondIndexDigits ) :
84 IndexedBlockTemplate< ValueClass,
85 InterpreterClass::MultipleDoublyIndexed< ValueClass > >(
86 blockName,
87 defaultUnsetValue,
88 isVerbose,
89 BOL::Vi( firstIndexDigits ).e( secondIndexDigits ) )
90 {
91 // just an initialization list.
92 }
93
94 template< class ValueClass >
95 inline
97 >::~DoublyIndexedMultipleEntriesBlock()
98 {
99 // does nothing.
100 }
101
102
103 template< class ValueClass >
104 inline std::list< ValueClass* >
106 std::pair< int, int > const& indexPair )
107 // this returns operator() of the lowest-scale interpreter.
108 {
109 return this->dataBlocks[ this->lowestScaleIndex ]( indexPair );
110 }
111
112 template< class ValueClass >
113 inline std::list< ValueClass const* >
115 std::pair< int, int > const& indexPair ) const
116 // const version of above.
117 {
118 return this->dataBlocks[ this->lowestScaleIndex ]( indexPair );
119 }
120
121 template< class ValueClass >
122 inline bool
124 std::pair< int, int > const& indexPair ) const
125 // this returns hasEntry( soughtIndex ) of the lowest-scale interpreter.
126 {
127 return this->dataBlocks[ this->lowestScaleIndex ].hasEntry( indexPair );
128 }
129
130 } // end of SLHA namespace
131
132} // end of LHPC namespace
133
134#endif /* DOUBLYINDEXEDMULTIPLEENTRIESBLOCK_HPP_ */
bool hasEntry(std::pair< int, int > const &indexPair) const
std::list< ValueClass const * > operator()(int const firstIndex, int const secondIndex) const
bool hasEntry(int const firstIndex, int const secondIndex) const
DoublyIndexedMultipleEntriesBlock(std::string const &blockName, ValueClass const &defaultUnsetValue, bool const isVerbose=false, int const firstIndexDigits=5, int const secondIndexDigits=5)
std::list< ValueClass * > operator()(std::pair< int, int > const &indexPair)
std::list< ValueClass * > operator()(int const firstIndex, int const secondIndex)
ValueClass const defaultUnsetValue
Definition: SlhaBlock.hpp:139
StdVectorFiller< int > Vi