Implementations of common kernel functions.