#ifndef BUILDER_DISCOUNT__ #define BUILDER_DISCOUNT__ #include #include namespace lm { namespace builder { struct Discount { float amount[4]; float Get(uint64_t count) const { return amount[std::min(count, 3)]; } float Apply(uint64_t count) const { return static_cast(count) - Get(count); } }; } // namespace builder } // namespace lm #endif // BUILDER_DISCOUNT__