6#include <gsl/gsl_cdf.h>
18 map<string,CMBVectorSet>::operator=(mp);
25 for (map<string,CMBVectorSet>::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,CMBVectorSet>::const_iterator it = cbegin(); it!=cend();it++)
47 s+=it->second.ToString()+=
"\n";
55 for (map<string,CMBVectorSet>::const_iterator it = begin(); it!=end();it++)
57 if (it->second.MaxSize()>max_size)
58 max_size = it->second.MaxSize();
66 for (map<string,CMBVectorSet>::const_iterator it = cbegin(); it!=cend();it++)
68 out = std::max(out,it->second.max());
75 for (map<string,CMBVectorSet>::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);
90 tablewidget->setColumnCount(column_count*2);
91 tablewidget->setRowCount(
MaxSize());
92 QStringList rowheaders;
93 QStringList colheaders;
97 for (map<string,CMBVector>::iterator column=
vectorset->second.begin(); column!=
vectorset->second.end(); column++)
99 colheaders<<QString::fromStdString(
vectorset->first)+
":"+QString::fromStdString(column->first)<<QString::fromStdString(
vectorset->first)+
":"+QString::fromStdString(column->first)+
"-Value";
100 for (
int i=0; i<column->second.getsize(); i++)
102 tablewidget->setItem(i,colno*2,
new QTableWidgetItem(QString::fromStdString(column->second.Label(i))));
103 tablewidget->setItem(i,colno*2+1,
new QTableWidgetItem(QString::number(column->second[i])));
109 tablewidget->setHorizontalHeaderLabels(colheaders);
115 file->write(QString::fromStdString(
ToString()).toUtf8());
128 if (count(columnlabel)!=0)
135 return at(
vectorset).GetColumn(columnlabel);
139 this->operator[](columnlabel) =
vectorset;
double min() const
Finds the minimum value across all vectors in all sets.
CMBVector & GetColumn(const string &vectorset, const string &columnlabel)
Gets reference to a named column vector within a vector set.
double max() const
Finds the maximum value across all vectors in all sets.
string ToString() const override
Converts vector set set to string representation.
double valueAt(const string &vectorset, const string &columnlabel, int j) const
Gets value at specified position in a column within a vector set.
QTableWidget * ToTable() override
Creates a QTableWidget for displaying vector set set data.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector set set from JSON format.
string Label(const string &vectorset, const string &column, int j) const
Gets label at specified position in a column within a vector set.
void Append(const string &columnlabel, const CMBVectorSet &vectorset)
Adds or replaces a vector set in the collection.
CMBVectorSetSet()
Default constructor - creates an empty vector set set.
unsigned int MaxSize() const
Finds the maximum size among all vectors in all sets.
bool writetofile(QFile *file) override
Writes vector set set to file.
QJsonObject toJsonObject() const override
Serializes vector set set to JSON format.
CMBVectorSetSet & operator=(const CMBVectorSetSet &mp)
Assignment operator.
Collection of named CMBVector objects for multi-variable analysis.
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserializes vector set from JSON format.
Vector class with string labels for Chemical Mass Balance analysis.
Interface()
Default constructor.
Interface & operator=(const Interface &intf)
Assignment operator.