static unsafe Observations <T> CalcVariance <T>(this Observations <T> samples, Observations <T> dst) where T : unmanaged { using var h2 = VslSSTaskHandle.Create(samples); h2.Set(VSL_SS_ED_2R_MOM, ref dst[0]); h2.Compute(Calcs.VSL_SS_2R_MOM, VSL_SS_METHOD_FAST); return(dst); }
static unsafe ref T CalcMean <T>(this Observations <T> samples, ref T dst) where T : unmanaged { using var h2 = VslSSTaskHandle.Create(samples); h2.Set(VSL_SS_ED_MEAN, ref dst); h2.Compute(Calcs.VSL_SS_MEAN, VSL_SS_METHOD_FAST); return(ref dst); }
static unsafe Dataset <T> CalcMean <T>(this Dataset <T> samples, Dataset <T> dst) where T : unmanaged { using var h2 = VslSSTaskHandle.Create(samples); h2.Set(VSL_SS_ED_MEAN, ref dst[0]); h2.Compute(Calcs.VSL_SS_MEAN, VSL_SS_METHOD_FAST); return(dst); }
static unsafe Observations <T> CalcExtrema <T>(this Observations <T> samples, Observations <T> dst) where T : unmanaged { using var h2 = VslSSTaskHandle.Create(samples); h2.Set(VSL_SS_ED_MIN, ref dst[0]); h2.Set(VSL_SS_ED_MAX, ref dst[1]); h2.Compute(Calcs.VSL_SS_MAX | Calcs.VSL_SS_MIN, VSL_SS_METHOD_FAST); return(dst); }
public static void Compute <T>(this VslSSTaskHandle <T> task, VslSSComputeRoutine routine, VslSSComputeMethod method, [CallerFilePath] string file = null, [CallerLineNumber] int?line = null) where T : unmanaged { if (typeof(T) == typeof(float)) { VSL.vslsSSCompute(task, routine, method).AutoThrow(file, line); } else if (typeof(T) == typeof(double)) { VSL.vsldSSCompute(task, routine, method).AutoThrow(file, line); } else { throw unsupported <T>(); } }
public static void Set <T>(this VslSSTaskHandle <T> task, VslSSTaskParameter param, ref T value, [CallerFilePath] string file = null, [CallerLineNumber] int?line = null) where T : unmanaged { if (typeof(T) == typeof(float)) { VSL.vslsSSEditTask(task, param, ref As.float32(ref value)).AutoThrow(file, line); } else if (typeof(T) == typeof(double)) { VSL.vsldSSEditTask(task, param, ref As.float64(ref value)).AutoThrow(file, line); } else { throw unsupported <T>(); } }
public static void Compute(this VslSSTaskHandle <double> task, VslSSComputeRoutine routine, VslSSComputeMethod method, [CallerFilePath] string file = null, [CallerLineNumber] int?line = null) => VSL.vsldSSCompute(task, routine, method).AutoThrow(file, line);
public static void Set <T>(this VslSSTaskHandle <T> task, VslSSTaskParameter param, ref double value, [CallerFilePath] string file = null, [CallerLineNumber] int?line = null) where T : unmanaged => VSL.vsldSSEditTask(task, param, ref value).AutoThrow(file, line);
public static VslSSTaskHandle <T> Wrap <T>(IntPtr ptr) where T : unmanaged => VslSSTaskHandle <T> .Wrap(ptr);
public static unsafe VslSSTaskHandle <T> Create <T>(Dataset <T> samples) where T : unmanaged => VslSSTaskHandle <T> .Create(samples);
public static unsafe VslSSTaskHandle <T> Create <T>(Span <T> samples, int dim) where T : unmanaged => VslSSTaskHandle <T> .Create(samples, dim);
public static unsafe VslSSTaskHandle <T> Create <T>(Observations <T> samples) where T : unmanaged => VslSSTaskHandle <T> .Create(samples);