Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::RangeIntToIntFunction Class Referenceabstract

#include <range_query_function.h>

Public Member Functions

virtual ~RangeIntToIntFunction ()=default
 
virtual int64_t Query (int64_t argument) const =0
 
virtual int64_t RangeMin (int64_t from, int64_t to) const =0
 Returns min_x f(x), where x is in [from, to).
 
virtual int64_t RangeMax (int64_t from, int64_t to) const =0
 Returns max_x f(x), where x is in [from, to).
 
virtual int64_t RangeFirstInsideInterval (int64_t range_begin, int64_t range_end, int64_t interval_begin, int64_t interval_end) const =0
 
virtual int64_t RangeLastInsideInterval (int64_t range_begin, int64_t range_end, int64_t interval_begin, int64_t interval_end) const =0
 

Detailed Description

RangeIntToIntFunction is an interface to int64_t->int64_t functions supporting fast answer to range queries about their domain/codomain.

Definition at line 28 of file range_query_function.h.

Constructor & Destructor Documentation

◆ ~RangeIntToIntFunction()

virtual operations_research::RangeIntToIntFunction::~RangeIntToIntFunction ( )
virtualdefault

Member Function Documentation

◆ Query()

virtual int64_t operations_research::RangeIntToIntFunction::Query ( int64_t argument) const
pure virtual

Suppose f is the abstract underlying function. Returns f(argument).

Todo
(user): Rename to Run

◆ RangeFirstInsideInterval()

virtual int64_t operations_research::RangeIntToIntFunction::RangeFirstInsideInterval ( int64_t range_begin,
int64_t range_end,
int64_t interval_begin,
int64_t interval_end ) const
pure virtual

Returns the first x from [range_begin, range_end) for which f(x) is in [interval_begin, interval_end), or range_end if there is no such x.

◆ RangeLastInsideInterval()

virtual int64_t operations_research::RangeIntToIntFunction::RangeLastInsideInterval ( int64_t range_begin,
int64_t range_end,
int64_t interval_begin,
int64_t interval_end ) const
pure virtual

Returns the last x from [range_begin, range_end) for which f(x) is in [interval_begin, interval_end), or range_begin-1 if there is no such x.

◆ RangeMax()

virtual int64_t operations_research::RangeIntToIntFunction::RangeMax ( int64_t from,
int64_t to ) const
pure virtual

Returns max_x f(x), where x is in [from, to).

◆ RangeMin()

virtual int64_t operations_research::RangeIntToIntFunction::RangeMin ( int64_t from,
int64_t to ) const
pure virtual

Returns min_x f(x), where x is in [from, to).


The documentation for this class was generated from the following file: