Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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>();
     }
 }
Exemple #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>();
     }
 }
Exemple #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);
Exemple #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);
Exemple #9
0
 public static VslSSTaskHandle <T> Wrap <T>(IntPtr ptr)
     where T : unmanaged
 => VslSSTaskHandle <T> .Wrap(ptr);
Exemple #10
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Dataset <T> samples)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples);
Exemple #11
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Span <T> samples, int dim)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples, dim);
Exemple #12
0
 public static unsafe VslSSTaskHandle <T> Create <T>(Observations <T> samples)
     where T : unmanaged
 => VslSSTaskHandle <T> .Create(samples);