예제 #1
0
        /// <summary>
        /// main math class providing static builtin functions
        /// </summary>
        static ILMath()
        {
            #region initialize proc specific interfaces

            try
            {
                Type lapackType = Type.GetType("ILNumerics.Native." + Settings.ConfigFile.LAPACKLibrary);
                Lapack = (IILLapack)Activator.CreateInstance(lapackType);
            }
            catch
            {
                Lapack = new ILManagedLapack();
            }

            try
            {
                Type fftType = Type.GetType("ILNumerics.Native." + Settings.ConfigFile.FFTLibrary);
                FFT = (IILFFT)Activator.CreateInstance(fftType);
            }
            catch
            {
                FFT = new ILManagedFFT();
            }

            #endregion

            #region initialize machine parameter infos 
            macharD(ref m_machparDouble.ibeta, ref m_machparDouble.it,ref m_machparDouble.irnd,ref m_machparDouble.ngrd,ref m_machparDouble.machep,ref m_machparDouble.negep,ref m_machparDouble.iexp,ref m_machparDouble.minexp,ref m_machparDouble.maxexp,ref m_machparDouble.eps,ref m_machparDouble.epsneg,ref m_machparDouble.xmin,ref m_machparDouble.xmax); 
            macharF(ref m_machparFloat.ibeta, ref m_machparFloat.it,ref m_machparFloat.irnd,ref m_machparFloat.ngrd,ref m_machparFloat.machep,ref m_machparFloat.negep,ref m_machparFloat.iexp,ref m_machparFloat.minexp,ref m_machparFloat.maxexp,ref m_machparFloat.eps,ref m_machparFloat.epsneg,ref m_machparFloat.xmin,ref m_machparFloat.xmax); 
            #endregion
        }
예제 #2
0
        /// <summary>
        /// main math class providing static builtin functions
        /// </summary>
        static ILMath()
        {
            #region initialize proc specific interfaces

            try
            {
                Type lapackType = Type.GetType("ILNumerics.Native." + Settings.ConfigFile.LAPACKLibrary);
                Lapack = (IILLapack)Activator.CreateInstance(lapackType);
            }
            catch
            {
                Lapack = new ILManagedLapack();
            }

            try
            {
                Type fftType = Type.GetType("ILNumerics.Native." + Settings.ConfigFile.FFTLibrary);
                FFT = (IILFFT)Activator.CreateInstance(fftType);
            }
            catch
            {
                FFT = new ILManagedFFT();
            }

            #endregion

            #region initialize machine parameter infos
            macharD(ref m_machparDouble.ibeta, ref m_machparDouble.it, ref m_machparDouble.irnd, ref m_machparDouble.ngrd, ref m_machparDouble.machep, ref m_machparDouble.negep, ref m_machparDouble.iexp, ref m_machparDouble.minexp, ref m_machparDouble.maxexp, ref m_machparDouble.eps, ref m_machparDouble.epsneg, ref m_machparDouble.xmin, ref m_machparDouble.xmax);
            macharF(ref m_machparFloat.ibeta, ref m_machparFloat.it, ref m_machparFloat.irnd, ref m_machparFloat.ngrd, ref m_machparFloat.machep, ref m_machparFloat.negep, ref m_machparFloat.iexp, ref m_machparFloat.minexp, ref m_machparFloat.maxexp, ref m_machparFloat.eps, ref m_machparFloat.epsneg, ref m_machparFloat.xmin, ref m_machparFloat.xmax);
            #endregion
        }
예제 #3
0
        /// <summary>
        /// main math class providing static builtin functions
        /// </summary>
        static ILMath()
        {
            #region initialize proc specific interfaces
            ILCPUID          cpuid;
            ILArray <double> A = new double[] { 1.0, -1.0 }, B = new double[] { 1.0, 2.0 };
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Unix:
                Lapack = new ILLapackGenLinux();
                FFT    = new ILFFTW3FFT();
                break;

            default:
                if (Lapack == null)
                {
                    cpuid = new ILCPUID();
                    switch (cpuid.vendor)
                    {
                    case "AuthenticAMD":
                        //Lapack = new ILACMLWrapper();
                        try {
                            Lapack = new ILACML4_1();
                            FFT    = new ILACMLFFT();
                            multiply(A.T, B);
                        } catch (Exception e) {
                            FFT = new ILMKLFFT();
                            try {
                                Lapack = new ILLapackMKL10_0();
                                multiply(A.T, B);
                            } catch (Exception) {
                                Lapack = new ILLapackGeneric();
                            }
                        }
                        break;

                    case "GenuineIntel":
                        FFT = new ILMKLFFT();
                        try {
                            Lapack = new ILLapackMKL10_0();
                            multiply(A.T, B);
                        } catch (Exception) {
                            Lapack = new ILLapackGeneric();
                        }
                        break;

                    default:
                        Lapack = new ILLapackGeneric();
                        FFT    = new ILMKLFFT();
                        break;
                    }
                }
                break;
            }
            #endregion
            #region initialize machine parameter infos
            macharD(ref m_machparDouble.ibeta, ref m_machparDouble.it, ref m_machparDouble.irnd, ref m_machparDouble.ngrd, ref m_machparDouble.machep, ref m_machparDouble.negep, ref m_machparDouble.iexp, ref m_machparDouble.minexp, ref m_machparDouble.maxexp, ref m_machparDouble.eps, ref m_machparDouble.epsneg, ref m_machparDouble.xmin, ref m_machparDouble.xmax);
            macharF(ref m_machparFloat.ibeta, ref m_machparFloat.it, ref m_machparFloat.irnd, ref m_machparFloat.ngrd, ref m_machparFloat.machep, ref m_machparFloat.negep, ref m_machparFloat.iexp, ref m_machparFloat.minexp, ref m_machparFloat.maxexp, ref m_machparFloat.eps, ref m_machparFloat.epsneg, ref m_machparFloat.xmin, ref m_machparFloat.xmax);
            #endregion
        }
예제 #4
0
        /// <summary>
        /// main math class providing static builtin functions
        /// </summary>
        static ILMath() {
            #region initialize proc specific interfaces
            ILCPUID cpuid; 
            ILArray<double> A = new double[]{1.0,-1.0}, B = new double[]{1.0, 2.0};
            switch (Environment.OSVersion.Platform) {
                case PlatformID.Unix:
                    Lapack = new ILLapackGenLinux(); 
                    FFT = new ILFFTW3FFT(); 
                    break; 
                default: 
                    if (Lapack == null) {
                        cpuid = new ILCPUID(); 
                        switch (cpuid.vendor) {
                            case "AuthenticAMD":
                                //Lapack = new ILACMLWrapper();
                                try {
                                    Lapack = new ILACML4_1(); 
                                    FFT = new ILACMLFFT(); 
                                    multiply(A.T,B); 
                                } catch (Exception e) {
                                    FFT = new ILMKLFFT();
                                    try {
                                        Lapack = new ILLapackMKL10_0();
                                        multiply(A.T,B); 
                                    } catch (Exception) {
                                        Lapack = new ILLapackGeneric(); 
                                    }
                                }
                                break; 
                            case "GenuineIntel":
                                FFT = new ILMKLFFT(); 
                                try {
                                    Lapack = new ILLapackMKL10_0();
                                    multiply(A.T,B); 
                                } catch (Exception) {
                                    Lapack = new ILLapackGeneric(); 
                                }
                                break; 
                            default:
                                Lapack = new ILLapackGeneric(); 
                                FFT = new ILMKLFFT(); 
                                break;
                        }
                    }
                    break; 
            }
            #endregion 
            #region initialize machine parameter infos 
            macharD(ref m_machparDouble.ibeta, ref m_machparDouble.it,ref m_machparDouble.irnd,ref m_machparDouble.ngrd,ref m_machparDouble.machep,ref m_machparDouble.negep,ref m_machparDouble.iexp,ref m_machparDouble.minexp,ref m_machparDouble.maxexp,ref m_machparDouble.eps,ref m_machparDouble.epsneg,ref m_machparDouble.xmin,ref m_machparDouble.xmax); 
            macharF(ref m_machparFloat.ibeta, ref m_machparFloat.it,ref m_machparFloat.irnd,ref m_machparFloat.ngrd,ref m_machparFloat.machep,ref m_machparFloat.negep,ref m_machparFloat.iexp,ref m_machparFloat.minexp,ref m_machparFloat.maxexp,ref m_machparFloat.eps,ref m_machparFloat.epsneg,ref m_machparFloat.xmin,ref m_machparFloat.xmax); 
            #endregion

        }
예제 #5
0
        // (Un)comment needed or not needed tests!
        /// <summary>
        /// Mains the specified args.
        /// </summary>
        /// <param name="args">The args.</param>
        static void Main(string[] args)
        {
            Console.Out.Write(Info());

            new TESTQuickSort().Run();

            #region manual test invocation list
            //new TEST_ILMath_max_double().Run();
            //new TEST_ILMath_max_single().Run();
            //new TEST_ILMath_max_complex().Run();
            //new TEST_ILMath_max_fcomplex().Run();
            //new TEST_ILMath_max_int().Run();
            //new TEST_ILMath_max_uint().Run();
            //new TEST_ILMath_max_short().Run();
            //new TEST_ILMath_max_ushort().Run();
            //new TEST_ILMath_max_char().Run();
            //new TEST_ILMath_max_byte().Run();

            //new TEST_ILMath_maxdim_double().Run();
            //new TEST_ILMath_maxdim_single().Run();
            //new TEST_ILMath_maxdim_complex().Run();
            //new TEST_ILMath_maxdim_fcomplex().Run();
            //new TEST_ILMath_maxdim_int().Run();
            //new TEST_ILMath_maxdim_uint().Run();
            //new TEST_ILMath_maxdim_short().Run();
            //new TEST_ILMath_maxdim_ushort().Run();
            //new TEST_ILMath_maxdim_char().Run();
            //new TEST_ILMath_maxdim_byte().Run();

            //new TEST_ILMath_maxdim2_double().Run();
            //new TEST_ILMath_maxdim2_single().Run();
            //new TEST_ILMath_maxdim2_complex().Run();
            //new TEST_ILMath_maxdim2_fcomplex().Run();
            //new TEST_ILMath_maxdim2_int().Run();
            //new TEST_ILMath_maxdim2_uint().Run();
            //new TEST_ILMath_maxdim2_short().Run();
            //new TEST_ILMath_maxdim2_ushort().Run();
            //new TEST_ILMath_maxdim2_char().Run();
            //new TEST_ILMath_maxdim2_byte().Run();

            //new TEST_ILMath_min_double().Run();
            //new TEST_ILMath_min_single().Run();
            //new TEST_ILMath_min_complex().Run();
            //new TEST_ILMath_min_fcomplex().Run();
            //new TEST_ILMath_min_int().Run();
            //new TEST_ILMath_min_uint().Run();
            //new TEST_ILMath_min_short().Run();
            //new TEST_ILMath_min_ushort().Run();
            //new TEST_ILMath_min_byte().Run();
            //new TEST_ILMath_min_char().Run();

            //new TEST_ILMath_mindim_double().Run();
            //new TEST_ILMath_mindim_single().Run();
            //new TEST_ILMath_mindim_complex().Run();
            //new TEST_ILMath_mindim_fcomplex().Run();
            //new TEST_ILMath_mindim_int().Run();
            //new TEST_ILMath_mindim_uint().Run();
            //new TEST_ILMath_mindim_short().Run();
            //new TEST_ILMath_mindim_ushort().Run();
            //new TEST_ILMath_mindim_char().Run();
            //new TEST_ILMath_mindim_byte().Run();

            //new TEST_ILMath_mindim2_double().Run();
            //new TEST_ILMath_mindim2_single().Run();
            //new TEST_ILMath_mindim2_complex().Run();
            //new TEST_ILMath_mindim2_fcomplex().Run();
            //new TEST_ILMath_mindim2_int().Run();
            //new TEST_ILMath_mindim2_uint().Run();
            //new TEST_ILMath_mindim2_short().Run();
            //new TEST_ILMath_mindim2_ushort().Run();
            //new TEST_ILMath_mindim2_char().Run();
            //new TEST_ILMath_mindim2_byte().Run();
            #endregion

            ILTestRunnerReflection runner = new ILTestRunnerReflection();
            runner.RunAll("TEST_ILMath");

            IILLapack oldLapack = Lapack;
            Lapack = new ILLapackMKL10_0();
            new TESTILLapack().Run();

            Lapack = new ILLapackGeneric();
            new TESTILLapack().Run();
            Lapack = new ILACML4_1();
            new TESTILLapack().Run();
            Lapack = oldLapack;

            new TESTILComplex().Run();
            new TESTILMemoryPool().Run();

            new TESTILStorage().Run();
            new TESTILMatFile().Run();
            new TESTILCell().Run();
            new TESTBucketSort().Run();
            new TESTILAlgorithm().Run();
            new TESTILNumericArray().Run();
            new TESTLogical().Run();
            new TESTILDimension().Run();

            new TESTILArray().Run();
            new TESTILMath().Run();
            new TESTILFFT().Run();

            Console.Out.WriteLine("Done.");
            Console.In.ReadLine();
        }