97 QTableWidget*
ToTable()
override;
125 double valueAt(
const string& label)
const;
207 void append(
const string& label,
const double& val);
221 int size()
const {
return num; }
Vector class with string labels for Chemical Mass Balance analysis.
CMBVector & operator=(const CMBVector &mp)
Assignment operator from CMBVector.
CVector toVector() const
Converts to base CVector type (without labels)
QTableWidget * ToTable() override
Creates a QTableWidget for displaying vector data.
CMBVector Eliminate(const string &element) const
Creates new vector with specified element removed.
bool writetofile(QFile *file) override
Writes vector to file in CSV format.
void SetLabels(const vector< string > &label)
Sets all element labels at once.
vector< string > labels
Labels for each element.
void SetLabel(int i, const string &label)
Sets label at specified index.
QJsonObject toJsonObject() const override
Serializes vector to JSON format.
CMBVector Extract(int start, int end) const
Extracts a range of elements by index.
CMBVector ExtractWithinRange(const double &lowval, const double &highval) const
Extracts elements with values within specified range.
string MaxAbsElement() const
Finds label of element with maximum absolute value.
string ToString() const override
Converts vector to CSV-formatted string.
void SetBooleanValue(bool val)
Sets boolean display mode for table widget.
CMBVector Sort(const CMBVector &sortvector=CMBVector()) const
Sorts vector by values in descending order.
string MaxElement() const
Finds label of element with maximum value.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector from JSON format.
CMBVector ExtractUpToMinimum() const
Extracts elements up to first minimum value.
int size() const
Gets number of elements in vector.
void append(const string &label, const double &val)
Appends a labeled element to the vector.
CMBVector()
Default constructor - creates an empty vector.
bool boolean_values
Display values as Pass/Fail instead of numbers.
CMBVector AbsSort(const CMBVector &sortvector=CMBVector()) const
Sorts vector by absolute values in descending order.
double valueAt(int i) const
Gets value at specified index.
string Label(int i) const
Gets label at specified index.
vector< string > Labels() const
Gets all element labels.
int LookupLabel(const string &label) const
Finds index of element with given label.
Abstract base class providing common serialization and visualization interface.
CMBVector operator+(const CMBVector &, const CMBVector &)
Vector addition operator.
CMBVector operator*(const CMBVector &, const CMBVector &)
Element-wise vector multiplication operator.
CMBVector operator-(const CMBVector &, const CMBVector &)
Vector subtraction operator.
CMBVector operator/(const CMBVector &, double)
Vector-scalar division operator.