-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathUserBiCgStabFloat.cs
More file actions
81 lines (73 loc) · 2.37 KB
/
Copy pathUserBiCgStabFloat.cs
File metadata and controls
81 lines (73 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra.Single.Solvers;
using MathNet.Numerics.LinearAlgebra.Solvers;
namespace NumericsSamples
{
/// <summary>
/// Sample of user-defined solver setup
/// </summary>
public class UserBiCgStabFloat : IIterativeSolverSetup<float>
{
/// <summary>
/// Gets the type of the solver that will be created by this setup object.
/// </summary>
public Type SolverType
{
get { return null; }
}
/// <summary>
/// Gets type of preconditioner, if any, that will be created by this setup object.
/// </summary>
public Type PreconditionerType
{
get { return null; }
}
/// <summary>
/// Creates a fully functional iterative solver with the default settings
/// given by this setup.
/// </summary>
/// <returns>A new <see cref="IIterativeSolver{T}"/>.</returns>
public IIterativeSolver<float> CreateSolver()
{
return new BiCgStab();
}
public IPreconditioner<float> CreatePreconditioner()
{
return new MyPreconditionerFloat();
}
/// <summary>
/// Gets the relative speed of the solver.
/// </summary>
/// <value>Returns a value between 0 and 1, inclusive.</value>
public double SolutionSpeed
{
get { return 0.99; }
}
/// <summary>
/// Gets the relative reliability of the solver.
/// </summary>
/// <value>Returns a value between 0 and 1 inclusive.</value>
public double Reliability
{
get { return 0.99; }
}
}
public class UserBiCgStabComplex32 : IIterativeSolverSetup<Complex32>
{
#region IIterativeSolverSetup<Complex32>
public IIterativeSolver<Complex32> CreateSolver()
{
return new MathNet.Numerics.LinearAlgebra.Complex32.Solvers.BiCgStab();
}
public IPreconditioner<Complex32> CreatePreconditioner()
{
return null;
}
public Type SolverType { get { return null; } }
public Type PreconditionerType { get { return null; } }
public double SolutionSpeed { get { return 0.99; } }
public double Reliability { get { return 0.99; } }
#endregion
}
}