1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-04-10 19:20:44 +01:00

Function classes: default function replaced by nullptr

This commit is contained in:
Antonin Portelli 2014-04-07 15:56:08 +01:00
parent dc659991d0
commit 749818d9cc
3 changed files with 3 additions and 7 deletions

View File

@ -26,8 +26,6 @@ using namespace Latan;
/****************************************************************************** /******************************************************************************
* DoubleFunction implementation * * DoubleFunction implementation *
******************************************************************************/ ******************************************************************************/
const DoubleFunction::vecFunc DoubleFunction::nullFunction_ = nullptr;
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
DoubleFunction::DoubleFunction(const Index nArg, const vecFunc &f) DoubleFunction::DoubleFunction(const Index nArg, const vecFunc &f)
: buffer_(new DVec) : buffer_(new DVec)

View File

@ -39,7 +39,7 @@ private:
public: public:
// constructor // constructor
explicit DoubleFunction(const Index nArg = 0, explicit DoubleFunction(const Index nArg = 0,
const vecFunc &f = nullFunction_); const vecFunc &f = nullptr);
// destructor // destructor
virtual ~DoubleFunction(void) = default; virtual ~DoubleFunction(void) = default;
// access // access
@ -59,7 +59,6 @@ private:
private: private:
std::shared_ptr<DVec> buffer_{nullptr}; std::shared_ptr<DVec> buffer_{nullptr};
vecFunc f_; vecFunc f_;
static const vecFunc nullFunction_;
}; };
template <typename... Ts> template <typename... Ts>

View File

@ -38,14 +38,14 @@ private:
public: public:
// constructor // constructor
DoubleModel(const Index nArg = 0, const Index nPar = 0, DoubleModel(const Index nArg = 0, const Index nPar = 0,
const vecFunc &f = nullFunction_); const vecFunc &f = nullptr);
// destructor // destructor
virtual ~DoubleModel(void) = default; virtual ~DoubleModel(void) = default;
// access // access
virtual Index getNArg(void) const; virtual Index getNArg(void) const;
virtual Index getNPar(void) const; virtual Index getNPar(void) const;
void setFunction(const Index nArg = 0, const Index nPar = 0, void setFunction(const Index nArg = 0, const Index nPar = 0,
const vecFunc &f = nullFunction_); const vecFunc &f = nullptr);
// function call // function call
double operator()(const DVec &data, const DVec &par) const; double operator()(const DVec &data, const DVec &par) const;
double operator()(const std::vector<double> &data, double operator()(const std::vector<double> &data,
@ -59,7 +59,6 @@ private:
private: private:
std::shared_ptr<ModelSize> size_; std::shared_ptr<ModelSize> size_;
vecFunc f_; vecFunc f_;
static const vecFunc nullFunction_;
}; };
END_NAMESPACE END_NAMESPACE