change: code style
This commit is contained in:
parent
1e2b51abe3
commit
abd731a5ae
@ -3,13 +3,19 @@
|
|||||||
#ifndef bind_handler_h
|
#ifndef bind_handler_h
|
||||||
#define bind_handler_h
|
#define bind_handler_h
|
||||||
|
|
||||||
#include "GaussFit.h"
|
|
||||||
#include "FileHandler.h"
|
#include "FileHandler.h"
|
||||||
|
#include "GaussFit.h"
|
||||||
|
|
||||||
class BindHandler {
|
class BindHandler {
|
||||||
public:
|
public:
|
||||||
BindHandler();
|
BindHandler(){};
|
||||||
~BindHandler() {};
|
~BindHandler(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
std::vector<FileHandler> data;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void addData(FileHandler);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,9 +10,9 @@ using std::to_string;
|
|||||||
|
|
||||||
class FileHandler {
|
class FileHandler {
|
||||||
public:
|
public:
|
||||||
FileHandler() {};
|
FileHandler(){};
|
||||||
FileHandler(string, int n_ = 6, int thMin_ = 800, int thMax_ = 4000);
|
FileHandler(string, int n_ = 6, int thMin_ = 800, int thMax_ = 4000);
|
||||||
~FileHandler() {};
|
~FileHandler(){};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int n = 6, m = 8;
|
int n = 6, m = 8;
|
||||||
|
@ -27,8 +27,12 @@ double* GaussianJacobian(double x, double* p) {
|
|||||||
|
|
||||||
class GaussFit {
|
class GaussFit {
|
||||||
public:
|
public:
|
||||||
GaussFit() {};
|
GaussFit(){};
|
||||||
~GaussFit() {};
|
~GaussFit(){};
|
||||||
|
|
||||||
|
public:
|
||||||
|
double* parma = new double[3];
|
||||||
|
std::vector<Eigen::Vector2d> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void addData(double x, double y);
|
void addData(double x, double y);
|
||||||
@ -36,10 +40,6 @@ public:
|
|||||||
double RSquare();
|
double RSquare();
|
||||||
int getTotal();
|
int getTotal();
|
||||||
void draw(std::string title = "./Figure.png");
|
void draw(std::string title = "./Figure.png");
|
||||||
|
|
||||||
public:
|
|
||||||
double* parma = new double[3];
|
|
||||||
std::vector<Eigen::Vector2d> data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void GaussFit::addData(double x, double y) { data.push_back(Eigen::Vector2d(x, y)); }
|
void GaussFit::addData(double x, double y) { data.push_back(Eigen::Vector2d(x, y)); }
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -18,9 +18,8 @@ public:
|
|||||||
SigmaClip(double sigma = 3, int maxiters = 5,
|
SigmaClip(double sigma = 3, int maxiters = 5,
|
||||||
double (*cenF)(std::vector<Eigen::Vector2d> data) = nullptr,
|
double (*cenF)(std::vector<Eigen::Vector2d> data) = nullptr,
|
||||||
double (*stdF)(std::vector<Eigen::Vector2d> data) = nullptr);
|
double (*stdF)(std::vector<Eigen::Vector2d> data) = nullptr);
|
||||||
~SigmaClip() {};
|
~SigmaClip(){};
|
||||||
std::vector<Eigen::Vector2d> clip(std::vector<Eigen::Vector2d> data);
|
std::vector<Eigen::Vector2d> clip(std::vector<Eigen::Vector2d> data);
|
||||||
std::vector<Eigen::Vector2d> clipN(std::vector<Eigen::Vector2d> data);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void computeBound(std::vector<Eigen::Vector2d> data);
|
void computeBound(std::vector<Eigen::Vector2d> data);
|
||||||
@ -45,7 +44,7 @@ void SigmaClip::computeBound(std::vector<Eigen::Vector2d> data) {
|
|||||||
|
|
||||||
std::vector<Eigen::Vector2d> SigmaClip::clip(std::vector<Eigen::Vector2d> data) {
|
std::vector<Eigen::Vector2d> SigmaClip::clip(std::vector<Eigen::Vector2d> data) {
|
||||||
std::vector<Eigen::Vector2d>::iterator itor;
|
std::vector<Eigen::Vector2d>::iterator itor;
|
||||||
|
|
||||||
minValue = INF, maxValue = -INF;
|
minValue = INF, maxValue = -INF;
|
||||||
for (int k = 1; k <= maxiters; k++) {
|
for (int k = 1; k <= maxiters; k++) {
|
||||||
computeBound(data);
|
computeBound(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user