public void Precondition(IVector <double> vIn, IVector <double> vOut) { //if (analyzer.FactorizedMatrices.Count != 1) // throw new InvalidOperationException("Cannot precondition with more than one subdomains"); //foreach (var m in analyzer.FactorizedMatrices.Values) // m.Solve(vIn, ((Vector<double>)vOut).Data); preconditioner.Solve(vIn, ((Vector <double>)vOut).Data); }
public void Solve() { foreach (ISolverSubdomain subdomain in subdomainsDictionary.Values) { double[] x = ((Vector <double>)subdomain.Solution).Data; SkylineMatrix2D <double> k = ((SkylineMatrix2D <double>)subdomain.Matrix); Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); k.Solve(subdomain.RHS, x); stopWatch.Stop(); DestroyAccuracy(subdomain); x = new double[k.Rows]; //LessenAccuracy(1e-7); k.Solve(subdomain.RHS, x); var xVec = new Vector <double>(x); var y = xVec.Norm; //StreamWriter sw = File.CreateText(@"c:\fbsub.txt"); //sw.WriteLine(stopWatch.ElapsedMilliseconds.ToString()); //sw.Close(); } }