Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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>();
     }
 }
Esempio n. 6
0
 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>();
     }
 }
Esempio n. 7
0
 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);
Esempio n. 8
0
 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);
Esempio n. 9
0
 public static VslSSTaskHandle <T> Wrap <T>(IntPtr ptr)
     where T : unmanaged
 => VslSSTaskHandle <T> .Wrap(ptr);
Esempio n. 10
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Dataset <T> samples)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples);
Esempio n. 11
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Span <T> samples, int dim)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples, dim);
Esempio n. 12
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Observations <T> samples)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples);