2014-03-12 19:17:15 +00:00
|
|
|
/*
|
|
|
|
* FitInterface.hpp, part of LatAnalyze 3
|
|
|
|
*
|
2015-06-11 14:04:54 +01:00
|
|
|
* Copyright (C) 2013 - 2015 Antonin Portelli
|
2014-03-12 19:17:15 +00:00
|
|
|
*
|
|
|
|
* LatAnalyze 3 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* LatAnalyze 3 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with LatAnalyze 3. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Latan_FitInterface_hpp_
|
|
|
|
#define Latan_FitInterface_hpp_
|
|
|
|
|
2014-03-13 18:51:01 +00:00
|
|
|
#include <LatAnalyze/Global.hpp>
|
|
|
|
#include <LatAnalyze/Minimizer.hpp>
|
2014-03-12 19:17:15 +00:00
|
|
|
|
2015-01-28 17:15:05 +00:00
|
|
|
BEGIN_LATAN_NAMESPACE
|
2014-03-12 19:17:15 +00:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* base class for data fit *
|
|
|
|
******************************************************************************/
|
|
|
|
class FitInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef Minimizer::Verbosity FitVerbosity;
|
|
|
|
public:
|
|
|
|
// constructors
|
|
|
|
FitInterface(void) = default;
|
|
|
|
FitInterface(const Index nData, const Index xDim, const Index yDim);
|
|
|
|
// destructor
|
|
|
|
virtual ~FitInterface(void) = default;
|
|
|
|
// access
|
2016-02-29 19:50:28 +00:00
|
|
|
void assumeXExact(const Index i, const bool isExact = true);
|
|
|
|
void assumeXXCorrelated(const Index i1, const Index i2,
|
|
|
|
const bool isCorrelated = true);
|
|
|
|
void assumeYYCorrelated(const Index j1, const Index j2,
|
|
|
|
const bool isCorrelated = true);
|
|
|
|
void assumeYXCorrelated(const Index j, const Index i,
|
|
|
|
const bool isCorrelated = true);
|
|
|
|
void assumeDataCorrelated(const Index k1, const Index k2,
|
|
|
|
const bool isCorrelated = true);
|
|
|
|
void assumeDataCorrelated(const bool isCorrelated = true);
|
|
|
|
void fitPoint(const Index k, const bool isFitPoint = true);
|
|
|
|
void fitPointRange(const Index k1, const Index k2,
|
2014-03-12 19:17:15 +00:00
|
|
|
const bool isFitPoint = true);
|
2016-02-29 19:50:28 +00:00
|
|
|
void fitAllPoints(const bool isFitPoint = true);
|
|
|
|
Index getNData(void) const;
|
|
|
|
Index getNFitPoint(void) const;
|
|
|
|
Index getXDim(void) const;
|
|
|
|
Index getYDim(void) const;
|
|
|
|
Index getStatXDim(void) const;
|
|
|
|
double getSvdTolerance(void) const;
|
|
|
|
void setFitInterface(const FitInterface &fitInterface);
|
|
|
|
void setNData(const Index nData);
|
|
|
|
void setXDim(const Index xDim);
|
|
|
|
void setYDim(const Index yDim);
|
|
|
|
void setSvdTolerance(const double tolerance);
|
|
|
|
void resize(const Index nData, const Index xDim, const Index yDim);
|
2014-03-12 19:17:15 +00:00
|
|
|
// test
|
|
|
|
bool isFitPoint(const Index k) const;
|
|
|
|
bool isXExact(const Index i) const;
|
|
|
|
bool isXXCorrelated(const Index i1, const Index i2) const;
|
|
|
|
bool isYYCorrelated(const Index j1, const Index j2) const;
|
|
|
|
bool isYXCorrelated(const Index j, const Index i) const;
|
|
|
|
bool isDataCorrelated(const Index k1, const Index k2) const;
|
|
|
|
private:
|
2016-02-29 19:50:28 +00:00
|
|
|
IVec isXExact_, isFitPoint_;
|
|
|
|
IMat isXXCorr_, isYYCorr_, isYXCorr_, isDataCorr_;
|
|
|
|
double svdTolerance_{1.0e-10};
|
2014-03-12 19:17:15 +00:00
|
|
|
};
|
|
|
|
|
2015-01-28 17:15:05 +00:00
|
|
|
END_LATAN_NAMESPACE
|
2014-03-12 19:17:15 +00:00
|
|
|
|
|
|
|
#endif // Latan_FitInterface_hpp_
|