.. _program_listing_file_include_gwmodelpp_IBandwidthSelectable.h: Program Listing for File IBandwidthSelectable.h =============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/gwmodelpp/IBandwidthSelectable.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef IBANDWIDTHSELECTABLE_H #define IBANDWIDTHSELECTABLE_H #include "Status.h" #include "spatialweight/BandwidthWeight.h" namespace gwm { #define GWM_LOG_TAG_BANDWIDTH_CIRTERION "#bandwidth-criterion " struct IBandwidthSelectable { static std::string infoBandwidthCriterion(const BandwidthWeight& weight) { return std::string(GWM_LOG_TAG_BANDWIDTH_CIRTERION) + (weight.adaptive() ? "adaptive" : "fixed") + ",criterion"; } static std::string infoBandwidthCriterion(const BandwidthWeight& weight, const double value) { if (weight.adaptive()) return std::string(GWM_LOG_TAG_BANDWIDTH_CIRTERION) + std::to_string(int(weight.bandwidth())) + "," + std::to_string(value); else return std::string(GWM_LOG_TAG_BANDWIDTH_CIRTERION) + std::to_string(weight.bandwidth()) + "," + std::to_string(value); } virtual Status getCriterion(const std::unique_ptr& weight, double& criterion) = 0; }; typedef std::vector > BandwidthCriterionList; } #endif // IBANDWIDTHSELECTABLE_H