Commit 948d7eb1 authored by Dmitry Bagaev's avatar Dmitry Bagaev

XML database parser

1) XML Database parser
2) todo Solver::Solver(std::string solverName, std::string prefix,
INMOST_MPI_Comm _comm)
parent 9915f5f8
......@@ -264,7 +264,6 @@ set(INMOST_INSTALL_HEADERS Source/Headers/inmost.h
Source/Headers/inmost_partitioner.h
Source/Headers/inmost_solver.h
Source/Headers/inmost_solver_interface.h
Source/Headers/inmost_solver_parameters.h
Source/Headers/inmost_sparse.h
Source/Headers/inmost_xml.h
Source/Headers/inmost_utils.h
......@@ -297,7 +296,6 @@ set_property(TARGET inmost PROPERTY PUBLIC_HEADER
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_partitioner.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_solver.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_solver_interface.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_solver_parameters.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_sparse.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_variable.h"
"${PROJECT_SOURCE_DIR}/Source/Headers/inmost_xml.h"
......
......@@ -13,7 +13,6 @@ set(HEADER
${CMAKE_CURRENT_SOURCE_DIR}/inmost_mesh.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_solver.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_solver_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_solver_parameters.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_partitioner.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_autodiff.h
${CMAKE_CURRENT_SOURCE_DIR}/inmost_expression.h
......
......@@ -30,6 +30,7 @@ namespace INMOST
class Solver
{
private:
static std::vector<SolverParameters> parameters;
static int *argc;
static char ***argv;
static const char *database;
......@@ -278,17 +279,23 @@ namespace INMOST
/// @return Condition number or 1.0e100 if not converged.
INMOST_DATA_REAL_TYPE Condest(INMOST_DATA_REAL_TYPE tol, INMOST_DATA_ENUM_TYPE maxits = 100);
/// Checks if solver available
/// @param name Solver name
static bool isSolverAvailable(std::string name);
/// Return the list of all available solvers
static std::vector<std::string> getAvailableSolvers();
~Solver();
private:
static std::string parseDatabase(std::string solverName);
static void parseXMLDatabase(const char* xml_database);
};
typedef std::vector<std::string>::iterator solvers_names_iterator_t;
typedef std::vector<SolverParameters>::iterator solver_parameters_iterator_t;
}
#endif
......
......@@ -9,6 +9,22 @@ namespace INMOST {
#if defined(USE_SOLVER)
class SolverParameters {
public:
const std::string solverName;
const std::string solverPrefix;
const std::string internalFile;
std::vector<std::pair<std::string, std::string> > parameters;
SolverParameters(std::string solverName, std::string solverPrefix, std::string internalFile);
SolverParameters(const SolverParameters &other);
~SolverParameters();
};
typedef std::vector<std::pair<std::string, std::string> >::iterator parameters_iterator_t;
class SolverInterface {
protected:
INMOST_MPI_Comm communicator;
......@@ -19,7 +35,7 @@ namespace INMOST {
virtual void Assign(const SolverInterface *other) = 0;
virtual void Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix) = 0;
virtual void Setup(int *argc, char ***argv, SolverParameters &p) = 0;
virtual void SetMatrix(Sparse::Matrix &A, bool ModifiedPattern, bool OldPreconditioner) = 0;
......
#ifndef INMOST_SOLVER_PARAMETERS_H
#define INMOST_SOLVER_PARAMETERS_H
#include <string>
#include "inmost_utils.h"
#include "inmost_common.h"
namespace INMOST {
#if defined(USE_SOLVER)
#endif
}
#endif //INMOST_SOLVER_PARAMETERS_H
......@@ -21,6 +21,8 @@ namespace INMOST {
return ss.str();
}
std::string string_to_lower(const std::string &str);
}
#endif //INMOST_UTILS_H
......@@ -226,6 +226,9 @@ public:
};
void WriteXML(const XMLReader::XMLTree & t, std::ostream & output, int offset = 0);
typedef std::vector<XMLReader::XMLTree>::iterator xml_reader_tree_iterator_t;
typedef std::vector<XMLReader::XMLAttrib>::iterator xml_reader_attrib_iterator_t;
}
......
......@@ -1457,9 +1457,15 @@ namespace INMOST
ret.finish = ReadCloseTag(); //retrive '>'
if( !include.empty() )
{
if( verbose > 1 ) Report("info: switching to stream %s",(GetFolder(get_Stream().src) + "/" + include).c_str());
PushStream((GetFolder(get_Stream().src) + "/" + include).c_str()); //switch to the included file
std::string folder = GetFolder(get_Stream().src);
if (!folder.empty()) {
folder += "/";
}
if( verbose > 1 ) Report("info: switching to stream %s",(folder + include).c_str());
PushStream((folder + include).c_str()); //switch to the included file
}
}
else //encountered '</' of the root tag, no tag was red
......
#include "inmost_solver_parameters.h"
#include "inmost_solver.h"
#include "inmost_solver_interface.h"
namespace INMOST {
SolverParameters::SolverParameters(std::string solverName, std::string solverPrefix, std::string internalFile) : solverName(solverName),
solverPrefix(solverPrefix),
internalFile(internalFile) {}
SolverParameters::SolverParameters(const SolverParameters &other) : solverName(other.solverName), solverPrefix(other.solverPrefix),
internalFile(other.internalFile),
parameters(other.parameters) {
}
SolverParameters::~SolverParameters() {}
}
......@@ -29,15 +29,21 @@
#endif
#if defined(USE_SOLVER_SUPERLU)
#include "solver_superlu/SolverSUPERLU.h"
#endif
#if defined(HAVE_SOLVER_K3BIILU2)
#include "solver_k3biilu2/SolverK3BIILU2.h"
#endif
#if defined(HAVE_SOLVER_FCBIILU2)
#include "solver_fcbiilu2/SolverFCBIILU2.h"
#endif
namespace INMOST {
......@@ -47,21 +53,50 @@ namespace INMOST {
const char *Solver::database = NULL;
bool Solver::is_initialized = false;
bool Solver::is_finalized = false;
std::vector<SolverParameters> Solver::parameters = std::vector<SolverParameters>();
Solver::Solver(std::string solverName, std::string prefix, INMOST_MPI_Comm _comm) {
this->solver = SolverMaster::getSolver(solverName);
this->prefix = prefix;
std::string lowerName = string_to_lower(solverName);
this->solver = SolverMaster::getSolver(lowerName);
this->prefix = string_to_lower(prefix);
solver->SetCommunicator(_comm);
std::string solverDatabasePath = Solver::parseDatabase(solverName);
solver->Initialize(argc, argv, solverDatabasePath.c_str(), prefix);
//TODO find easiest way
bool parametersFound = false;
if (Solver::parameters.size() > 0) {
for (solver_parameters_iterator_t parameters = Solver::parameters.end() - 1; parameters >= Solver::parameters.begin(); parameters--) {
if ((*parameters).solverName == lowerName && (*parameters).solverPrefix == (this->prefix)) {
solver->Setup(argc, argv, *parameters);
parametersFound = true;
break;
}
}
}
if (!parametersFound) {
SolverParameters emptyParameters(lowerName, this->prefix, "");
solver->Setup(argc, argv, emptyParameters);
}
}
Solver::Solver(const Solver &other) {
this->solver = SolverMaster::copySolver(other.solver);
this->prefix = other.prefix;
solver->SetCommunicator(other.solver->GetCommunicator());
std::string solverDatabasePath = Solver::parseDatabase(solver->SolverName());
solver->Initialize(argc, argv, solverDatabasePath.c_str(), this->prefix);
//TODO find easiest way
bool parametersFound = false;
if (Solver::parameters.size() > 0) {
for (solver_parameters_iterator_t parameters = Solver::parameters.end() - 1; parameters >= Solver::parameters.begin(); parameters--) {
if ((*parameters).solverName == other.solver->SolverName() && (*parameters).solverPrefix == (this->prefix)) {
solver->Setup(argc, argv, *parameters);
parametersFound = true;
break;
}
}
}
if (!parametersFound) {
SolverParameters emptyParameters(other.solver->SolverName(), this->prefix, "");
solver->Setup(argc, argv, emptyParameters);
}
}
Solver &Solver::operator=(const Solver &other) {
......@@ -126,6 +161,18 @@ namespace INMOST {
#if defined(HAVE_SOLVER_FCBIILU2)
SolverMaster::registerSolver<SolverFCBIILU2>("fcbiilu2");
#endif
Solver::parseXMLDatabase(database);
//Debug
// for (auto p = parameters.begin(); p < parameters.end(); p++) {
// std::cout << "============================================================================" << std::endl;
// std::cout << (*p).solverName << ":" << (*p).solverPrefix << ":" << (*p).internalFile << std::endl;
// for (auto pp = (*p).parameters.begin(); pp < (*p).parameters.end(); pp++) {
// std::cout << (*pp).first << " = " << (*pp).second << std::endl;
// }
// std::cout << "============================================================================" << std::endl;
// }
Sparse::CreateRowEntryType();
}
......@@ -214,33 +261,79 @@ namespace INMOST {
delete solver;
}
std::string Solver::parseDatabase(std::string solverName) {
const char *name = solverName.c_str();
if (database != NULL) {
FILE *f = fopen(database, "r");
if (f != NULL) {
char str[4096];
while (!feof(f) && fgets(str, 4096, f)) {
int k = 0, l;
for (k = 0; k < (int) strlen(str); ++k) {
if (str[k] == ':') break;
void Solver::parseXMLDatabase(const char *xml_database) {
if (xml_database == NULL) return;
std::ifstream input;
input.open(xml_database);
if (input.fail()) {
std::cout << __FILE__ << ": XML database file not found " << std::endl;
return;
}
XMLReader reader(std::string(xml_database), input);
try {
XMLReader::XMLTree root = reader.ReadXML();
if (root.tag.name != "SolverParameters") {
std::cout << __FILE__ << ": Bad XML database file" << std::endl;
return;
}
for (xml_reader_tree_iterator_t solver = root.children.begin(); solver < root.children.end(); solver++) {
std::string solverName = string_to_lower((*solver).tag.name);
std::string internalFile = "";
if ((*solver).tag.attributes.size() != 0) {
for (xml_reader_attrib_iterator_t attr = (*solver).tag.attributes.begin(); attr < (*solver).tag.attributes.end(); attr++) {
if ((*attr).name == "File" || (*attr).name == "file" || (*attr).name == "FILE") {
internalFile = (*attr).value;
}
}
if (k == strlen(str)) continue; //invalid line
for (l = 0; l < k; ++l) str[l] = tolower(str[l]);
l = (int) strlen(str) - 1; // Right-trim string
while (l > 0 && isspace(str[l])) --l;
str[l + 1] = 0;
l = k + 1;
while (l < (int) strlen(str) && isspace(str[l])) ++l;
if (l == strlen(str)) continue; //skip empty entry
if (!strncmp(str, name, k)) {
return std::string(str + l);
}
if ((*solver).children.size() == 0) {
//Internal solver
parameters.push_back(SolverParameters(solverName, "", internalFile));
} else {
//Inner solver
for (xml_reader_tree_iterator_t prefix = (*solver).children.begin(); prefix < (*solver).children.end(); prefix++) {
internalFile = "";
std::string solverPrefix = string_to_lower((*prefix).tag.name);
if ((*prefix).tag.attributes.size() != 0) {
for (xml_reader_attrib_iterator_t attr = (*prefix).tag.attributes.begin(); attr < (*prefix).tag.attributes.end(); attr++) {
if ((*attr).name == "File" || (*attr).name == "file" || (*attr).name == "FILE") {
internalFile = (*attr).value;
}
}
}
SolverParameters prefix_p = SolverParameters(solverName, solverPrefix, internalFile);
for (xml_reader_tree_iterator_t p = (*prefix).children.begin(); p < (*prefix).children.end(); p++) {
if ((*p).tag.attributes.size() == 1) {
if ((*p).tag.attributes[0].name == "value" || (*p).tag.attributes[0].name == "Value") {
prefix_p.parameters.push_back(std::make_pair((*p).tag.name, (*p).tag.attributes[0].value));
}
}
}
parameters.push_back(prefix_p);
}
}
fclose(f);
}
} catch (...) {
std::cout << __FILE__ << ": Error while parsing xml database file" << std::endl;
}
return std::string("");
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ namespace INMOST {
throw INMOST::SolverUnsupportedOperation; //later
}
void SolverANI::Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix) {
void SolverANI::Setup(int *argc, char ***argv, SolverParameters &p) {
solver.n = 0;
m.n = 0;
}
......
......@@ -19,7 +19,7 @@ namespace INMOST {
virtual void Assign(const SolverInterface *other);
virtual void Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix);
virtual void Setup(int *argc, char ***argv, SolverParameters &p);
virtual void SetMatrix(Sparse::Matrix &A, bool ModifiedPattern, bool OldPreconditioner);
......
......@@ -28,9 +28,9 @@ namespace INMOST {
}
}
void SolverFCBIILU2::Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix) {
SolverInitDataFcbiilu2(&solver_data, communicator, prefix.c_str());
SolverInitializeFcbiilu2(argc, argv, parameters_file);
void SolverFCBIILU2::Setup(int *argc, char ***argv, SolverParameters &p) {
SolverInitDataFcbiilu2(&solver_data, communicator, p.solverPrefix.c_str());
SolverInitializeFcbiilu2(argc, argv, p.internalFile.c_str());
}
void SolverFCBIILU2::SetMatrix(Sparse::Matrix &A, bool ModifiedPattern, bool OldPreconditioner) {
......
......@@ -18,7 +18,7 @@ namespace INMOST {
virtual void Assign(const SolverInterface *other);
virtual void Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix);
virtual void Setup(int *argc, char ***argv, SolverParameters &p);
virtual void SetMatrix(Sparse::Matrix &A, bool ModifiedPattern, bool OldPreconditioner);
......
......@@ -3,24 +3,24 @@
namespace INMOST {
SolverInner::SolverInner() {
iters = 2500;
scale_iters = 6;
condest = 1;
ddpqatol = 1;
overlap = 1;
ell = 2;
maximum_iterations = 2500;
rescale_iterations = 6;
condition_estimation = 1;
adapt_ddpq_tolerance = 1;
schwartz_overlap = 1;
gmres_substeps = 2;
reorder_nnz = 1;
atol = 1.0e-5;
rtol = 1.0e-12;
dtol = 1.0e+100;
tau = 0.005;
tau2 = 0.00005;
ddpqtol = 0.75;
fill = 3;
drop_tolerance = 0.005;
reuse_tolerance = 0.00005;
ddpq_tolerance = 0.75;
fill_level = 3;
}
SolverInner::SolverInner(const SolverInterface *other): SolverInterface(other) {
SolverInner::SolverInner(const SolverInterface *other) : SolverInterface(other) {
//You should not really want to copy solver's information
throw INMOST::SolverUnsupportedOperation;
}
......@@ -30,28 +30,35 @@ namespace INMOST {
throw INMOST::SolverUnsupportedOperation;
}
void SolverInner::Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix) {
// FILE *databaseFile = fopen(parameters_file, "r");
// if (!databaseFile) {
// return;
// }
// char *tmp = (char *) calloc(256, sizeof(char));
// char *parameterName = (char *) calloc(128, sizeof(char));
// char *parameterValue = (char *) calloc(128, sizeof(char));
// while (!feof(databaseFile) && fgets(tmp, 256, databaseFile)) {
// char *line = tmp;
// //Comment str
// if (line[0] == '#') continue;
// sscanf(line, "%s %s", parameterName, parameterValue);
// parameters.require(parameterName, parameterValue);
// }
// free(parameterValue);
// free(parameterName);
// free(tmp);
void SolverInner::Setup(int *argc, char ***argv, SolverParameters &p) {
if (!p.internalFile.empty()) {
FILE *databaseFile = fopen(p.internalFile.c_str(), "r");
if (!databaseFile) {
return;
}
char *tmp = (char *) calloc(256, sizeof(char));
char *parameterName = (char *) calloc(128, sizeof(char));
char *parameterValue = (char *) calloc(128, sizeof(char));
while (!feof(databaseFile) && fgets(tmp, 256, databaseFile)) {
char *line = tmp;
//Comment str
if (line[0] == '#') continue;
sscanf(line, "%s %s", parameterName, parameterValue);
this->SetParameter(parameterName, parameterValue);
}
free(parameterValue);
free(parameterName);
free(tmp);
} else {
for (parameters_iterator_t parameter = p.parameters.begin(); parameter < p.parameters.end(); parameter++) {
this->SetParameter((*parameter).first, (*parameter).second);
}
}
}
bool SolverInner::Solve(Sparse::Vector &RHS, Sparse::Vector &SOL) {
solver->EnumParameter("maxits") = iters;
solver->EnumParameter("maxits") = maximum_iterations;
solver->RealParameter("rtol") = rtol;
solver->RealParameter("atol") = atol;
solver->RealParameter("divtol") = dtol;
......@@ -77,20 +84,20 @@ namespace INMOST {
}
std::string SolverInner::GetParameter(std::string name) const {
if(name == "maximum_iterations" ) return to_string(iters);
else if( name == "rescale_iterations" ) return to_string(scale_iters);
else if( name == "condition_estimation" ) return to_string(condest);
else if( name == "adapt_ddpq_tolerance" ) return to_string(ddpqatol);
else if( name == "schwartz_overlap" ) return to_string(overlap);
else if( name == "gmres_substeps" ) return to_string(ell);
else if( name == "reorder_nonzeros" ) return to_string(reorder_nnz);
else if( name == "absolute_tolerance") return to_string(atol);
else if( name == "relative_tolerance") return to_string(rtol);
else if( name == "divergence_tolerance") return to_string(dtol);
else if( name == "drop_tolerance") return to_string(tau);
else if( name == "reuse_tolerance") return to_string(tau2);
else if( name == "ddpq_tolerance") return to_string(ddpqtol);
else if( name == "fill_level") return to_string(fill);
if (name == "maximum_iterations") return to_string(maximum_iterations);
else if (name == "rescale_iterations") return to_string(rescale_iterations);
else if (name == "condition_estimation") return to_string(condition_estimation);
else if (name == "adapt_ddpq_tolerance") return to_string(adapt_ddpq_tolerance);
else if (name == "schwartz_overlap") return to_string(schwartz_overlap);
else if (name == "gmres_substeps") return to_string(gmres_substeps);
else if (name == "reorder_nonzeros") return to_string(reorder_nnz);
else if (name == "absolute_tolerance") return to_string(atol);
else if (name == "relative_tolerance") return to_string(rtol);
else if (name == "divergence_tolerance") return to_string(dtol);
else if (name == "drop_tolerance") return to_string(drop_tolerance);
else if (name == "reuse_tolerance") return to_string(reuse_tolerance);
else if (name == "ddpq_tolerance") return to_string(ddpq_tolerance);
else if (name == "fill_level") return to_string(fill_level);
else {
std::cout << "Parameter " << name << " is unknown" << std::endl;
return "";
......@@ -99,20 +106,20 @@ namespace INMOST {
void SolverInner::SetParameter(std::string name, std::string value) {
const char *val = value.c_str();
if(name == "maximum_iterations" ) iters = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "rescale_iterations" ) scale_iters = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "condition_estimation" ) condest = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "adapt_ddpq_tolerance" ) ddpqatol = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "schwartz_overlap" ) overlap = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "gmres_substeps" ) ell = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "reorder_nonzeros" ) reorder_nnz = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if( name == "absolute_tolerance") atol = atof(val);
else if( name == "relative_tolerance") rtol = atof(val);
else if( name == "divergence_tolerance") dtol = atof(val);
else if( name == "drop_tolerance") tau = atof(val);
else if( name == "reuse_tolerance") tau2 = atof(val);
else if( name == "ddpq_tolerance") ddpqtol = atof(val);
else if( name == "fill_level") fill = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
if (name == "maximum_iterations") maximum_iterations = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "rescale_iterations") rescale_iterations = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "condition_estimation") condition_estimation = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "adapt_ddpq_tolerance") adapt_ddpq_tolerance = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "schwartz_overlap") schwartz_overlap = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "gmres_substeps") gmres_substeps = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "reorder_nonzeros") reorder_nnz = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else if (name == "absolute_tolerance") atol = atof(val);
else if (name == "relative_tolerance") rtol = atof(val);
else if (name == "divergence_tolerance") dtol = atof(val);
else if (name == "drop_tolerance") drop_tolerance = atof(val);
else if (name == "reuse_tolerance") reuse_tolerance = atof(val);
else if (name == "ddpq_tolerance") ddpq_tolerance = atof(val);
else if (name == "fill_level") fill_level = static_cast<INMOST_DATA_ENUM_TYPE>(atoi(val));
else std::cout << "Parameter " << name << " is unknown" << std::endl;
}
......
......@@ -7,7 +7,6 @@
#include "solver_bcgsl.hpp"
namespace INMOST {
class SolverInner : public SolverInterface {
......@@ -16,8 +15,8 @@ namespace INMOST {
KSOLVER *solver;
Solver::OrderInfo info;
INMOST_DATA_ENUM_TYPE iters, scale_iters, condest, ddpqatol, overlap, ell, reorder_nnz, fill;
INMOST_DATA_REAL_TYPE atol, rtol, dtol, ddpqtol, tau, tau2;
INMOST_DATA_ENUM_TYPE maximum_iterations, rescale_iterations, condition_estimation, adapt_ddpq_tolerance, schwartz_overlap, gmres_substeps, reorder_nnz, fill_level;
INMOST_DATA_REAL_TYPE atol, rtol, dtol, ddpq_tolerance, drop_tolerance, reuse_tolerance;
public:
SolverInner();
......@@ -25,7 +24,7 @@ namespace INMOST {
virtual void Assign(const SolverInterface *other);
virtual void Initialize(int *argc, char ***argv, const char *parameters_file, std::string prefix);
virtual void Setup(int *argc, char ***argv, SolverParameters &p);
virtual void SetMatrix(Sparse::Matrix &A, bool ModifiedPattern, bool OldPreconditioner) = 0;
......
......@@ -18,19 +18,19 @@ namespace INMOST {
delete matrix;
}
matrix = new Sparse::Matrix(A);
info.PrepareMatrix(*matrix, overlap);
info.PrepareMatrix(*matrix, schwartz_overlap);
solver->ReplaceMAT(*matrix);
solver->RealParameter(":tau") = tau;
solver->RealParameter(":tau2") = tau2;
solver->EnumParameter(":scale_iters") = scale_iters;
solver->RealParameter(":ddpq_tau") = ddpqtol;
solver->RealParameter(":tau") = drop_tolerance;
solver->RealParameter(":tau2") = reuse_tolerance;
solver->EnumParameter(":scale_iters") = rescale_iterations;
solver->RealParameter(":ddpq_tau") = ddpq_tolerance;
solver->EnumParameter(":reorder_nnz") = reorder_nnz;
solver->EnumParameter(":estimator") = condest;
solver->EnumParameter(":ddpq_tau_adapt") = ddpqatol;
solver->EnumParameter(":estimator") = condition_estimation;
solver->EnumParameter(":ddpq_tau_adapt") = adapt_ddpq_tolerance;
if (sizeof(KSOLVER) == sizeof(BCGSL_solver)) {
solver->EnumParameter("levels") = ell;
solver->EnumParameter("levels") = gmres_substeps;
}
if (!solver->isInitialized()) {
......
......@@ -18,16 +18,16 @@ namespace INMOST {
delete matrix;
}
matrix = new Sparse::Matrix(A);
info.PrepareMatrix(*matrix, overlap);
info.PrepareMatrix(*matrix, schwartz_overlap);
solver->ReplaceMAT(*matrix);
solver->RealParameter(":tau") = tau;
solver->RealParameter(":tau2") = tau2;
solver->EnumParameter(":scale_iters") = scale_iters;
solver->EnumParameter(":fill") = fill;
solver->RealParameter(":tau") = drop_tolerance;
solver->RealParameter(":tau2") = reuse_tolerance;
solver->EnumParameter(":scale_iters") = rescale_iterations;
solver->EnumParameter(":fill") = fill_level;
if (sizeof(KSOLVER) == sizeof(BCGSL_solver)) {
solver->EnumParameter("levels") = ell;
solver->EnumParameter("levels") = gmres_substeps;
}
if (!solver->isInitialized()) {
......
......@@ -18,15 +18,15 @@ namespace INMOST {
delete matrix;
}
matrix = new Sparse::Matrix(A);