|
SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
|
Matrix class with labeled rows and columns for Chemical Mass Balance analysis. More...
#include </home/runner/work/SedSat3/SedSat3/cmbmatrix.h>


Public Member Functions | |
| CMBMatrix () | |
| Default constructor - creates an empty matrix. | |
| CMBMatrix (int n) | |
| Constructs a square matrix with given dimension. | |
| CMBMatrix (int n, int m) | |
| Constructs a rectangular matrix with given dimensions. | |
| CMBMatrix (const CMBMatrix &mp) | |
| Copy constructor. | |
| CMatrix | toMatrix () const |
| Converts to base CMatrix type (without labels) | |
| CMBMatrix & | operator= (const CMBMatrix &mp) |
| Assignment operator. | |
| QJsonObject | toJsonObject () const override |
| Serializes matrix to JSON format. | |
| bool | ReadFromJsonObject (const QJsonObject &jsonobject) override |
| Deserializes matrix from JSON format. | |
| string | ToString () const override |
| Converts matrix to CSV-formatted string. | |
| bool | writetofile (QFile *file) override |
| Writes matrix to file in CSV format. | |
| double | valueAt (int i, int j) const |
| Gets value at specified matrix position. | |
| string | ColumnLabel (int i) |
| Gets column label at specified index. | |
| string | RowLabel (int i) |
| Gets row label at specified index. | |
| void | SetColumnLabel (int i, const string &label) |
| Sets column label at specified index. | |
| void | SetRowLabel (int i, const string &label) |
| Sets row label at specified index. | |
| void | SetColumnLabels (const vector< string > &label) |
| Sets all column labels at once. | |
| void | SetRowLabels (const vector< string > &label) |
| Sets all row labels at once. | |
| QTableWidget * | ToTable () override |
| Creates a QTableWidget for displaying matrix data. | |
| vector< string > | RowLabels () const |
| Gets all row labels. | |
| vector< string > | ColumnLabels () const |
| Gets all column labels. | |
| CMBVector | GetRow (const string &rowlabel) |
| Extracts a row by its label. | |
| CMBVector | GetColumn (const string &columnlabel) |
| Extracts a column by its label. | |
| QStringList | RowLabelCategories () |
| Gets unique row label categories. | |
| void | SetBooleanValue (bool val) |
| Sets boolean display mode for table widget. | |
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 > | columnlabels |
| Labels for each column. | |
| vector< string > | rowlabels |
| Labels for each row. | |
| 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. | |
Matrix class with labeled rows and columns for Chemical Mass Balance analysis.
Extends CMatrix with string labels for rows and columns, JSON serialization, table widget generation, and specialized operations for CMB calculations. Inherits from both CMatrix (for mathematical operations) and Interface (for I/O and visualization).
Definition at line 18 of file cmbmatrix.h.
| CMBMatrix::CMBMatrix | ( | ) |
Default constructor - creates an empty matrix.
Definition at line 6 of file cmbmatrix.cpp.
| CMBMatrix::CMBMatrix | ( | int | n | ) |
Constructs a square matrix with given dimension.
| n | Number of rows and columns |
Definition at line 20 of file cmbmatrix.cpp.
References columnlabels, and rowlabels.
| CMBMatrix::CMBMatrix | ( | int | n, |
| int | m | ||
| ) |
Constructs a rectangular matrix with given dimensions.
| n | Number of columns |
| m | Number of rows |
Definition at line 25 of file cmbmatrix.cpp.
References columnlabels, and rowlabels.
| CMBMatrix::CMBMatrix | ( | const CMBMatrix & | mp | ) |
Copy constructor.
| mp | Matrix to copy from |
Definition at line 11 of file cmbmatrix.cpp.
References columnlabels, Interface::highlightoutsideoflimit, Interface::highlimit, Interface::lowlimit, and rowlabels.
|
inline |
Gets column label at specified index.
| i | Column index |
Definition at line 97 of file cmbmatrix.h.
References columnlabels.
Gets all column labels.
Definition at line 153 of file cmbmatrix.h.
References columnlabels.
Referenced by GetRow().
Extracts a column by its label.
| columnlabel | Label of the column to extract |
Definition at line 218 of file cmbmatrix.cpp.
References columnlabels, RowLabels(), and CMBVector::SetLabels().
Extracts a row by its label.
| rowlabel | Label of the row to extract |
Definition at line 204 of file cmbmatrix.cpp.
References ColumnLabels(), rowlabels, and CMBVector::SetLabels().
Assignment operator.
| mp | Matrix to assign from |
Definition at line 31 of file cmbmatrix.cpp.
References columnlabels, Interface::highlightoutsideoflimit, Interface::highlimit, Interface::lowlimit, and rowlabels.
|
overridevirtual |
Deserializes matrix from JSON format.
| jsonobject | JSON object to read from |
Reimplemented from Interface.
Definition at line 67 of file cmbmatrix.cpp.
References columnlabels, and rowlabels.
Referenced by Results::ReadFromJson().
|
inline |
Gets row label at specified index.
| i | Row index |
Definition at line 104 of file cmbmatrix.h.
References rowlabels.
| QStringList CMBMatrix::RowLabelCategories | ( | ) |
Gets unique row label categories.
Definition at line 233 of file cmbmatrix.cpp.
References rowlabels.
Gets all row labels.
Definition at line 147 of file cmbmatrix.h.
References rowlabels.
Referenced by GetColumn(), and operator*().
|
inline |
Sets boolean display mode for table widget.
When true, matrix values are displayed as "Pass" (0) or "Fail" (1) in the table widget instead of numeric values.
| val | True to enable boolean display mode |
Definition at line 183 of file cmbmatrix.h.
References boolean_values.
Referenced by Conductor::ExecuteBracketingAnalysisBatch(), and Results::ReadFromJson().
|
inline |
Sets column label at specified index.
| i | Column index |
| label | Label string to set |
Definition at line 111 of file cmbmatrix.h.
References columnlabels.
Referenced by SourceSinkData::BracketTest(), Elemental_Profile_Set::CalculateCorrelationMatrix(), Elemental_Profile_Set::CalculateCovarianceMatrix(), Elemental_Profile_Set::DetectOutliers(), and SourceSinkData::MCMC_Batch().
Sets all column labels at once.
| label | Vector of label strings |
Definition at line 124 of file cmbmatrix.h.
References columnlabels.
|
inline |
Sets row label at specified index.
| i | Row index |
| label | Label string to set |
Definition at line 118 of file cmbmatrix.h.
References rowlabels.
Referenced by SourceSinkData::BracketTest(), Elemental_Profile_Set::CalculateCorrelationMatrix(), Elemental_Profile_Set::CalculateCovarianceMatrix(), Elemental_Profile_Set::DetectOutliers(), and SourceSinkData::MCMC_Batch().
Sets all row labels at once.
| label | Vector of label strings |
Definition at line 130 of file cmbmatrix.h.
References rowlabels.
|
overridevirtual |
Serializes matrix to JSON format.
Reimplemented from Interface.
Definition at line 41 of file cmbmatrix.cpp.
References columnlabels, matrix, rowlabels, and valueAt().
| CMatrix CMBMatrix::toMatrix | ( | ) | const |
Converts to base CMatrix type (without labels)
Definition at line 197 of file cmbmatrix.cpp.
Referenced by operator*().
|
overridevirtual |
Converts matrix to CSV-formatted string.
Reimplemented from Interface.
Definition at line 101 of file cmbmatrix.cpp.
References columnlabels, rowlabels, and valueAt().
Referenced by writetofile().
|
overridevirtual |
Creates a QTableWidget for displaying matrix data.
Generates a read-only table widget with labeled rows and columns. Highlights cells outside limit range if highlighting is enabled. Displays boolean values as "Pass"/"Fail" if boolean mode is set.
Reimplemented from Interface.
Definition at line 122 of file cmbmatrix.cpp.
References boolean_values, columnlabels, Interface::highlightoutsideoflimit, Interface::highlimit, Interface::lowlimit, and rowlabels.
| double CMBMatrix::valueAt | ( | int | i, |
| int | j | ||
| ) | const |
Gets value at specified matrix position.
| i | Row index |
| j | Column index |
Definition at line 184 of file cmbmatrix.cpp.
Referenced by toJsonObject(), and ToString().
|
overridevirtual |
Writes matrix to file in CSV format.
| file | File pointer to write to |
Reimplemented from Interface.
Definition at line 96 of file cmbmatrix.cpp.
References ToString().
|
private |
Display values as Pass/Fail instead of numbers.
Definition at line 188 of file cmbmatrix.h.
Referenced by SetBooleanValue(), and ToTable().
Labels for each column.
Definition at line 186 of file cmbmatrix.h.
Referenced by CMBMatrix(), CMBMatrix(), CMBMatrix(), ColumnLabel(), ColumnLabels(), GetColumn(), operator=(), ReadFromJsonObject(), SetColumnLabel(), SetColumnLabels(), toJsonObject(), ToString(), and ToTable().
Labels for each row.
Definition at line 187 of file cmbmatrix.h.
Referenced by CMBMatrix(), CMBMatrix(), CMBMatrix(), GetRow(), operator=(), ReadFromJsonObject(), RowLabel(), RowLabelCategories(), RowLabels(), SetRowLabel(), SetRowLabels(), toJsonObject(), ToString(), and ToTable().