-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata1D.h
More file actions
41 lines (34 loc) · 873 Bytes
/
data1D.h
File metadata and controls
41 lines (34 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* This is the interface file of class "Data1D".
* Used for:bin energy spectrum, bin angular distribution,
* store intensity dependence.
* Author:Sui Luo.
* Version:First written in Feb 5, 2013.
* Last modified in Oct 1, 2013.
* Version 0.3
*/
#ifndef DATA1D_H
#define DATA1D_H
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
class Data1D {
public:
Data1D(double, double);
void modify(double, double);
double getKey() const;
double getWeight() const;
string toString() const;
friend class Collection1D;//not necessary
friend struct by_key;
protected:
double key, weight;
};
//define the operator to be used in sort
struct by_key{
bool operator() (Data1D const &D1, Data1D const &D2){
return D1.key < D2.key;
}
};
#endif /*DATA1D_H*/