SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
CMBVectorSet Class Reference

Collection of named CMBVector objects for multi-variable analysis. More...

#include </home/runner/work/SedSat3/SedSat3/cmbvectorset.h>

Inheritance diagram for CMBVectorSet:
Inheritance graph
Collaboration diagram for CMBVectorSet:
Collaboration graph

Public Member Functions

 CMBVectorSet ()
 Default constructor - creates an empty vector set.
 
 CMBVectorSet (const CMBVectorSet &mp)
 Copy constructor.
 
CMBVectorSetoperator= (const CMBVectorSet &mp)
 Assignment operator.
 
QJsonObject toJsonObject () const override
 Serializes vector set to JSON format.
 
bool ReadFromJsonObject (const QJsonObject &jsonobject) override
 Deserializes vector set from JSON format.
 
string ToString () const override
 Converts vector set to string representation.
 
QTableWidget * ToTable () override
 Creates a QTableWidget for displaying vector set data.
 
bool writetofile (QFile *file) override
 Writes vector set to file.
 
string Label (string column, int j) const
 Gets label at specified position in a column.
 
double valueAt (const string &columnlabel, int j) const
 Gets value at specified position in a column.
 
CMBVectorGetColumn (const string columnlabel)
 Gets reference to a named column vector.
 
void Append (const string &columnlabel, const CMBVector &vectorset)
 Adds or replaces a vector in the set.
 
unsigned int MaxSize () const
 Finds the maximum size among all vectors.
 
double max () const
 Finds the maximum value across all vectors.
 
double min () const
 Finds the minimum value across all vectors.
 
double FTest_p_value () const
 Computes F-test p-value for ANOVA.
 
double OverallMean () const
 Computes overall mean across all vectors.
 
int TotalNumberofObservations () const
 Counts total number of observations across all vectors.
 
- Public Member Functions inherited from Interface
 Interface ()
 Default constructor.
 
 Interface (const Interface &intf)
 Copy constructor.
 
Interfaceoperator= (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 &note)
 Set the notes for this object, replacing any existing notes.
 
void AppendtoNotes (const string &note)
 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.
 
optionsGetOptions ()
 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.
 

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.
 

Detailed Description

Collection of named CMBVector objects for multi-variable analysis.

Manages a set of labeled vectors stored as a map, providing JSON serialization, table generation, and statistical operations like ANOVA F-test. Commonly used for organizing multiple samples or variables in source apportionment analysis.

Definition at line 16 of file cmbvectorset.h.

Constructor & Destructor Documentation

◆ CMBVectorSet() [1/2]

CMBVectorSet::CMBVectorSet ( )

Default constructor - creates an empty vector set.

Definition at line 5 of file cmbvectorset.cpp.

◆ CMBVectorSet() [2/2]

CMBVectorSet::CMBVectorSet ( const CMBVectorSet mp)

Copy constructor.

Parameters
mpVector set to copy from

Definition at line 9 of file cmbvectorset.cpp.

Member Function Documentation

◆ Append()

void CMBVectorSet::Append ( const string columnlabel,
const CMBVector vectorset 
)

Adds or replaces a vector in the set.

Parameters
columnlabelName for the vector
vectorsetVector to add

Definition at line 128 of file cmbvectorset.cpp.

References vector.

Referenced by SourceSinkData::DFA_Projected(), SourceSinkData::DFA_Projected(), SourceSinkData::DFA_Projected(), SourceSinkData::DiscriminantFunctionAnalysis(), SourceSinkData::DiscriminantFunctionAnalysis(), and SourceSinkData::DiscriminantFunctionAnalysis().

◆ FTest_p_value()

double CMBVectorSet::FTest_p_value ( ) const

Computes F-test p-value for ANOVA.

Performs one-way ANOVA to test if means differ significantly across the vectors in the set.

Returns
F-test p-value

Definition at line 133 of file cmbvectorset.cpp.

References OverallMean(), and TotalNumberofObservations().

Referenced by SourceSinkData::DiscriminantFunctionAnalysis(), SourceSinkData::DiscriminantFunctionAnalysis(), and SourceSinkData::StepwiseDiscriminantFunctionAnalysis().

◆ GetColumn()

CMBVector & CMBVectorSet::GetColumn ( const string  columnlabel)

Gets reference to a named column vector.

Parameters
columnlabelName of the vector column
Returns
Reference to the CMBVector

Definition at line 124 of file cmbvectorset.cpp.

◆ Label()

string CMBVectorSet::Label ( string  column,
int  j 
) const

Gets label at specified position in a column.

Parameters
columnName of the vector column
jIndex within the column
Returns
Label string, or empty string if column not found

Definition at line 110 of file cmbvectorset.cpp.

References Label().

Referenced by Label().

◆ max()

double CMBVectorSet::max ( ) const

Finds the maximum value across all vectors.

Returns
Maximum value found

Definition at line 60 of file cmbvectorset.cpp.

Referenced by GeneralChart::PlotScatter().

◆ MaxSize()

unsigned int CMBVectorSet::MaxSize ( ) const

Finds the maximum size among all vectors.

Returns
Maximum number of elements in any vector

Definition at line 49 of file cmbvectorset.cpp.

Referenced by ToTable().

◆ min()

double CMBVectorSet::min ( ) const

Finds the minimum value across all vectors.

Returns
Minimum value found

Definition at line 69 of file cmbvectorset.cpp.

Referenced by GeneralChart::PlotScatter().

◆ operator=()

CMBVectorSet & CMBVectorSet::operator= ( const CMBVectorSet mp)

Assignment operator.

Parameters
mpVector set to assign from
Returns
Reference to this vector set

Definition at line 13 of file cmbvectorset.cpp.

References Interface::operator=().

◆ OverallMean()

double CMBVectorSet::OverallMean ( ) const

Computes overall mean across all vectors.

Calculates weighted mean across all vectors, accounting for different vector sizes.

Returns
Overall mean value

Definition at line 153 of file cmbvectorset.cpp.

Referenced by FTest_p_value().

◆ ReadFromJsonObject()

bool CMBVectorSet::ReadFromJsonObject ( const QJsonObject &  jsonobject)
overridevirtual

Deserializes vector set from JSON format.

Parameters
jsonobjectJSON object to read from
Returns
true if successful, false otherwise

Reimplemented from Interface.

Definition at line 28 of file cmbvectorset.cpp.

References CMBVector::ReadFromJsonObject().

Referenced by Results::ReadFromJson(), and CMBVectorSetSet::ReadFromJsonObject().

◆ toJsonObject()

QJsonObject CMBVectorSet::toJsonObject ( ) const
overridevirtual

Serializes vector set to JSON format.

Returns
JSON object containing all vectors with their names as keys

Reimplemented from Interface.

Definition at line 19 of file cmbvectorset.cpp.

◆ ToString()

string CMBVectorSet::ToString ( ) const
overridevirtual

Converts vector set to string representation.

Returns
String containing all vectors with their names

Reimplemented from Interface.

Definition at line 37 of file cmbvectorset.cpp.

References CMBVector::ToString().

Referenced by CMBVectorSetSet::ToString(), and writetofile().

◆ ToTable()

QTableWidget * CMBVectorSet::ToTable ( )
overridevirtual

Creates a QTableWidget for displaying vector set data.

Generates a table with one column pair (label, value) for each vector.

Returns
Pointer to newly created QTableWidget (caller takes ownership)

Reimplemented from Interface.

Definition at line 80 of file cmbvectorset.cpp.

References MaxSize().

◆ TotalNumberofObservations()

int CMBVectorSet::TotalNumberofObservations ( ) const

Counts total number of observations across all vectors.

Returns
Total number of elements in all vectors combined

Definition at line 165 of file cmbvectorset.cpp.

Referenced by FTest_p_value().

◆ valueAt()

double CMBVectorSet::valueAt ( const string columnlabel,
int  j 
) const

Gets value at specified position in a column.

Parameters
columnlabelName of the vector column
jIndex within the column
Returns
Value at position j, or 0 if column not found

Definition at line 117 of file cmbvectorset.cpp.

References valueAt().

Referenced by valueAt().

◆ writetofile()

bool CMBVectorSet::writetofile ( QFile *  file)
overridevirtual

Writes vector set to file.

Parameters
fileFile pointer to write to
Returns
true if successful

Reimplemented from Interface.

Definition at line 104 of file cmbvectorset.cpp.

References ToString().


The documentation for this class was generated from the following files: