6#include <gsl/gsl_cdf.h>
18 map<string,CMBVector>::operator=(mp);
25 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
27 out[QString::fromStdString(it->first)]=it->second.toJsonObject();
33 for(
const QString& key: jsonobject.keys() ) {
36 operator[](key.toStdString()) = column;
43 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
47 s+=it->second.ToString()+=
"\n";
55 for (map<string,CMBVector>::const_iterator it = begin(); it!=end();it++)
57 if (it->second.num>max_size)
58 max_size = it->second.num;
66 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
68 out = std::max(out,it->second.max());
75 for (map<string,CMBVector>::const_iterator it = cbegin(); it!=cend();it++)
77 out = std::min(out,it->second.min());
85 QTableWidget *tablewidget =
new QTableWidget();
86 tablewidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
87 tablewidget->setColumnCount(size()*2);
88 tablewidget->setRowCount(
MaxSize());
89 QStringList rowheaders;
90 QStringList colheaders;
92 for (map<string,CMBVector>::iterator column=begin(); column!=end(); column++)
94 colheaders<<QString::fromStdString(column->first)<<QString::fromStdString(column->first)+
"-Value";
95 for (
int i=0; i<column->second.getsize(); i++)
97 tablewidget->setItem(i,colno*2,
new QTableWidgetItem(QString::fromStdString(column->second.Label(i))));
98 tablewidget->setItem(i,colno*2+1,
new QTableWidgetItem(QString::number(column->second[i])));
103 tablewidget->setHorizontalHeaderLabels(colheaders);
109 file->write(QString::fromStdString(
ToString()).toUtf8());
115 if (count(column)!=0)
116 return (at(column).
Label(j));
122 if (count(columnlabel)!=0)
123 return (at(columnlabel).
valueAt(j));
129 return at(columnlabel);
133 this->operator[](columnlabel) =
vector;
140 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
142 SSB += pow(vect->second.mean()-Overall_Mean,2)*vect->second.num;
144 double MSB = SSB/(size()-1);
146 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
148 SSW += pow(vect->second.stdev(),2)*vect->second.num;
160 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
162 sum+=vect->second.mean()*vect->second.num;
163 count+=vect->second.num;
171 for (map<string,CMBVector>::const_iterator vect = cbegin(); vect!=cend(); vect++ )
173 count+=vect->second.num;
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.
double OverallMean() const
Computes overall mean across all vectors.
CMBVectorSet()
Default constructor - creates an empty vector set.
string Label(const string &column, int j) const
Gets label at specified position in a column.
QJsonObject toJsonObject() const override
Serializes vector set to JSON format.
int TotalNumberofObservations() const
Counts total number of observations across all vectors.
unsigned int MaxSize() const
Finds the maximum size among all vectors.
CMBVector & GetColumn(const string &columnlabel)
Gets reference to a named column vector.
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.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector from JSON format.
Interface()
Default constructor.
Interface & operator=(const Interface &intf)
Assignment operator.