eisgenerator 2.1.x
eis::Componant Class Referenceabstract

Inherited by eis::Cap, eis::Cpe, eis::Inductor, eis::ParallelSerial, eis::Resistor, eis::TransmissionLineClosed, eis::TransmissionLineOpen, and eis::Warburg.

Public Member Functions

virtual std::complex< fvalue > execute (fvalue omega)
virtual void setParamRanges (const std::vector< eis::Range > &ranges)
virtual std::vector< eis::Range > & getParamRanges ()
virtual std::vector< eis::Range > getParamRanges () const
virtual std::vector< eis::Range > getDefaultParameters (bool range=true) const
virtual size_t paramCount () const
virtual char getComponantChar () const =0
virtual std::string getComponantString (bool currentValue=true, bool withCount=false) const
 Gets this componant as a model string.
virtual std::string componantName () const =0
virtual std::string getCode (std::vector< std::string > &parameters)
virtual std::string getTorchScript (std::vector< std::string > &parameters)
virtual bool compileable ()
std::string getUniqueName ()
bool hasDefaultedParameters () const
 Checks if this componant had to use default parameters.

Static Public Member Functions

static Componant * copy (Componant *componant)
static Componant * createNewComponant (char componant, std::string paramStr="", size_t count=1, bool defaultToRange=false)
static bool isValidComponantChar (char componant)

Protected Member Functions

void initRanges (const std::string &paramStr, size_t count, bool defaultToRange)

Protected Attributes

std::vector< eis::Range > ranges
std::string uniqueName
bool defaultedParameters = false

Member Function Documentation

◆ getComponantString()

virtual std::string eis::Componant::getComponantString ( bool currentValue = true,
bool withCount = false ) const
virtual

Gets this componant as a model string.

Parameters
currentValueIf true, the current step value of each parameter is printed instead of its range.
withCountIf true and currentValue is false, the sweep step count is appended to each range as start~endL:count, so that the string round trips through eis::Range::fromString. Ignored for current values.

Reimplemented in eis::Parallel, and eis::Serial.

◆ hasDefaultedParameters()

bool eis::Componant::hasDefaultedParameters ( ) const
inline

Checks if this componant had to use default parameters.

True when the model string did not carry a value for every parameter of this componant and the defaults were used instead.

Returns
True if any parameter of this componant was defaulted.