jansel / opentuner

An extensible framework for program autotuning
http://opentuner.org/
MIT License
382 stars 112 forks source link

[Question] non inclusive float parameter #127

Open pmatos opened 5 years ago

pmatos commented 5 years ago

Is there a way to define a FloatParameter where the min is not inclusive? For example, a FloatParameter between 0 and 1, but different than 0, i.e. an x where 0 < x <= 1?

jansel commented 5 years ago

You could subclass FloatParameter to create such a parameter. An easier way might be way might be to replace (0, 1) with (sys.float_info.min, 1). (A double can't represent any numbers between 0 and sys.float_info.min so this would be the same as what you are asking for.)

https://docs.python.org/3/library/sys.html#sys.float_info