16 std::ifstream fstream;
18 if (!fstream.good()) {
20 throw cms::Exception(
"FileOpenError") <<
"Failed to open LUT file: " << inFileName;
22 int readCode =
read(fstream);
32 return data((
unsigned int)input);
34 throw cms::Exception(
"Uninitialized") <<
"If you're not loading a LUT from file you need to implement lookupPacked.";
40 std::stringstream stream;
44 stream <<
in <<
" " << out << std::endl;
52 unsigned maxIn = (1 <<
maxWidth) - 1;
53 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)
int data(unsigned int address) const