6 #ifndef CoinPresolveMatrix_H
7 #define CoinPresolveMatrix_H
20 #if PRESOLVE_DEBUG > 0
36 #define deleteAction(array,type) delete [] ((type) array)
38 #define deleteAction(array,type) delete [] array
45 #if PRESOLVE_DEBUG > 0 || PRESOLVE_CONSISTENCY > 0
47 #define PRESOLVE_STMT(s) s
49 #define PRESOLVEASSERT(x) \
50 ((x) ? 1 : ((std::cerr << "FAILED ASSERTION at line " \
51 << __LINE__ << ": " #x "\n"), abort(), 0))
53 inline void DIE(
const char *s) { std::cout << s ; abort() ; }
65 #define PRESENT_IN_REDUCED '\377'
69 #define PRESOLVEASSERT(x) {}
70 #define PRESOLVE_STMT(s) {}
72 inline void DIE(
const char *) {}
79 #ifndef PRESOLVE_DETAIL
80 #define PRESOLVE_DETAIL_PRINT(s) {}
82 #define PRESOLVE_DETAIL_PRINT(s) s
97 #define PRESOLVE_INF COIN_DBL_MAX
99 #define PRESOLVE_SMALL_INF 1.0e20
101 #define PRESOLVEFINITE(n) (-PRESOLVE_INF < (n) && (n) < PRESOLVE_INF)
165 {
throw CoinError(error, ps_routine,
"CoinPresolve"); }
181 {
next = nextAction;}
187 virtual const char *
name()
const = 0;
203 class OsiSolverInterface;
337 unsigned char & st_byte =
rowstat_[sequence];
338 st_byte =
static_cast<unsigned char>(st_byte & (~7)) ;
339 st_byte =
static_cast<unsigned char>(st_byte | status) ;
346 {
return (static_cast<Status> (
rowstat_[sequence]&7)==
basic);}
350 unsigned char & st_byte =
colstat_[sequence];
351 st_byte =
static_cast<unsigned char>(st_byte & (~7)) ;
352 st_byte =
static_cast<unsigned char>(st_byte | status) ;
354 # ifdef PRESOLVE_DEBUG
358 { std::cout <<
"Bad status: Var " << sequence
359 <<
" isFree, lb = " <<
clo_[sequence]
360 <<
", ub = " <<
cup_[sequence] << std::endl ; }
366 { std::cout <<
"Bad status: Var " << sequence
367 <<
" atUpperBound, lb = " <<
clo_[sequence]
368 <<
", ub = " <<
cup_[sequence] << std::endl ; }
372 { std::cout <<
"Bad status: Var " << sequence
373 <<
" atLowerBound, lb = " <<
clo_[sequence]
374 <<
", ub = " <<
cup_[sequence] << std::endl ; }
378 { std::cout <<
"Bad status: Var " << sequence
379 <<
" superBasic, lb = " <<
clo_[sequence]
380 <<
", ub = " <<
cup_[sequence] << std::endl ; }
392 {
return (static_cast<Status> (
colstat_[sequence]&7)==
basic);}
440 void setColLower(
const double *colLower,
int lenParam) ;
442 void setColUpper(
const double *colUpper,
int lenParam) ;
446 void setCost(
const double *cost,
int lenParam) ;
450 void setRowLower(
const double *rowLower,
int lenParam) ;
452 void setRowUpper(
const double *rowUpper,
int lenParam) ;
454 void setRowPrice(
const double *rowSol,
int lenParam) ;
463 {
return (ncols_) ; }
466 {
return (nrows_) ; }
469 {
return (nelems_) ; }
512 for (
int i = 0 ; i <
ncols_ ; i++)
if (
hincol_[i] == 0) empty++ ;
743 #define NO_LINK -66666666
752 int ipre = link[i].
pre;
753 int isuc = link[i].
suc;
755 link[ipre].
suc = isuc;
758 link[isuc].
pre = ipre;
770 int isuc = link[j].
suc;
792 int ipre = link[i].
pre;
793 int isuc = link[i].
suc;
862 double nonLinearVariable,
877 OsiSolverInterface * si,
882 double nonLinearVariable,
883 const char * prohibited,
915 for (
int i = 0 ; i <
nrows_ ; i++)
if (
hinrow_[i] == 0) empty++ ;
925 integerType_[i] =
static_cast<unsigned char>(variableType) ; }
932 void setVariableType(
const unsigned char *variableType,
int lenParam) ;
972 {
return (
false) ; } }
1008 # if PRESOLVE_DEBUG > 2
1009 assert(fabs(change_amount)<1.0e50) ;
1451 unsigned char *colstat,
1452 unsigned char *rowstat);
1470 unsigned char *colstat,
1471 unsigned char *rowstat);
1551 int *minndxs,
int *majlens,
1560 int *hrow,
int *hincol,
1563 hrow,hincol,clink,ncols,colx) ; }
1571 int *hcol,
int *hinrow,
1574 hcol,hinrow,rlink,nrows,rowx) ; }
1589 for (k = ks ; k < ke ; k++)
1591 {
if (minndxs[k] == tgt)
1595 abort () ;
return -1;
1597 {
if (minndxs[k] == tgt)
1633 const int *minndxs);
1714 int *majlens,
int *minndxs,
double *els)
1721 minndxs[kmi] = minndxs[ke-1] ;
1722 els[kmi] = els[ke-1] ;
1736 int *majlens,
int *minndxs,
double *els)
1742 int iMinor = minndxs[k] ;
1743 if (!marked[iMinor]) {
1744 minndxs[put] = iMinor ;
1745 els[put++] = els[k] ;
1747 marked[iMinor] = 0 ;
1750 majlens[majndx] = put-ks ;
1766 int *hincol,
int *hrow,
double *colels)
1781 int *hinrow,
int *hcol,
double *rowels)
1796 int *minndxs,
int *majlinks,
1810 int *hincol,
int *hrow,