Program Listing for File BandwidthSelector.h

Return to documentation for file (include/gwmodelpp/BandwidthSelector.h)

#ifndef BANDWIDTHSELECTOR_H
#define BANDWIDTHSELECTOR_H

#include <map>
#include <vector>
#include <utility>
#include "Status.h"
#include "IBandwidthSelectable.h"
#include "spatialweight/BandwidthWeight.h"

namespace gwm
{

class BandwidthSelector
{
public:

    BandwidthSelector(const BandwidthWeight& bandwidth): mBandwidth(bandwidth), mOptimisedBandwidth(bandwidth) {}

    BandwidthSelector(const BandwidthWeight& bandwidth, double lower, double upper) : mBandwidth(bandwidth), mOptimisedBandwidth(bandwidth), mLower(lower) , mUpper(upper) {}

    ~BandwidthSelector() {}

public:

    // const BandwidthWeight *bandwidth() const { return mBandwidth; }
    const BandwidthWeight& result() const { return mOptimisedBandwidth; }

    // void setBandwidth(BandwidthWeight *bandwidth) { mBandwidth = bandwidth; }

    double lower() const { return mLower; }

    void setLower(double lower) { mLower = lower; }

    double upper() const { return mUpper; }

    void setUpper(double upper) { mUpper = upper; }

    BandwidthCriterionList bandwidthCriterion() const;

public:

    Status optimize(IBandwidthSelectable* instance);

private:
    const BandwidthWeight& mBandwidth;
    BandwidthWeight mOptimisedBandwidth;
    double mLower;
    double mUpper;
    std::unordered_map<double, double> mBandwidthCriterion;
};

}

#endif  // BANDWIDTHSELECTOR_H