diff --git a/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs b/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs index d51bf898..1a1c6a73 100644 --- a/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs +++ b/src/Examples/LinearAlgebra/IterativeSolvers/CompositeSolverExample.cs @@ -147,7 +147,7 @@ namespace Examples.LinearAlgebra.IterativeSolversExamples /// /// Sample of user-defined solver setup /// - public class UserBiCgStab : IIterativeSolverSetup + public class UserBiCgStab : IIterativeSolverSetup { /// /// Gets the type of the solver that will be created by this setup object. diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/IIterativeSolverSetup.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/IIterativeSolverSetup.cs deleted file mode 100644 index ad4363f8..00000000 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/IIterativeSolverSetup.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// http://mathnetnumerics.codeplex.com -// -// Copyright (c) 2009-2010 Math.NET -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using MathNet.Numerics.LinearAlgebra.Solvers; - -namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers -{ - -#if NOSYSNUMERICS - using Complex = Numerics.Complex; -#else - using Complex = System.Numerics.Complex; -#endif - - /// - /// Defines the interface for objects that can create an iterative solver with - /// specific settings. This interface is used to pass iterative solver creation - /// setup information around. - /// - public interface IIterativeSolverSetup - { - /// - /// Gets the type of the solver that will be created by this setup object. - /// - Type SolverType { get; } - - /// - /// Gets type of preconditioner, if any, that will be created by this setup object. - /// - Type PreconditionerType { get; } - - /// - /// Creates a fully functional iterative solver with the default settings - /// given by this setup. - /// - /// A new . - IIterativeSolver CreateNew(); - - /// - /// Gets the relative speed of the solver. - /// - /// Returns a value between 0 and 1, inclusive. - double SolutionSpeed { get; } - - /// - /// Gets the relative reliability of the solver. - /// - /// Returns a value between 0 and 1 inclusive. - double Reliability { get; } - } -} \ No newline at end of file diff --git a/src/Numerics/LinearAlgebra/Complex/Solvers/Iterative/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex/Solvers/Iterative/CompositeSolver.cs index 79fc9c9e..b225590b 100644 --- a/src/Numerics/LinearAlgebra/Complex/Solvers/Iterative/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Complex/Solvers/Iterative/CompositeSolver.cs @@ -108,7 +108,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.Iterative /// The collection of iterative solver setups. Stored based on the /// ratio between the relative speed and relative accuracy. /// - private static readonly SortedList> SolverSetups = new SortedList>(new DoubleComparer()); + private static readonly SortedList>> SolverSetups = new SortedList>>(new DoubleComparer()); #endif #region Solver information loading methods @@ -273,18 +273,18 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.Iterative { interfaceTypes.Clear(); interfaceTypes.AddRange(type.GetInterfaces()); - if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) + if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) { continue; } // See if we actually want this type of iterative solver - IIterativeSolverSetup setup; + IIterativeSolverSetup setup; try { // If something goes wrong we just ignore it and move on with the next type. // There should probably be a log somewhere indicating that something went wrong? - setup = (IIterativeSolverSetup)Activator.CreateInstance(type); + setup = (IIterativeSolverSetup)Activator.CreateInstance(type); } catch (ArgumentException) { @@ -327,7 +327,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Solvers.Iterative var ratio = setup.SolutionSpeed / setup.Reliability; if (!SolverSetups.ContainsKey(ratio)) { - SolverSetups.Add(ratio, new List()); + SolverSetups.Add(ratio, new List>()); } var list = SolverSetups[ratio]; diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/Iterative/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Complex32/Solvers/Iterative/CompositeSolver.cs index d53ddd74..0fc08061 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/Iterative/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Complex32/Solvers/Iterative/CompositeSolver.cs @@ -103,7 +103,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.Iterative /// The collection of iterative solver setups. Stored based on the /// ratio between the relative speed and relative accuracy. /// - private static readonly SortedList> SolverSetups = new SortedList>(new DoubleComparer()); + private static readonly SortedList>> SolverSetups = new SortedList>>(new DoubleComparer()); #endif #region Solver information loading methods @@ -268,18 +268,18 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.Iterative { interfaceTypes.Clear(); interfaceTypes.AddRange(type.GetInterfaces()); - if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) + if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) { continue; } // See if we actually want this type of iterative solver - IIterativeSolverSetup setup; + IIterativeSolverSetup setup; try { // If something goes wrong we just ignore it and move on with the next type. // There should probably be a log somewhere indicating that something went wrong? - setup = (IIterativeSolverSetup)Activator.CreateInstance(type); + setup = (IIterativeSolverSetup)Activator.CreateInstance(type); } catch (ArgumentException) { @@ -322,7 +322,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers.Iterative var ratio = setup.SolutionSpeed / setup.Reliability; if (!SolverSetups.ContainsKey(ratio)) { - SolverSetups.Add(ratio, new List()); + SolverSetups.Add(ratio, new List>()); } var list = SolverSetups[ratio]; diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/IIterativeSolverSetup.cs b/src/Numerics/LinearAlgebra/Double/Solvers/IIterativeSolverSetup.cs deleted file mode 100644 index 75aff271..00000000 --- a/src/Numerics/LinearAlgebra/Double/Solvers/IIterativeSolverSetup.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// http://mathnetnumerics.codeplex.com -// -// Copyright (c) 2009-2010 Math.NET -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -using MathNet.Numerics.LinearAlgebra.Solvers; - -namespace MathNet.Numerics.LinearAlgebra.Double.Solvers -{ - using System; - - /// - /// Defines the interface for objects that can create an iterative solver with - /// specific settings. This interface is used to pass iterative solver creation - /// setup information around. - /// - public interface IIterativeSolverSetup - { - /// - /// Gets the type of the solver that will be created by this setup object. - /// - Type SolverType { get; } - - /// - /// Gets type of preconditioner, if any, that will be created by this setup object. - /// - Type PreconditionerType { get; } - - /// - /// Creates a fully functional iterative solver with the default settings - /// given by this setup. - /// - /// A new . - IIterativeSolver CreateNew(); - - /// - /// Gets the relative speed of the solver. - /// - /// Returns a value between 0 and 1, inclusive. - double SolutionSpeed { get; } - - /// - /// Gets the relative reliability of the solver. - /// - /// Returns a value between 0 and 1 inclusive. - double Reliability { get; } - } -} \ No newline at end of file diff --git a/src/Numerics/LinearAlgebra/Double/Solvers/Iterative/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Double/Solvers/Iterative/CompositeSolver.cs index 1dd1e7d4..2e3c7784 100644 --- a/src/Numerics/LinearAlgebra/Double/Solvers/Iterative/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Double/Solvers/Iterative/CompositeSolver.cs @@ -98,7 +98,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.Iterative /// The collection of iterative solver setups. Stored based on the /// ratio between the relative speed and relative accuracy. /// - private static readonly SortedList> SolverSetups = new SortedList>(new DoubleComparer()); + private static readonly SortedList>> SolverSetups = new SortedList>>(new DoubleComparer()); #endif #region Solver information loading methods @@ -263,18 +263,18 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.Iterative { interfaceTypes.Clear(); interfaceTypes.AddRange(type.GetInterfaces()); - if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) + if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) { continue; } // See if we actually want this type of iterative solver - IIterativeSolverSetup setup; + IIterativeSolverSetup setup; try { // If something goes wrong we just ignore it and move on with the next type. // There should probably be a log somewhere indicating that something went wrong? - setup = (IIterativeSolverSetup)Activator.CreateInstance(type); + setup = (IIterativeSolverSetup)Activator.CreateInstance(type); } catch (ArgumentException) { @@ -317,7 +317,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Solvers.Iterative var ratio = setup.SolutionSpeed / setup.Reliability; if (!SolverSetups.ContainsKey(ratio)) { - SolverSetups.Add(ratio, new List()); + SolverSetups.Add(ratio, new List>()); } var list = SolverSetups[ratio]; diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/IIterativeSolverSetup.cs b/src/Numerics/LinearAlgebra/Single/Solvers/IIterativeSolverSetup.cs deleted file mode 100644 index 9be6a3ba..00000000 --- a/src/Numerics/LinearAlgebra/Single/Solvers/IIterativeSolverSetup.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// http://mathnetnumerics.codeplex.com -// -// Copyright (c) 2009-2010 Math.NET -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -using MathNet.Numerics.LinearAlgebra.Solvers; - -namespace MathNet.Numerics.LinearAlgebra.Single.Solvers -{ - using System; - - /// - /// Defines the interface for objects that can create an iterative solver with - /// specific settings. This interface is used to pass iterative solver creation - /// setup information around. - /// - public interface IIterativeSolverSetup - { - /// - /// Gets the type of the solver that will be created by this setup object. - /// - Type SolverType { get; } - - /// - /// Gets type of preconditioner, if any, that will be created by this setup object. - /// - Type PreconditionerType { get; } - - /// - /// Creates a fully functional iterative solver with the default settings - /// given by this setup. - /// - /// A new . - IIterativeSolver CreateNew(); - - /// - /// Gets the relative speed of the solver. - /// - /// Returns a value between 0 and 1, inclusive. - double SolutionSpeed { get; } - - /// - /// Gets the relative reliability of the solver. - /// - /// Returns a value between 0 and 1 inclusive. - double Reliability { get; } - } -} \ No newline at end of file diff --git a/src/Numerics/LinearAlgebra/Single/Solvers/Iterative/CompositeSolver.cs b/src/Numerics/LinearAlgebra/Single/Solvers/Iterative/CompositeSolver.cs index 73e8f095..47a1abcc 100644 --- a/src/Numerics/LinearAlgebra/Single/Solvers/Iterative/CompositeSolver.cs +++ b/src/Numerics/LinearAlgebra/Single/Solvers/Iterative/CompositeSolver.cs @@ -101,7 +101,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.Iterative /// The collection of iterative solver setups. Stored based on the /// ratio between the relative speed and relative accuracy. /// - private static readonly SortedList> SolverSetups = new SortedList>(new DoubleComparer()); + private static readonly SortedList>> SolverSetups = new SortedList>>(new DoubleComparer()); #endif #region Solver information loading methods @@ -266,18 +266,18 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.Iterative { interfaceTypes.Clear(); interfaceTypes.AddRange(type.GetInterfaces()); - if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) + if (!interfaceTypes.Any(match => typeof(IIterativeSolverSetup).IsAssignableFrom(match))) { continue; } // See if we actually want this type of iterative solver - IIterativeSolverSetup setup; + IIterativeSolverSetup setup; try { // If something goes wrong we just ignore it and move on with the next type. // There should probably be a log somewhere indicating that something went wrong? - setup = (IIterativeSolverSetup)Activator.CreateInstance(type); + setup = (IIterativeSolverSetup)Activator.CreateInstance(type); } catch (ArgumentException) { @@ -320,7 +320,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Solvers.Iterative var ratio = setup.SolutionSpeed / setup.Reliability; if (!SolverSetups.ContainsKey(ratio)) { - SolverSetups.Add(ratio, new List()); + SolverSetups.Add(ratio, new List>()); } var list = SolverSetups[ratio]; diff --git a/src/Numerics/LinearAlgebra/Complex32/Solvers/IIterativeSolverSetup.cs b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs similarity index 92% rename from src/Numerics/LinearAlgebra/Complex32/Solvers/IIterativeSolverSetup.cs rename to src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs index fb055c98..d7f0fff3 100644 --- a/src/Numerics/LinearAlgebra/Complex32/Solvers/IIterativeSolverSetup.cs +++ b/src/Numerics/LinearAlgebra/Solvers/IIterativeSolverSetup.cs @@ -29,18 +29,15 @@ // using System; -using MathNet.Numerics.LinearAlgebra.Solvers; -namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers +namespace MathNet.Numerics.LinearAlgebra.Solvers { - using Numerics; - /// /// Defines the interface for objects that can create an iterative solver with /// specific settings. This interface is used to pass iterative solver creation /// setup information around. /// - public interface IIterativeSolverSetup + public interface IIterativeSolverSetup where T : struct, IEquatable, IFormattable { /// /// Gets the type of the solver that will be created by this setup object. @@ -57,7 +54,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Solvers /// given by this setup. /// /// A new . - IIterativeSolver CreateNew(); + IIterativeSolver CreateNew(); /// /// Gets the relative speed of the solver. diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index 83f39185..02423683 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -190,7 +190,6 @@ - @@ -207,7 +206,6 @@ - @@ -222,7 +220,7 @@ - + @@ -312,7 +310,6 @@ -