a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
DenseTriplyIndexedBlock.hpp
Go to the documentation of this file.
1/*
2 * DenseTriplyIndexedBlock.hpp
3 *
4 * Created on: Mar 12, 2012
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 DENSETRIPLYINDEXEDBLOCK_HPP_
15#define DENSETRIPLYINDEXEDBLOCK_HPP_
16
19
20namespace LHPC
21{
22 namespace SLHA
23 {
24 /* this template class interprets all the blocks with the same name, though
25 * differing scale values, which are interpreted as having a triple of int
26 * indices which have to have entries for each value, each index beginning
27 * at 1.
28 */
29 template< class ValueClass >
31 InterpreterClass::DenseTriplyIndexed< ValueClass > >
32 {
33 public:
34 DenseTriplyIndexedBlock( std::string const& blockName,
35 ValueClass const& defaultUnsetValue,
36 bool const isVerbose = false,
37 int const firstIndexDigits = 2,
38 int const secondIndexDigits = 2,
39 int const thirdIndexDigits = 2 );
40 virtual
42
43 ValueClass&
44 operator()( int const firstIndex,
45 int const secondIndex,
46 int const thirdIndex );
47 // this returns operator() of the lowest-scale interpreter.
48 ValueClass const&
49 operator()( int const firstIndex,
50 int const secondIndex,
51 int const thirdIndex ) const;
52 // const version of above.
53 bool
54 hasEntry( int const firstIndex,
55 int const secondIndex,
56 int const thirdIndex ) const;
57 // this returns hasEntry( firstIndex, secondIndex, thirdIndex ) of the
58 // lowest-scale interpreter.
59 };
60
61
62
63
64
65 template< class ValueClass >
66 inline
68 std::string const& blockName,
69 ValueClass const& defaultUnsetValue,
70 bool const isVerbose,
71 int const firstIndexDigits,
72 int const secondIndexDigits,
73 int const thirdIndexDigits ) :
74 IndexedBlockTemplate< ValueClass,
75 InterpreterClass::DenseTriplyIndexed< ValueClass > >(
76 blockName,
77 defaultUnsetValue,
78 isVerbose,
79 BOL::Vi( firstIndexDigits )(
80 secondIndexDigits ).e(
81 thirdIndexDigits ) )
82 {
83 // just an initialization list.
84 }
85
86 template< class ValueClass >
87 inline
89 {
90 // does nothing.
91 }
92
93
94 template< class ValueClass >
95 inline ValueClass&
97 int const secondIndex,
98 int const thirdIndex )
99 // this returns operator() of the lowest-scale interpreter.
100 {
101 return this->dataBlocks[ this->lowestScaleIndex ]( firstIndex,
102 secondIndex,
103 thirdIndex );
104 }
105
106 template< class ValueClass >
107 inline ValueClass const&
109 int const secondIndex,
110 int const thirdIndex ) const
111 // const version of above.
112 {
113 return this->dataBlocks[ this->lowestScaleIndex ]( firstIndex,
114 secondIndex,
115 thirdIndex );
116 }
117
118 template< class ValueClass >
119 inline bool
121 int const secondIndex,
122 int const thirdIndex ) const
123 // this returns hasEntry( firstIndex, secondIndex, thirdIndex ) of the
124 // lowest-scale interpreter.
125 {
126 return this->dataBlocks[ this->lowestScaleIndex ].hasEntry( firstIndex,
127 secondIndex,
128 thirdIndex );
129 }
130
131 } // end of SLHA namespace
132
133} // end of LHPC namespace
134
135
136#endif /* DENSETRIPLYINDEXEDBLOCK_HPP_ */
DenseTriplyIndexedBlock(std::string const &blockName, ValueClass const &defaultUnsetValue, bool const isVerbose=false, int const firstIndexDigits=2, int const secondIndexDigits=2, int const thirdIndexDigits=2)
bool hasEntry(int const firstIndex, int const secondIndex, int const thirdIndex) const
ValueClass & operator()(int const firstIndex, int const secondIndex, int const thirdIndex)
ValueClass const defaultUnsetValue
Definition: SlhaBlock.hpp:139
StdVectorFiller< int > Vi