2 #include "../interface/MicroGMTLUT.h"
15 std::ifstream fstream;
17 if (!fstream.good()) {
19 throw cms::Exception(
"FileOpenError") <<
"Failed to open LUT file: " << inFileName;
21 int readCode =
read(fstream);
33 return data((
unsigned int) input);
35 throw cms::Exception(
"Uninitialized") <<
"If you're not loading a LUT from file you need to implement lookupPacked.";
43 std::stringstream stream;
44 stream <<
"#<header> V1 "<<m_totalInWidth<<
" "<<m_outWidth<<
" </header> "<<std::endl;
45 for (
int in = 0;
in < (1 << m_totalInWidth); ++
in) {
46 int out = lookupPacked(
in);
47 stream <<
in <<
" " << out << std::endl;
57 unsigned maxIn = (1 <<
maxWidth) - 1;
58 return (in < maxIn ? in : maxIn);
void write(std::ostream &stream) const
int load(const std::string &inFileName)
virtual int lookupPacked(int input) const
int checkedInput(unsigned in, unsigned maxWidth) const
static std::string const input
char data[epos_bytes_allocation]
void save(std::ofstream &output)