|
SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
|
Vector class with string labels for Chemical Mass Balance analysis. More...
#include </home/runner/work/SedSat3/SedSat3/cmbvector.h>


Public Member Functions | |
| CMBVector () | |
| Default constructor - creates an empty vector. | |
| CMBVector (int n) | |
| Constructs a vector with given size. | |
| CMBVector (const CMBVector &mp) | |
| Copy constructor from CMBVector. | |
| CMBVector (const CVector_arma &mp) | |
| Constructs from Armadillo vector. | |
| CMBVector & | operator= (const CMBVector &mp) |
| Assignment operator from CMBVector. | |
| CMBVector (const CVector &mp) | |
| Constructs from base CVector. | |
| CMBVector & | operator= (const CVector &mp) |
| Assignment operator from base CVector. | |
| CMBVector & | operator= (const CVector_arma &mp) |
| Assignment operator from Armadillo vector. | |
| QJsonObject | toJsonObject () const override |
| Serializes vector to JSON format. | |
| bool | ReadFromJsonObject (const QJsonObject &jsonobject) override |
| Deserializes vector from JSON format. | |
| string | ToString () const override |
| Converts vector to CSV-formatted string. | |
| QTableWidget * | ToTable () override |
| Creates a QTableWidget for displaying vector data. | |
| bool | writetofile (QFile *file) override |
| Writes vector to file in CSV format. | |
| double | valueAt (int i) const |
| Gets value at specified index. | |
| string | Label (int i) const |
| Gets label at specified index. | |
| double | valueAt (const string &label) const |
| Gets value by element label. | |
| int | LookupLabel (const string &label) const |
| Finds index of element with given label. | |
| vector< string > | Labels () const |
| Gets all element labels. | |
| void | SetLabel (int i, const string &label) |
| Sets label at specified index. | |
| void | SetLabels (const vector< string > &label) |
| Sets all element labels at once. | |
| void | SetBooleanValue (bool val) |
| Sets boolean display mode for table widget. | |
| CVector | toVector () const |
| Converts to base CVector type (without labels) | |
| CMBVector | Sort (const CMBVector &sortvector=CMBVector()) const |
| Sorts vector by values in descending order. | |
| CMBVector | AbsSort (const CMBVector &sortvector=CMBVector()) const |
| Sorts vector by absolute values in descending order. | |
| string | MaxElement () const |
| Finds label of element with maximum value. | |
| string | MaxAbsElement () const |
| Finds label of element with maximum absolute value. | |
| CMBVector | Eliminate (const string &element) const |
| Creates new vector with specified element removed. | |
| void | append (const string &label, const double &val) |
| Appends a labeled element to the vector. | |
| CMBVector | Extract (int start, int end) const |
| Extracts a range of elements by index. | |
| int | size () const |
| Gets number of elements in vector. | |
| CMBVector | ExtractWithinRange (const double &lowval, const double &highval) const |
| Extracts elements with values within specified range. | |
| CMBVector | ExtractUpToMinimum () const |
| Extracts elements up to first minimum value. | |
Public Member Functions inherited from Interface | |
| Interface () | |
| Default constructor. | |
| Interface (const Interface &intf) | |
| Copy constructor. | |
| Interface & | operator= (const Interface &intf) |
| Assignment operator. | |
| virtual bool | Read (const QStringList &strlist) |
| Parse object data from a string list. | |
| string | GetNotes () const |
| Get the notes/annotations associated with this object. | |
| void | SetNotes (const string ¬e) |
| Set the notes for this object, replacing any existing notes. | |
| void | AppendtoNotes (const string ¬e) |
| Append a note to existing notes. | |
| void | ClearNotes () |
| Clear all notes associated with this object. | |
| void | SetLimit (_range lowhigh, const double &value) |
| Set upper or lower limit for value highlighting. | |
| void | SetOption (options_key opt, bool val) |
| Set a configuration option. | |
| bool | Option (options_key opt) |
| Get the current value of a configuration option. | |
| options & | GetOptions () |
| Get reference to the options structure. | |
| QString | XAxisLabel () const |
| Get the X-axis label. | |
| QString | YAxisLabel () const |
| Get the Y-axis label. | |
| bool | SetXAxisLabel (const QString &label) |
| Set the X-axis label. | |
| bool | SetYAxisLabel (const QString &label) |
| Set the Y-axis label. | |
Private Attributes | |
| vector< string > | labels |
| Labels for each element. | |
| bool | boolean_values = false |
| Display values as Pass/Fail instead of numbers. | |
Additional Inherited Members | |
Public Attributes inherited from Interface | |
| double | lowlimit |
| Lower threshold for value highlighting (when enabled) | |
| double | highlimit |
| Upper threshold for value highlighting (when enabled) | |
| bool | highlightoutsideoflimit = false |
| Flag indicating whether to highlight values outside defined limits. | |
Vector class with string labels for Chemical Mass Balance analysis.
Extends CVector with element labels, JSON serialization, table widget generation, and specialized operations for CMB calculations. Supports both numeric and boolean display modes, sorting operations, and range-based extraction.
Definition at line 16 of file cmbvector.h.
| CMBVector::CMBVector | ( | ) |
Default constructor - creates an empty vector.
Definition at line 6 of file cmbvector.cpp.
| CMBVector::CMBVector | ( | int | n | ) |
Constructs a vector with given size.
| n | Number of elements |
Definition at line 32 of file cmbvector.cpp.
References labels.
| CMBVector::CMBVector | ( | const CMBVector & | mp | ) |
Copy constructor from CMBVector.
| mp | Vector to copy from |
Definition at line 11 of file cmbvector.cpp.
References boolean_values, Interface::highlightoutsideoflimit, Interface::highlimit, labels, and Interface::lowlimit.
| CMBVector::CMBVector | ( | const CVector_arma & | mp | ) |
Constructs from Armadillo vector.
| mp | Armadillo vector to copy from |
Definition at line 26 of file cmbvector.cpp.
References labels.
| CMBVector::CMBVector | ( | const CVector & | mp | ) |
Constructs from base CVector.
| mp | Base vector to copy from |
Definition at line 21 of file cmbvector.cpp.
References labels.
Sorts vector by absolute values in descending order.
| sortvector | Optional vector to use for sorting order (default: sort by self) |
Definition at line 219 of file cmbvector.cpp.
References append(), Eliminate(), MaxAbsElement(), and valueAt().
| void CMBVector::append | ( | const string & | label, |
| const double & | val | ||
| ) |
Appends a labeled element to the vector.
| label | Element label |
| val | Element value |
Definition at line 272 of file cmbvector.cpp.
References labels, and size().
Referenced by AbsSort(), Eliminate(), Conductor::ExecuteSDFAM(), Extract(), ExtractUpToMinimum(), ExtractWithinRange(), Sort(), Elemental_Profile::SortByConcentration(), SourceSinkData::StepwiseDiscriminantFunctionAnalysis(), and SourceSinkData::StepwiseDiscriminantFunctionAnalysis().
| CMBVector CMBVector::Extract | ( | int | start, |
| int | end | ||
| ) | const |
| CMBVector CMBVector::ExtractUpToMinimum | ( | ) | const |
Extracts elements up to first minimum value.
Returns elements from start until the first element whose value is less than the previous element's value.
Definition at line 291 of file cmbvector.cpp.
References append(), labels, size(), and valueAt().
Referenced by Conductor::ExecuteSDFAM().
| CMBVector CMBVector::ExtractWithinRange | ( | const double & | lowval, |
| const double & | highval | ||
| ) | const |
Extracts elements with values within specified range.
| lowval | Lower bound (exclusive) |
| highval | Upper bound (exclusive) |
Definition at line 280 of file cmbvector.cpp.
References append(), labels, size(), and valueAt().
Referenced by Conductor::ExecuteANOVA().
|
inline |
Gets label at specified index.
| i | Element index |
Definition at line 118 of file cmbvector.h.
References labels.
Referenced by Eliminate(), Extract(), MaxAbsElement(), MaxElement(), Elemental_Profile::SelectTopElements(), and Elemental_Profile_Set::SelectTopElementsAggregate().
Gets all element labels.
Definition at line 138 of file cmbvector.h.
References labels.
Referenced by Conductor::ExecuteANOVA(), Conductor::ExecuteSDFAM(), operator*(), operator*(), operator+(), operator+(), operator+(), operator-(), operator-(), operator-(), operator/(), and GeneralChart::PlotVector().
| int CMBVector::LookupLabel | ( | const string & | label | ) | const |
Finds index of element with given label.
| label | Element label to find |
Definition at line 149 of file cmbvector.cpp.
References labels.
| string CMBVector::MaxAbsElement | ( | ) | const |
Finds label of element with maximum absolute value.
Definition at line 248 of file cmbvector.cpp.
References Label(), and valueAt().
Referenced by AbsSort().
| string CMBVector::MaxElement | ( | ) | const |
Finds label of element with maximum value.
Definition at line 235 of file cmbvector.cpp.
References Label(), and valueAt().
Referenced by Sort().
Assignment operator from CMBVector.
| mp | Vector to assign from |
Definition at line 38 of file cmbvector.cpp.
References boolean_values, Interface::highlightoutsideoflimit, Interface::highlimit, labels, and Interface::lowlimit.
| CMBVector & CMBVector::operator= | ( | const CVector & | mp | ) |
Assignment operator from base CVector.
| mp | Vector to assign from |
Definition at line 57 of file cmbvector.cpp.
References labels.
| CMBVector & CMBVector::operator= | ( | const CVector_arma & | mp | ) |
Assignment operator from Armadillo vector.
| mp | Armadillo vector to assign from |
Definition at line 50 of file cmbvector.cpp.
References labels.
|
overridevirtual |
Deserializes vector from JSON format.
| jsonobject | JSON object to read from |
Reimplemented from Interface.
Definition at line 81 of file cmbvector.cpp.
References labels, and Interface::SetXAxisLabel().
Referenced by Results::ReadFromJson(), and CMBVectorSet::ReadFromJsonObject().
|
inline |
Sets boolean display mode for table widget.
When true, values are displayed as "Pass" (0) or "Fail" (1) instead of numeric values.
| val | True to enable boolean display mode |
Definition at line 161 of file cmbvector.h.
References boolean_values.
Referenced by Conductor::ExecuteBracketingAnalysis().
|
inline |
Sets label at specified index.
| i | Element index |
| label | Label string to set |
Definition at line 145 of file cmbvector.h.
References labels.
Referenced by SourceSinkData::BracketTest(), Elemental_Profile_Set::CalculateBoxCoxParameters(), Elemental_Profile_Set::CalculateDotProduct(), SourceSinkData::DFATransformed(), and SourceSinkData::DiscriminantFunctionAnalysis().
Sets all element labels at once.
| label | Vector of label strings |
Definition at line 151 of file cmbvector.h.
References labels.
Referenced by SourceSinkData::ANOVA(), Elemental_Profile_Set::CalculateKolmogorovSmirnovStatistics(), SourceSinkData::DFA_eigvector(), SourceSinkData::DFA_weight_vector(), CMBMatrix::GetColumn(), CMBMatrix::GetRow(), SourceSinkData::MeanElementalContent(), SourceSinkData::MeanElementalContent(), operator*(), operator*(), operator*(), operator+(), operator+(), operator+(), operator-(), operator-(), operator-(), operator/(), and SourceSinkData::OptimalBoxCoxParameters().
|
inline |
Gets number of elements in vector.
Definition at line 221 of file cmbvector.h.
Referenced by append(), SourceSinkData::BetweenGroupCovarianceMatrix(), SourceSinkData::BracketTest(), SourceSinkData::DiscriminantFunctionAnalysis(), ExtractUpToMinimum(), ExtractWithinRange(), operator-(), and SourceSinkData::TotalScatterMatrix().
Sorts vector by values in descending order.
| sortvector | Optional vector to use for sorting order (default: sort by self) |
Definition at line 203 of file cmbvector.cpp.
References append(), Eliminate(), MaxElement(), and valueAt().
|
overridevirtual |
Serializes vector to JSON format.
Reimplemented from Interface.
Definition at line 65 of file cmbvector.cpp.
References labels, valueAt(), vector, Interface::XAxisLabel(), and Interface::YAxisLabel().
|
overridevirtual |
Converts vector to CSV-formatted string.
Reimplemented from Interface.
Definition at line 107 of file cmbvector.cpp.
References boolean_values, labels, valueAt(), Interface::XAxisLabel(), and Interface::YAxisLabel().
Referenced by CMBVectorSet::ToString(), and writetofile().
|
overridevirtual |
Creates a QTableWidget for displaying vector data.
Generates a read-only table widget with labeled rows. Highlights values outside limit range if highlighting is enabled. Displays as "Pass"/"Fail" if boolean mode is set.
Reimplemented from Interface.
Definition at line 157 of file cmbvector.cpp.
References boolean_values, Interface::highlightoutsideoflimit, Interface::highlimit, labels, Interface::lowlimit, valueAt(), and Interface::YAxisLabel().
| CVector CMBVector::toVector | ( | ) | const |
Converts to base CVector type (without labels)
Definition at line 196 of file cmbvector.cpp.
Referenced by operator*().
| double CMBVector::valueAt | ( | const string & | label | ) | const |
Gets value by element label.
| label | Element label to find |
Definition at line 141 of file cmbvector.cpp.
| double CMBVector::valueAt | ( | int | i | ) | const |
Gets value at specified index.
| i | Element index |
Definition at line 136 of file cmbvector.cpp.
Referenced by AbsSort(), SourceSinkData::BracketTest(), Eliminate(), Conductor::ExecuteSDFAM(), Extract(), ExtractUpToMinimum(), ExtractWithinRange(), MaxAbsElement(), MaxElement(), Sort(), toJsonObject(), ToString(), ToTable(), and valueAt().
|
overridevirtual |
Writes vector to file in CSV format.
| file | File pointer to write to |
Reimplemented from Interface.
Definition at line 130 of file cmbvector.cpp.
References ToString().
|
private |
Display values as Pass/Fail instead of numbers.
Definition at line 243 of file cmbvector.h.
Referenced by CMBVector(), operator=(), SetBooleanValue(), ToString(), and ToTable().
Labels for each element.
Definition at line 242 of file cmbvector.h.
Referenced by CMBVector(), CMBVector(), CMBVector(), CMBVector(), append(), ExtractUpToMinimum(), ExtractWithinRange(), Label(), Labels(), LookupLabel(), operator=(), operator=(), operator=(), ReadFromJsonObject(), SetLabel(), SetLabels(), toJsonObject(), ToString(), ToTable(), and valueAt().