コード例 #1
0
        /// <summary>
        /// Try to use the Intel MKL native provider for linear algebra.
        /// </summary>
        /// <returns>
        /// True if the provider was found and initialized successfully.
        /// False if it failed and the previous provider is still active.
        /// </returns>
        public static bool TryUseNativeMKL()
        {
            bool linearAlgebra    = LinearAlgebraControl.TryUseNativeMKL();
            bool fourierTransform = FourierTransformControl.TryUseNativeMKL();

            return(linearAlgebra || fourierTransform);
        }
コード例 #2
0
        public void ProviderMatchesManagedProviderArbitraryLarge64()
        {
            // 30870 = 2*3*3*5*7*7*7
            var samples = Generate.RandomComplex(30870, GetUniform(1));

            Verify(samples, 10, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward);
        }
コード例 #3
0
        public void ProviderMatchesManagedProviderPowerOfTwoLarge64()
        {
            // 65536 = 2^16
            var samples = Generate.RandomComplex(65536, GetUniform(1));

            Verify(samples, 10, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward);
        }
コード例 #4
0
 public static void UseNativeMKL(
     Providers.Common.Mkl.MklConsistency consistency = Providers.Common.Mkl.MklConsistency.Auto,
     Providers.Common.Mkl.MklPrecision precision     = Providers.Common.Mkl.MklPrecision.Double,
     Providers.Common.Mkl.MklAccuracy accuracy       = Providers.Common.Mkl.MklAccuracy.High)
 {
     LinearAlgebraControl.UseNativeMKL(consistency, precision, accuracy);
     FourierTransformControl.UseNativeMKL();
 }
コード例 #5
0
ファイル: Control.cs プロジェクト: jkalias/mathnet-numerics
        /// <summary>
        /// Try to use the Intel MKL native provider for linear algebra.
        /// </summary>
        /// <returns>
        /// True if the provider was found and initialized successfully.
        /// False if it failed and the previous provider is still active.
        /// </returns>
        public static bool TryUseNativeMKL()
        {
            bool linearAlgebra      = LinearAlgebraControl.TryUseNativeMKL();
            bool fourierTransform   = FourierTransformControl.TryUseNativeMKL();
            bool directSparseSolver = SparseSolverControl.TryUseNativeMKL();

            return(linearAlgebra || fourierTransform || directSparseSolver);
        }
コード例 #6
0
ファイル: Control.cs プロジェクト: jkalias/mathnet-numerics
        /// <summary>
        /// Use the best provider available.
        /// </summary>
        public static void UseBestProviders()
        {
            if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing)
            {
                UseManaged();
                return;
            }

            LinearAlgebraControl.UseBest();
            FourierTransformControl.UseBest();
            SparseSolverControl.UseBest();
        }
コード例 #7
0
ファイル: Control.cs プロジェクト: jkalias/mathnet-numerics
        /// <summary>
        /// Try to use any available native provider in an undefined order.
        /// </summary>
        /// <returns>
        /// True if one of the native providers was found and successfully initialized.
        /// False if it failed and the previous provider is still active.
        /// </returns>
        public static bool TryUseNative()
        {
            if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing)
            {
                return(false);
            }

            bool linearAlgebra      = LinearAlgebraControl.TryUseNative();
            bool fourierTransform   = FourierTransformControl.TryUseNative();
            bool directSparseSolver = SparseSolverControl.TryUseNative();

            return(linearAlgebra || fourierTransform || directSparseSolver);
        }
コード例 #8
0
        public void ProviderSurvivesFreeResources()
        {
            var samples = Generate.PeriodicMap(16, w => new Complex(Math.Sin(w), 0), 16, 1.0, Constants.Pi2);

            var spectrum1 = new Complex[samples.Length];

            samples.Copy(spectrum1);
            FourierTransformControl.Provider.Forward(spectrum1, FourierTransformScaling.ForwardScaling);

            FourierTransformControl.FreeResources();

            var spectrum2 = new Complex[samples.Length];

            samples.Copy(spectrum2);
            FourierTransformControl.Provider.Forward(spectrum2, FourierTransformScaling.ForwardScaling);

            for (var i = 0; i < spectrum1.Length; i++)
            {
                Assert.AreEqual(spectrum1[i], spectrum2[i]);
            }
        }
コード例 #9
0
 /// <summary>
 /// Use the Intel MKL native provider for linear algebra.
 /// Throws if it is not available or failed to initialize, in which case the previous provider is still active.
 /// </summary>
 public static void UseNativeMKL()
 {
     LinearAlgebraControl.UseNativeMKL();
     FourierTransformControl.UseNativeMKL();
 }
コード例 #10
0
 public static bool TryUseNativeMKL() => FourierTransformControl.TryUse(CreateNativeMKL());
コード例 #11
0
ファイル: Control.cs プロジェクト: zzkongfu/mathnet-numerics
 /// <summary>
 /// Use the best provider available.
 /// </summary>
 public static void UseBestProviders()
 {
     LinearAlgebraControl.UseBest();
     FourierTransformControl.UseBest();
 }
コード例 #12
0
ファイル: Control.cs プロジェクト: zzkongfu/mathnet-numerics
 public static void UseManagedReference()
 {
     LinearAlgebraControl.UseManagedReference();
     FourierTransformControl.UseManaged();
 }
コード例 #13
0
ファイル: Control.cs プロジェクト: zzkongfu/mathnet-numerics
 public static void FreeResources()
 {
     LinearAlgebraControl.FreeResources();
     FourierTransformControl.FreeResources();
 }
コード例 #14
0
ファイル: Control.cs プロジェクト: jkalias/mathnet-numerics
 public static void UseManaged()
 {
     LinearAlgebraControl.UseManaged();
     FourierTransformControl.UseManaged();
     SparseSolverControl.UseManaged();
 }
コード例 #15
0
        public void ProviderMatchesManagedProviderArbitraryLarge32_GH286()
        {
            var samples = Generate.RandomComplex32(46500, GetUniform(1));

            Verify(samples, 5, FourierTransformScaling.NoScaling, FourierTransformControl.CreateManaged().Forward, FourierTransformControl.Provider.Forward);
        }
コード例 #16
0
ファイル: ProgressDlg.cs プロジェクト: radtek/WaveViewer
 static ProgressDlg()
 {
     FFT = FourierTransformControl.CreateManaged();
 }