Integral Functions#
Truncate#
- class cake.Truncate(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#
Bases:
FunctionTruncate function, see
math.trunc>>> t = Truncate(Variable('x')) >>> t.evaluate(x=1.55) Real(1.0) >>> t.evaluate(x=3) Real(3.0) >>> t.evaluate(x=Variable('y')) Truncate(y)
- auto_prehandle: bool#
Whether to automatically pre-handle a value, this is right before the value is passed through the handler
Warning
this is after the value is converted to radians!
- coefficient: Any#
Functions coefficient
- evaluate(to_radians: bool = False, use_preprocess: bool = False, use_postprocess: bool = False, use_prehandler: bool = False, **kwds) Any#
Evaluates the function, returning a result.
- Parameters:
to_radians (
bool) – Whether to convert value given to radians, useful for trig applications.use_preprocess (
bool) – Whether to use given pre processor, if any.use_postprocess (
bool) – Whether to use given post processor, if any.use_prehandler (
bool) – Whether to use given pre handler, if any.**kwds (Any[Like[cake.BasicNode]]) – Any values for variables to use.
- parameter: Any#
Internal parameter of function
- postprocessor: Callable[[Any], Any]#
postprocessor function
- power: Any#
Power function is raised to
- prehandler: Callable[[Any], Any]#
prehandler function
Ceil#
- class cake.Ceil(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#
Bases:
FunctionCeil function, see
math.ceil>>> c = Ceil(Variable('x')) >>> c.evaluate(x=1.2) Real(2.0) >>> c.evaluate(x=1.532) Real(2.0) >>> c.evaluate(x=Variable('y')) Ceil(y)
- auto_prehandle: bool#
Whether to automatically pre-handle a value, this is right before the value is passed through the handler
Warning
this is after the value is converted to radians!
- coefficient: Any#
Functions coefficient
- evaluate(to_radians: bool = False, use_preprocess: bool = False, use_postprocess: bool = False, use_prehandler: bool = False, **kwds) Any#
Evaluates the function, returning a result.
- Parameters:
to_radians (
bool) – Whether to convert value given to radians, useful for trig applications.use_preprocess (
bool) – Whether to use given pre processor, if any.use_postprocess (
bool) – Whether to use given post processor, if any.use_prehandler (
bool) – Whether to use given pre handler, if any.**kwds (Any[Like[cake.BasicNode]]) – Any values for variables to use.
- parameter: Any#
Internal parameter of function
- postprocessor: Callable[[Any], Any]#
postprocessor function
- power: Any#
Power function is raised to
- prehandler: Callable[[Any], Any]#
prehandler function
Floor#
- class cake.Floor(parameter: Any, coefficient: Any = 1, power: Any = 1)[source]#
Bases:
FunctionFloor function, see
math.floor>>> f = Floor(Variable('x')) >>> f.evaluate(x=1.5) Real(1.0) >>> f.evaluate(x=3.563) Real(3.0) >>> f.evaluate(x=Variable('y')) Floor(y)
- auto_prehandle: bool#
Whether to automatically pre-handle a value, this is right before the value is passed through the handler
Warning
this is after the value is converted to radians!
- coefficient: Any#
Functions coefficient
- evaluate(to_radians: bool = False, use_preprocess: bool = False, use_postprocess: bool = False, use_prehandler: bool = False, **kwds) Any#
Evaluates the function, returning a result.
- Parameters:
to_radians (
bool) – Whether to convert value given to radians, useful for trig applications.use_preprocess (
bool) – Whether to use given pre processor, if any.use_postprocess (
bool) – Whether to use given post processor, if any.use_prehandler (
bool) – Whether to use given pre handler, if any.**kwds (Any[Like[cake.BasicNode]]) – Any values for variables to use.
- parameter: Any#
Internal parameter of function
- postprocessor: Callable[[Any], Any]#
postprocessor function
- power: Any#
Power function is raised to
- prehandler: Callable[[Any], Any]#
prehandler function
Round#
- class cake.Round(parameter: Any, coefficient: Any = 1, power: Any = 1, n_places: int = 2)[source]#
Bases:
FunctionRound function, see
round>>> r = Round(Variable('x')) >>> r.evaluate(x=1.3) Real(1.3) >>> r.evaluate(x=1.532) Real(1.53) >>> r.evaluate(x=y) Round(y, places=2) >>> r = Round(Variable('x'), n_places=3) >>> r.evaluate(x=3.2222) Real(3.222)
Inherits same parameters as
Function- Parameters:
n_places (
int) – Number of places to round object, defaults to2.
- auto_prehandle: bool#
Whether to automatically pre-handle a value, this is right before the value is passed through the handler
Warning
this is after the value is converted to radians!
- coefficient: Any#
Functions coefficient
- evaluate(to_radians: bool = False, use_preprocess: bool = False, use_postprocess: bool = False, use_prehandler: bool = False, **kwds) Any#
Evaluates the function, returning a result.
- Parameters:
to_radians (
bool) – Whether to convert value given to radians, useful for trig applications.use_preprocess (
bool) – Whether to use given pre processor, if any.use_postprocess (
bool) – Whether to use given post processor, if any.use_prehandler (
bool) – Whether to use given pre handler, if any.**kwds (Any[Like[cake.BasicNode]]) – Any values for variables to use.
- parameter: Any#
Internal parameter of function
- postprocessor: Callable[[Any], Any]#
postprocessor function
- power: Any#
Power function is raised to
- prehandler: Callable[[Any], Any]#
prehandler function