"""Explicit optional C++ OU kernel. No silent native acceleration claim."""
import ctypes
from pathlib import Path
def moments(a,sigma,dt):
    path=Path(__file__).with_name('ou.dll' if __import__('os').name=='nt' else 'ou.so')
    lib=ctypes.CDLL(str(path)); f=lib.ahs_ou_moments
    f.argtypes=[ctypes.c_double]*3+[ctypes.POINTER(ctypes.c_double)]*2; f.restype=ctypes.c_int
    x,y=ctypes.c_double(),ctypes.c_double()
    if f(a,sigma,dt,ctypes.byref(x),ctypes.byref(y)): raise ValueError('Invalid OU parameters')
    return x.value,y.value
