a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
TriplyIndexedMultipleEntriesBlock.hpp
Go to the documentation of this file.
1/*
2 * TriplyIndexedMultipleEntriesBlock.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 TRIPLYINDEXEDMULTIPLEENTRIESBLOCK_HPP_
15#define TRIPLYINDEXEDMULTIPLEENTRIESBLOCK_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::MultipleTriplyIndexed< ValueClass > >
35 {
36 public:
38 ValueClass const& defaultUnsetValue,
39 bool const isVerbose = false,
40 int const firstIndexDigits = 5,
41 int const secondIndexDigits = 5,
42 int const thirdIndexDigits = 5 );
43 virtual
45
46 std::list< ValueClass* >
47 operator()( std::pair< std::pair< int, int >, int > const& indexTriple );
48 // this returns operator() of the lowest-scale interpreter.
49 std::list< ValueClass const* >
51 std::pair< std::pair< int, int >, int > const& indexTriple ) const;
52 // const version of above.
53 std::list< ValueClass* >
54 operator()( int const firstIndex,
55 int const secondIndex,
56 int const thirdIndex )
57 { return (*this)( std::make_pair( std::make_pair( firstIndex,
58 secondIndex ),
59 thirdIndex ) ); }
60 std::list< ValueClass const* >
61 operator()( int const firstIndex,
62 int const secondIndex,
63 int const thirdIndex ) const
64 { return (*this)( std::make_pair( std::make_pair( firstIndex,
65 secondIndex ),
66 thirdIndex ) ); }
67 bool
69 std::pair< std::pair< int, int >, int > const& indexTriple ) const;
70 // this returns hasEntry( indexTriple ) of the lowest-scale interpreter.
71 bool
72 hasEntry( int const firstIndex,
73 int const secondIndex,
74 int const thirdIndex ) const
75 { return hasEntry( std::make_pair( std::make_pair( firstIndex,
76 secondIndex ),
77 thirdIndex ) ); }
78 };
79
80
81
82
83
84 template< class ValueClass >
85 inline
86 TriplyIndexedMultipleEntriesBlock< ValueClass
88 std::string const& blockName,
89 ValueClass const& defaultUnsetValue,
90 bool const isVerbose,
91 int const firstIndexDigits,
92 int const secondIndexDigits,
93 int const thirdIndexDigits ) :
94 IndexedBlockTemplate< ValueClass,
95 InterpreterClass::MultipleTriplyIndexed< ValueClass > >(
96 blockName,
97 defaultUnsetValue,
98 isVerbose,
99 BOL::Vi( firstIndexDigits
100 )( secondIndexDigits
101 ).e( thirdIndexDigits ) )
102 {
103 // just an initialization list.
104 }
105
106 template< class ValueClass >
107 inline
109 >::~TriplyIndexedMultipleEntriesBlock()
110 {
111 // does nothing.
112 }
113
114
115 template< class ValueClass >
116 inline std::list< ValueClass* >
118 std::pair< std::pair< int, int >, int > const& indexTriple )
119 // this returns operator() of the lowest-scale interpreter.
120 {
121 return this->dataBlocks[ this->lowestScaleIndex ]( indexTriple );
122 }
123
124 template< class ValueClass >
125 inline std::list< ValueClass const* >
127 std::pair< std::pair< int, int >, int > const& indexTriple ) const
128 // const version of above.
129 {
130 return this->dataBlocks[ this->lowestScaleIndex ]( indexTriple );
131 }
132
133 template< class ValueClass >
134 inline bool
136 std::pair< std::pair< int, int >, int > const& indexTriple ) const
137 // this returns hasEntry( soughtIndex ) of the lowest-scale interpreter.
138 {
139 return
140 this->dataBlocks[ this->lowestScaleIndex ].hasEntry( indexTriple );
141 }
142
143 } // end of SLHA namespace
144
145} // end of LHPC namespace
146
147#endif /* TRIPLYINDEXEDMULTIPLEENTRIESBLOCK_HPP_ */
ValueClass const defaultUnsetValue
Definition: SlhaBlock.hpp:139
std::list< ValueClass const * > operator()(int const firstIndex, int const secondIndex, int const thirdIndex) const
bool hasEntry(std::pair< std::pair< int, int >, int > const &indexTriple) const
std::list< ValueClass * > operator()(std::pair< std::pair< int, int >, int > const &indexTriple)
std::list< ValueClass * > operator()(int const firstIndex, int const secondIndex, int const thirdIndex)
bool hasEntry(int const firstIndex, int const secondIndex, int const thirdIndex) const
TriplyIndexedMultipleEntriesBlock(std::string const &blockName, ValueClass const &defaultUnsetValue, bool const isVerbose=false, int const firstIndexDigits=5, int const secondIndexDigits=5, int const thirdIndexDigits=5)
StdVectorFiller< int > Vi