25 #include <logger/Log.hpp>
42 char sample = *sample_;
46 LOG(LERROR) <<
"Could not properly encode character '" <<sample <<
"' ("<<a<<
")!";
48 LOG(LERROR) <<
"The SDR is too short for proper encoding of the character '" <<sample <<
"' ("<<a<<
")!";
56 assert(sdr_->cols() == 1);
59 mic::types::MatrixXf::Index maxRow, maxCol;
60 float max_value = sdr_->maxCoeff(&maxRow, &maxCol);
61 LOG(LDEBUG) <<
"(maxRow, maxCol) = max_value [ (" << maxRow <<
"," << maxCol <<
") = " << max_value <<
"]";
64 char decoded = maxRow + 32;
66 return std::make_shared<char>(decoded);
std::shared_ptr< mic::types::MatrixXf > MatrixXfPtr
Shared pointer to matrix with single precision floats (of dynamic size).
virtual std::shared_ptr< char > decodeSample(const mic::types::MatrixXfPtr &sdr_)
size_t sdr_length
Length of SDR.
virtual mic::types::MatrixXfPtr encodeSample(const std::shared_ptr< char > &sample_)
Method responsible for encoding of input data sample into SDR (a vector of floats).
Template-typed Matrix of dynamic size. Uses OpenBLAS if found by CMAKE - overloaded, specializations of * operator for types: float, double.