OaS

Various utility functions etc. that don’t obviously fit elsewhere.

exception cpip.util.OaS.ExceptionOas

Simple specialisation of an exception class for this module.

cpip.util.OaS.indexLB(l, v)

Returns the lower bound index in a sorted list l of the value that is equal to v or the nearest lower value to v. Returns -1 if l empty or all values higher than v.

cpip.util.OaS.indexMatch(l, v)

Returns the index of v in sorted list l or -1. This uses Jon Bentley’s binary search algorithm. This uses operators > and <.

cpip.util.OaS.indexUB(l, v)

Returns the upper bound index in a sorted list l of the value that is equal to v or the nearest upper value to v. Returns -1 if l empty or all values lower than v.

Previous topic

MaxMunchGen

Next topic

StrTree

This Page