2 #include "../interface/MicroGMTLUT.h"
22 std::ifstream fstream;
24 if (!fstream.good()) {
26 throw cms::Exception(
"FileOpenError") <<
"Failed to open LUT file: " << inFileName;
28 int readCode =
read(fstream);
40 return data((
unsigned int) input);
42 throw cms::Exception(
"Uninitialized") <<
"If you're not loading a LUT from file you need to implement lookupPacked.";
50 std::stringstream stream;
51 stream <<
"#<header> V1 "<<m_totalInWidth<<
" "<<m_outWidth<<
" </header> "<<std::endl;
52 for (
int in = 0;
in < (1 << m_totalInWidth); ++
in) {
53 int out = lookupPacked(
in);
54 stream <<
in <<
" " << out << std::endl;
64 unsigned maxIn = (1 <<
maxWidth) - 1;
65 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
int read(std::istream &stream)
void save(std::ofstream &output)