3#include <gsl/gsl_cdf.h>
15 map<string,CMBVector>::operator=(mp);
22 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
24 out[QString::fromStdString(it->first)]=it->second.toJsonObject();
30 for(QString key: jsonobject.keys() ) {
33 operator[](key.toStdString()) = column;
40 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
52 for (map<string,CMBVector>::const_iterator it = begin(); it!=end();it++)
54 if (it->second.num>max_size)
55 max_size = it->second.num;
63 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
65 out = std::max(out,it->second.max());
72 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
74 out = std::min(out,it->second.min());
82 QTableWidget *tablewidget =
new QTableWidget();
83 tablewidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
84 tablewidget->setColumnCount(size()*2);
85 tablewidget->setRowCount(
MaxSize());
86 QStringList rowheaders;
87 QStringList colheaders;
89 for (map<string,CMBVector>::iterator column=begin(); column!=end(); column++)
91 colheaders<<QString::fromStdString(column->first)<<QString::fromStdString(column->first)+
"-Value";
92 for (
int i=0; i<column->second.getsize(); i++)
94 tablewidget->setItem(i,colno*2,
new QTableWidgetItem(QString::fromStdString(column->second.Label(i))));
95 tablewidget->setItem(i,colno*2+1,
new QTableWidgetItem(QString::number(column->second[i])));
100 tablewidget->setHorizontalHeaderLabels(colheaders);
106 file->write(QString::fromStdString(
ToString()).toUtf8());
112 if (count(column)!=0)
113 return (at(column).
Label(j));
119 if (count(columnlabel)!=0)
120 return (at(columnlabel).
valueAt(j));
126 return at(columnlabel);
130 this->operator[](columnlabel) =
vector;
137 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
139 SSB += pow(vect->second.mean()-Overall_Mean,2)*vect->second.num;
141 double MSB = SSB/(size()-1);
143 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
145 SSW += pow(vect->second.stdev(),2)*vect->second.num;
157 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
159 sum+=vect->second.mean()*vect->second.num;
160 count+=vect->second.num;
168 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
170 count+=vect->second.num;
Collection of named CMBVector objects for multi-variable analysis.
QTableWidget * ToTable() override
Creates a QTableWidget for displaying vector set data.
void Append(const string &columnlabel, const CMBVector &vectorset)
Adds or replaces a vector in the set.
double min() const
Finds the minimum value across all vectors.
string Label(string column, int j) const
Gets label at specified position in a column.
double OverallMean() const
Computes overall mean across all vectors.
CMBVectorSet()
Default constructor - creates an empty vector set.
QJsonObject toJsonObject() const override
Serializes vector set to JSON format.
CMBVector & GetColumn(const string columnlabel)
Gets reference to a named column vector.
int TotalNumberofObservations() const
Counts total number of observations across all vectors.
unsigned int MaxSize() const
Finds the maximum size among all vectors.
bool writetofile(QFile *file) override
Writes vector set to file.
double FTest_p_value() const
Computes F-test p-value for ANOVA.
double max() const
Finds the maximum value across all vectors.
CMBVectorSet & operator=(const CMBVectorSet &mp)
Assignment operator.
double valueAt(const string &columnlabel, int j) const
Gets value at specified position in a column.
string ToString() const override
Converts vector set to string representation.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector set from JSON format.
Vector class with string labels for Chemical Mass Balance analysis.
string ToString() const override
Converts vector to CSV-formatted string.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector from JSON format.
Abstract base class providing common serialization and visualization interface.
Interface & operator=(const Interface &intf)
Assignment operator.