eisgenerator 1.0.x
|
Public Member Functions | |
EisSpectra (const std::vector< DataPoint > &data, const std::string &model, const std::string &header, std::vector< double > labels=std::vector< double >(), std::vector< std::string > labelNames=std::vector< std::string >()) | |
Constructs an EisSpectra. | |
EisSpectra (const std::vector< DataPoint > &data, const std::string &model, const std::string &header, std::vector< float > labels, std::vector< std::string > labelNames=std::vector< std::string >()) | |
Constructs an EisSpectra. | |
EisSpectra (const std::vector< DataPoint > &data, const std::string &model, const std::string &header, std::vector< size_t > labels, std::vector< std::string > labelNames=std::vector< std::string >()) | |
Constructs an EisSpectra. | |
EisSpectra (const std::vector< DataPoint > &data, const std::string &model, const std::string &header, size_t label, size_t maxLabel, std::vector< std::string > labelNames=std::vector< std::string >()) | |
Constructs an EisSpectra. | |
EisSpectra (const std::filesystem::path &path) | |
Constructs a EisSpectra by loading an EIS file from disk. | |
void | setLabel (size_t label, size_t maxLabel) |
Sets all input values up to a maximum given by maxLabel to the value given by label. | |
size_t | getLabel () |
Gets the input value of this model, where it is a single value. | |
void | setSzLabels (std::vector< size_t > label) |
Sets the input values of this model. | |
void | setLabels (const std::vector< double > &labelsIn) |
Sets the input values of this model. | |
void | setLabels (const std::vector< float > &labelsIn) |
Sets the input values of this model. | |
std::vector< size_t > | getSzLabels () const |
Sets the input values of this model. | |
bool | isMulticlass () |
Returns true if there are multiple inputs, false otherwise. | |
std::vector< fvalue > | getFvalueLabels () |
Returns the inputs as a vector. | |
bool | saveToDisk (const std::filesystem::path &path) const |
Saves the spectra to disk. | |
void | saveToStream (std::ostream &stream) const |
Saves the spectra in the given stream. | |
Static Public Member Functions | |
static EisSpectra | loadFromDisk (const std::filesystem::path &path) |
Constructs a EisSpectra by loading a EIS file from disk. | |
static EisSpectra | loadFromStream (std::istream &stream) |
Constructs a EisSpectra by loading a EIS file from a stream. | |
Public Attributes | |
std::vector< DataPoint > | data |
std::string | model |
std::string | header |
std::vector< double > | labels |
std::vector< std::string > | labelNames |
Static Public Attributes | |
static constexpr int | F_VERSION_MAJOR = 1 |
static constexpr int | F_VERSION_MINOR = 0 |
static constexpr int | F_VERSION_PATCH = 0 |
static constexpr char | F_MAGIC [] = "EISF" |
eis::EisSpectra::EisSpectra | ( | const std::vector< DataPoint > & | data, |
const std::string & | model, | ||
const std::string & | header, | ||
std::vector< double > | labels = std::vector< double >(), | ||
std::vector< std::string > | labelNames = std::vector< std::string >() ) |
Constructs an EisSpectra.
data | Vector of the data points of the spectra. |
model | Model description string for this spectra. |
header | A free-form text that will be included in any save of this spectra. |
labels | An optional vector of giving the values of the inputs of the model to get this spectra. |
labelNames | An optional vector of names describing every input of the model. |
eis::EisSpectra::EisSpectra | ( | const std::vector< DataPoint > & | data, |
const std::string & | model, | ||
const std::string & | header, | ||
std::vector< float > | labels, | ||
std::vector< std::string > | labelNames = std::vector< std::string >() ) |
Constructs an EisSpectra.
This function differs from the above only in the datatype of the label.
data | Vector of the data points of the spectra. |
model | Model description string for this spectra. |
header | A free-form text that will be included in any save of this spectra. |
labels | An optional vector of giving the values of the inputs of the model to get this spectra. |
labelNames | An optional vector of names describing every input of the model. |
eis::EisSpectra::EisSpectra | ( | const std::vector< DataPoint > & | data, |
const std::string & | model, | ||
const std::string & | header, | ||
std::vector< size_t > | labels, | ||
std::vector< std::string > | labelNames = std::vector< std::string >() ) |
Constructs an EisSpectra.
This function differs from the above only in the datatype of the label.
data | Vector of the data points of the spectra. |
model | Model description string for this spectra. |
header | A free-from text that will be included in any save of this spectra. |
labels | An optional vector of giving the values of the inputs of the model to get this spectra. |
labelNames | An optional vector of names describing every input of the model. |
eis::EisSpectra::EisSpectra | ( | const std::vector< DataPoint > & | data, |
const std::string & | model, | ||
const std::string & | header, | ||
size_t | label, | ||
size_t | maxLabel, | ||
std::vector< std::string > | labelNames = std::vector< std::string >() ) |
Constructs an EisSpectra.
This function differs from the above only in the datatype of the label.
data | Vector of the data points of the spectra. |
model | Model description string for this spectra. |
header | A free-form text that will be included in any save of this spectra. |
label | A value corresponding to all inputs of the model. |
maxLabel | The number of inputs of the model. |
|
inline |
Constructs a EisSpectra by loading an EIS file from disk.
eis::file_error | if there is an error loading the file |
path | The path to the file. |
References loadFromDisk().
std::vector< fvalue > eis::EisSpectra::getFvalueLabels | ( | ) |
Returns the inputs as a vector.
size_t eis::EisSpectra::getLabel | ( | ) |
Gets the input value of this model, where it is a single value.
std::vector< size_t > eis::EisSpectra::getSzLabels | ( | ) | const |
Sets the input values of this model.
label | The input values. |
bool eis::EisSpectra::isMulticlass | ( | ) |
Returns true if there are multiple inputs, false otherwise.
|
static |
Constructs a EisSpectra by loading a EIS file from disk.
This function has the attribute [[nodiscard]]
eis::file_error | if there is an error loading the file |
path | The path to the file. |
Referenced by EisSpectra().
|
static |
Constructs a EisSpectra by loading a EIS file from a stream.
This function has the attribute [[nodiscard]]
eis::file_error | if there is an error loading the file |
stream | The stream that contains the EIS file. |
bool eis::EisSpectra::saveToDisk | ( | const std::filesystem::path & | path | ) | const |
Saves the spectra to disk.
path | A path to the file on disk where the spectra shall be saved. |
void eis::EisSpectra::saveToStream | ( | std::ostream & | stream | ) | const |
Saves the spectra in the given stream.
stream | A std::ostream into which the spectra will be saved. |
void eis::EisSpectra::setLabel | ( | size_t | label, |
size_t | maxLabel ) |
Sets all input values up to a maximum given by maxLabel to the value given by label.
label | The value to apply to all inputs. |
maxLabel | The maximum number of values to set. |
void eis::EisSpectra::setLabels | ( | const std::vector< double > & | labelsIn | ) |
Sets the input values of this model.
label | The input values. |
void eis::EisSpectra::setLabels | ( | const std::vector< float > & | labelsIn | ) |
Sets the input values of this model.
label | The input values. |
void eis::EisSpectra::setSzLabels | ( | std::vector< size_t > | label | ) |
Sets the input values of this model.
label | The input values. |