Ejemplo n.º 1
0
        public unsafe override void Inverse <T>(ref T[] src)
        {
            switch (typeof(T).ToString())
            {
            case "System.Double":
                fixed(double *pSrcDst = src as double[])
                {
                    IPPNative.ippsFlip_64f_I(pSrcDst, src.Length);
                }

                break;

            case "System.Single":
                fixed(float *pSrcDst = src as float[])
                {
                    IPPNative.ippsFlip_32f_I(pSrcDst, src.Length);
                }

                break;

            default:
                base.Inverse(ref src);
                break;
            }
        }
Ejemplo n.º 2
0
 public unsafe override void Divide(ref double[] srcDest, double scalar)
 {
     fixed(double *pSrcDst = srcDest)
     {
         IPPNative.ippsDivC_64f_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 3
0
 public unsafe override void Multiply(ref float[] srcDest, float scalar)
 {
     fixed(float *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsMulC_32f_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 4
0
 public unsafe override void Initialize(ref float[] dest, float initValue)
 {
     fixed(float *pDst = dest)
     {
         IPPNative.ippsSet_32f(initValue, pDst, dest.Length);
     }
 }
Ejemplo n.º 5
0
 public unsafe override void Initialize(ref double[] dest, double initValue)
 {
     fixed(double *pDst = dest)
     {
         IPPNative.ippsSet_64f(initValue, pDst, dest.Length);
     }
 }
Ejemplo n.º 6
0
 public unsafe override void Substract(ref short[] srcDest, short scalar)
 {
     fixed(short *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsSubC_16s_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 7
0
 public unsafe override void Multiply(ref short[] srcDest, short scalar)
 {
     fixed(short *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsMulC_16s_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 8
0
 public unsafe override void Substract(ref float[] srcDest, float scalar)
 {
     fixed(float *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsSubC_32f_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 9
0
 public unsafe override void Substract(ref double[] srcDest, double scalar)
 {
     fixed(double *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsSubC_64f_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 10
0
 public unsafe override void Multiply(ref double[] srcDest, double scalar)
 {
     fixed(double *pSrcDst = srcDest, pDst = srcDest)
     {
         IPPNative.ippsMulC_64f_I(scalar, pSrcDst, srcDest.Length);
     }
 }
Ejemplo n.º 11
0
        public unsafe override double Sum(double[] src1)
        {
            double[] ret = new double[1];
            fixed(double *pSrc = src1, pSum = ret)
            {
                IPPNative.ippsSum_64f(pSrc, src1.Length, pSum);
            }

            return(ret[0]);
        }
Ejemplo n.º 12
0
        public unsafe override double Mean(double[] src)
        {
            double[] ret = new double[1];
            fixed(double *pSrc = src, pMean = ret)
            {
                IPPNative.ippsMean_64f(pSrc, src.Length, pMean);
            }

            return(ret[0]);
        }
Ejemplo n.º 13
0
        public unsafe override double StandardDeviation(double[] src)
        {
            double[] ret = new double[1];
            fixed(double *pSrc = src, pStdDev = ret)
            {
                IPPNative.ippsStdDev_64f(pSrc, src.Length, pStdDev);
            }

            return(ret[0]);
        }
Ejemplo n.º 14
0
        public unsafe override void ACos(float[] value, ref float[] returnValue)
        {
            if (value.Length != returnValue.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(float *pSrc = value, pDst = returnValue)
            {
                IPPNative.ippsAcos_32f_A24(pSrc, pDst, 1);
            }
        }
Ejemplo n.º 15
0
        public unsafe override void Divide(ref double[] srcDest, double[] src2)
        {
            if (srcDest.Length != src2.Length)
            {
                throw new Exception("Length of src2 is not equal to the length of srcDest");
            }

            fixed(double *pSrc = src2, pSrcDst = srcDest)
            {
                IPPNative.ippsDiv_64f_I(pSrc, pSrcDst, src2.Length);
            }
        }
Ejemplo n.º 16
0
        public unsafe override void Cos(double[] value, ref double[] returnValue)
        {
            if (value.Length != returnValue.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(double *pSrc = value, pDst = returnValue)
            {
                IPPNative.ippsCos_64f_A53(pSrc, pDst, 1);
            }
        }
Ejemplo n.º 17
0
        public unsafe override void Log(double[] src, ref double[] dest)
        {
            if (src.Length != dest.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(double *pSrc = src, pDst = dest)
            {
                IPPNative.ippsLog10_64f_A53(pSrc, pDst, dest.Length);
            }
        }
Ejemplo n.º 18
0
        public unsafe override void Pow(float[] src1, float scalar, ref float[] dest)
        {
            if (src1.Length != dest.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(float *pSrc = src1, pDst = dest)
            {
                IPPNative.ippsPowx_32f_A24(pSrc, scalar, pDst, dest.Length);
            }
        }
Ejemplo n.º 19
0
        public unsafe override void Substract(double[] src1, double[] src2, ref double[] dest)
        {
            if (src1.Length != dest.Length && src2.Length != dest.Length)
            {
                throw new Exception("Length of src1 is not equal to the length of src2 and dest");
            }

            fixed(double *pSrc1 = src1, pSrc2 = src2, pDst = dest)
            {
                IPPNative.ippsSub_64f(pSrc1, pSrc2, pDst, dest.Length);
            }
        }
Ejemplo n.º 20
0
        public unsafe override void Multiply(ref short[] srcDest, short[] src2)
        {
            if (srcDest.Length != src2.Length)
            {
                throw new Exception("Length of src2 is not equal to the length of srcDest");
            }

            fixed(short *pSrc = src2, pSrcDst = srcDest)
            {
                IPPNative.ippsMul_16s_I(pSrc, pSrcDst, src2.Length);
            }
        }
Ejemplo n.º 21
0
        public unsafe override void Log(float[] src, ref float[] dest)
        {
            if (src.Length != dest.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(float *pSrc = src, pDst = dest)
            {
                IPPNative.ippsLog10_32f_A24(pSrc, pDst, dest.Length);
            }
        }
Ejemplo n.º 22
0
        public unsafe override void Divide(ref float[] srcDest, float[] src2)
        {
            if (srcDest.Length != src2.Length)
            {
                throw new Exception("Length of src2 is not equal to the length of srcDest");
            }

            fixed(float *pSrc = src2, pSrcDst = srcDest)
            {
                IPPNative.ippsAdd_32f_I(pSrc, pSrcDst, src2.Length);
            }
        }
Ejemplo n.º 23
0
        public unsafe override void Multiply(short[] src1, short[] src2, ref short[] dest)
        {
            if (src1.Length != dest.Length && src2.Length != dest.Length)
            {
                throw new Exception("Length of src1 is not equal to the length of src2 and dest");
            }

            fixed(short *pSrc1 = src1, pSrc2 = src2, pDst = dest)
            {
                IPPNative.ippsMul_16s(pSrc1, pSrc2, pDst, dest.Length);
            }
        }
Ejemplo n.º 24
0
        public unsafe override void Divide(double[] src1, double scalar, ref double[] dest)
        {
            if (src1.Length != dest.Length)
            {
                throw new Exception("Length of src1 is not equal to the length of dest");
            }

            fixed(double *pSrc1 = src1, pDst = dest)
            {
                IPPNative.ippsDivC_64f(pSrc1, scalar, pDst, dest.Length);
            }
        }
Ejemplo n.º 25
0
        public unsafe override void Multiply(float[] src1, float scalar, ref float[] dest)
        {
            if (src1.Length != dest.Length)
            {
                throw new Exception("Length of src1 is not equal to the length of dest");
            }

            fixed(float *pSrc1 = src1, pDst = dest)
            {
                IPPNative.ippsMulC_32f(pSrc1, scalar, pDst, dest.Length);
            }
        }
Ejemplo n.º 26
0
        public unsafe override void Add(float[] src1, float[] src2, ref float[] dest)
        {
            if (src1.Length != dest.Length && src2.Length != dest.Length)
            {
                throw new Exception("Length of src1 is not equal to the length of src2 and dest");
            }

            fixed(float *pSrc1 = src1, pSrc2 = src2, pDst = dest)
            {
                IPPNative.ippsAdd_32f(pSrc1, pSrc2, pDst, dest.Length);
            }
        }
Ejemplo n.º 27
0
        public unsafe override void Pow(double[] src1, double scalar, ref double[] dest)
        {
            if (src1.Length != dest.Length)
            {
                throw new Exception("Length of src is not equal to the length of dest");
            }

            fixed(double *pSrc = src1, pDst = dest)
            {
                IPPNative.ippsPowx_64f_A53(pSrc, scalar, pDst, dest.Length);
            }
        }
Ejemplo n.º 28
0
 public unsafe override void Cos(double value, ref double returnValue)
 {
     double[] input = new double[1] {
         value
     };
     double[] output = new double[1] {
         returnValue
     };
     fixed(double *pSrc = input, pDst = output)
     {
         IPPNative.ippsCos_64f_A53(pSrc, pDst, 1);
     }
 }
Ejemplo n.º 29
0
 public unsafe override void ACos(float value, ref float returnValue)
 {
     float[] input = new float[1] {
         value
     };
     float[] output = new float[1] {
         returnValue
     };
     fixed(float *pSrc = input, pDst = output)
     {
         IPPNative.ippsAcos_32f_A24(pSrc, pDst, 1);
     }
 }
Ejemplo n.º 30
0
        public unsafe override float Dot(float[] a, float[] b)
        {
            if (a.Length != b.Length)
            {
                throw new Exception("Length of a is not equal to the length of b");
            }
            float[] ret = new float[1];
            fixed(float *pSrc1 = a, pSrc2 = b, pDp = ret)
            {
                IPPNative.ippsDotProd_32f(pSrc1, pSrc2, a.Length, pDp);
            }

            return(ret[0]);
        }