class SlopeTrick(T)
- SlopeTrick(T)
- Reference
- Object
Overview
reference: https://maspypy.com/slope-trick-1-解説編
Defined in:
datastructure/slope_trick.crConstructors
-
.new
Lets
f(x) = 0
Instance Method Summary
-
#accumulate_min : self
g(x) := min_{y <= x} f(y)
-
#accumulate_min_right : self
g(x) := min_{y >= x} f(y)
-
#add(a : T) : self
Adds constant function
a
-
#add_abs(a : T) : self
Adds
|x - a|
-
#add_l(a : T) : self
Adds
max(a - x, 0)
-
#add_r(a : T) : self
Adds
max(x - a, 0)
-
#f(x : T) : T
Calculates
#f(x)
- #l0 : T?
- #left
- #min : T
- #r0 : T?
- #right
- #shift : T
-
#slide(a : T) : self
g(x) := f(x - a)