Commit 412eb5d4 authored by David Bommes's avatar David Bommes
Browse files

fixed 0-size-Matrix Bug

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@35 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 29def235
......@@ -131,6 +131,18 @@ public:
double _reg_factor = 0.0,
bool _show_miso_settings = true,
bool _show_timings = true );
// const version of above function
template<class RMatrixT, class VectorT, class VectorIT >
void solve_const(
RMatrixT& _constraints,
RMatrixT& _B,
VectorT& _x,
VectorIT& _idx_to_round,
double _reg_factor = 0.0,
bool _show_miso_settings = true,
bool _show_timings = true );
/*@}*/
/** @name Eliminate constraints
......
......@@ -44,12 +44,10 @@ namespace COMISO {
//== IMPLEMENTATION ==========================================================
// const version of above function
template<class RMatrixT, class CMatrixT, class VectorT, class VectorIT >
void
ConstrainedSolver::
solve_const(
const RMatrixT& _constraints,
solve_const( const RMatrixT& _constraints,
const CMatrixT& _A,
VectorT& _x,
const VectorT& _rhs,
......@@ -84,6 +82,41 @@ solve_const(
//-----------------------------------------------------------------------------
template<class RMatrixT, class VectorT, class VectorIT >
void
ConstrainedSolver::
solve_const( RMatrixT& _constraints,
RMatrixT& _B,
VectorT& _x,
VectorIT& _idx_to_round,
double _reg_factor,
bool _show_miso_settings,
bool _show_timings )
{
// copy matrices
RMatrixT constraints( gmm::mat_nrows(_constraints), gmm::mat_ncols(_constraints));
gmm::copy(_constraints, constraints);
RMatrixT B( gmm::mat_nrows(_B), gmm::mat_ncols(_B));
gmm::copy(_B, B);
// ... and vectors
VectorIT idx_to_round(_idx_to_round);
// call non-const function
solve(constraints,
B,
_x,
idx_to_round,
_reg_factor,
_show_miso_settings,
_show_timings);
}
//-----------------------------------------------------------------------------
template<class RMatrixT, class VectorT, class VectorIT >
void
ConstrainedSolver::
......
......@@ -69,6 +69,10 @@ MISolver::solve(
Veci& _to_round,
bool _fixed_order )
{
// nothing to solve?
if( gmm::mat_ncols(_A) == 0 || gmm::mat_nrows(_A) == 0)
return;
// some statistics
int n_local = 0;
int n_cg = 0;
......
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