Commit 10142457 authored by Dmitry Bagaev's avatar Dmitry Bagaev Committed by GitHub
Browse files

Merge pull request #27 from bvdmitri/fixfc2

some improvements in *BIILU2 interfaces
parents 5ed0c6b9 1c2af4d6
...@@ -122,7 +122,6 @@ namespace INMOST { ...@@ -122,7 +122,6 @@ namespace INMOST {
} }
MatrixFinalizeFcbiilu2(matrix_data); MatrixFinalizeFcbiilu2(matrix_data);
SolverSetMatrixFcbiilu2(solver_data, matrix_data, modified_pattern, OldPreconditioner); SolverSetMatrixFcbiilu2(solver_data, matrix_data, modified_pattern, OldPreconditioner);
time_prec = solver_data->dstat[7];
} }
bool SolverFCBIILU2::Solve(INMOST::Sparse::Vector &RHS, INMOST::Sparse::Vector &SOL) { bool SolverFCBIILU2::Solve(INMOST::Sparse::Vector &RHS, INMOST::Sparse::Vector &SOL) {
...@@ -144,6 +143,7 @@ namespace INMOST { ...@@ -144,6 +143,7 @@ namespace INMOST {
bool result = SolverSolveFcbiilu2(solver_data, rhs_data, solution_data); bool result = SolverSolveFcbiilu2(solver_data, rhs_data, solution_data);
if (result) VectorLoadFcbiilu2(solution_data, &SOL[vbeg]); if (result) VectorLoadFcbiilu2(solution_data, &SOL[vbeg]);
iter_time = solver_data->dstat[9]; iter_time = solver_data->dstat[9];
time_prec = solver_data->dstat[7];
return result; return result;
} }
...@@ -165,7 +165,9 @@ namespace INMOST { ...@@ -165,7 +165,9 @@ namespace INMOST {
if (name == "time_total") return INMOST::to_string(time_prec + iter_time); if (name == "time_total") return INMOST::to_string(time_prec + iter_time);
if (name == "prec_density") return INMOST::to_string(solver_data->dstat[0]); if (name == "prec_density") return INMOST::to_string(solver_data->dstat[0]);
if (name == "pivot_mod") return INMOST::to_string(solver_data->istat[0]); if (name == "pivot_mod") return INMOST::to_string(solver_data->istat[0]);
#if !defined(SILENCE_SET_PARAMETER)
std::cout << "Parameter " << name << " is unknown" << std::endl; std::cout << "Parameter " << name << " is unknown" << std::endl;
#endif
return ""; return "";
} }
...@@ -176,7 +178,9 @@ namespace INMOST { ...@@ -176,7 +178,9 @@ namespace INMOST {
else if (name == "eps") solver_data->eps = atof(val); else if (name == "eps") solver_data->eps = atof(val);
else if (name == "nit") solver_data->nit = atoi(val); else if (name == "nit") solver_data->nit = atoi(val);
else if (name == "msglev") solver_data->msglev = atoi(val); else if (name == "msglev") solver_data->msglev = atoi(val);
#if !defined(SILENCE_SET_PARAMETER)
else std::cout << "Parameter " << name << " is unknown" << std::endl; else std::cout << "Parameter " << name << " is unknown" << std::endl;
#endif
} }
const INMOST_DATA_ENUM_TYPE SolverFCBIILU2::Iterations() const { const INMOST_DATA_ENUM_TYPE SolverFCBIILU2::Iterations() const {
......
...@@ -126,7 +126,6 @@ namespace INMOST { ...@@ -126,7 +126,6 @@ namespace INMOST {
} }
MatrixFinalizeK3biilu2(matrix_data); MatrixFinalizeK3biilu2(matrix_data);
SolverSetMatrixK3biilu2(solver_data, matrix_data, modified_pattern, OldPreconditioner); SolverSetMatrixK3biilu2(solver_data, matrix_data, modified_pattern, OldPreconditioner);
time_prec = solver_data->dstat[7];
} }
bool SolverK3BIILU2::Solve(INMOST::Sparse::Vector &RHS, INMOST::Sparse::Vector &SOL) { bool SolverK3BIILU2::Solve(INMOST::Sparse::Vector &RHS, INMOST::Sparse::Vector &SOL) {
...@@ -150,6 +149,7 @@ namespace INMOST { ...@@ -150,6 +149,7 @@ namespace INMOST {
bool result = SolverSolveK3biilu2(solver_data, rhs_data, solution_data); bool result = SolverSolveK3biilu2(solver_data, rhs_data, solution_data);
if (result) VectorLoadK3biilu2(solution_data, &SOL[vbeg]); if (result) VectorLoadK3biilu2(solution_data, &SOL[vbeg]);
iter_time = solver_data->dstat[9]; iter_time = solver_data->dstat[9];
time_prec = solver_data->dstat[7];
return result; return result;
} }
...@@ -171,7 +171,9 @@ namespace INMOST { ...@@ -171,7 +171,9 @@ namespace INMOST {
if (name == "time_total") return INMOST::to_string(time_prec + iter_time); if (name == "time_total") return INMOST::to_string(time_prec + iter_time);
if (name == "prec_density") return INMOST::to_string(solver_data->dstat[0]); if (name == "prec_density") return INMOST::to_string(solver_data->dstat[0]);
if (name == "pivot_mod") return INMOST::to_string(solver_data->istat[0]); if (name == "pivot_mod") return INMOST::to_string(solver_data->istat[0]);
#if !defined(SILENCE_SET_PARAMETER)
std::cout << "Parameter " << name << " is unknown" << std::endl; std::cout << "Parameter " << name << " is unknown" << std::endl;
#endif
return ""; return "";
} }
...@@ -184,7 +186,9 @@ namespace INMOST { ...@@ -184,7 +186,9 @@ namespace INMOST {
solver_data->pParams->tau2 = -1.0; solver_data->pParams->tau2 = -1.0;
} else if (name == "nit") solver_data->pParIter->maxit = atoi(val); } else if (name == "nit") solver_data->pParIter->maxit = atoi(val);
else if (name == "eps") solver_data->pParIter->eps = atof(val); else if (name == "eps") solver_data->pParIter->eps = atof(val);
#if !defined(SILENCE_SET_PARAMETER)
else std::cout << "Parameter " << name << " is unknown" << std::endl; else std::cout << "Parameter " << name << " is unknown" << std::endl;
#endif
} }
const INMOST_DATA_ENUM_TYPE SolverK3BIILU2::Iterations() const { const INMOST_DATA_ENUM_TYPE SolverK3BIILU2::Iterations() const {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment