this example shows how to construct an object of class Data1D, used to handle 1D datasets of any type
using namespace std;
try {
const string file = "data.dat";
const int n_lines_header = 2;
data1.
Print(); cout << endl;
data2.
Print(); cout << endl;
data3.
Print(); cout << endl;
data4.
Print(); cout << endl;
double X, Y, ERROR, N;
std::vector<double> x, y, error;
string line;
for (int i=0; i<n_lines_header; ++i)
getline(fin, line);
while (fin >> X >> Y >> ERROR >> N >> N >> N) {
x.emplace_back(X);
y.emplace_back(Y);
error.emplace_back(ERROR);
}
fin.clear();
data5.
Print(); cout << endl;
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
virtual void Print(const int precision=4) const override
print the data on screen
const char * what() const noexcept override
the error description
void checkIO(const std::ifstream &fin, const std::string file="NULL")
check if an input file can be opened