PIPS
isolve.c File Reference
#include "arithmetique.h"
#include <stdio.h>
#include "assert.h"
#include "iproblem.h"
#include "iabrev.h"
#include "rproblem.h"
+ Include dependency graph for isolve.c:

Go to the source code of this file.

Functions

static int xbug (Pproblem XX, int nu)
 ========================================================================= More...
 
static int xdeb (Pproblem XX, int nu)
 
static void vzphase (Pproblem XX, int n)
 
static void vzstep (Pproblem XX, int n)
 
static void vznowstep (Pproblem XX)
 
static void vznewstep (Pproblem XX, int n)
 
void tableau_janus (Pinitpb II, Pproblem XX)
 
static void symbol (Pproblem XX, int v)
 N note: if use janus.c then not static DN. More...
 
static void symbold (Pproblem XX, int v)
 
static void vzcut (Pproblem XX, int i, int divisor, int i2)
 static void symboldn(Pproblem XX,int v) /***************************\/ More...
 
static void igvoir3 (Pproblem XX, int ia, int ib, int carre, int ip, int jp, int carre2, int ip2, int jp2, int fleche, int ifl)
 
static void igvoir (Pproblem XX, int ia, int ib)
 fin igvoir3 More...
 
static void w1voir (Pproblem XX, int ix)
 fin igvoir More...
 
static void wvoir (Pproblem XX)
 tatic void wvoir(Pproblem XX) More...
 
static void vzemptycol (Pproblem XX, int j)
 static void stepvoir(Pproblem XX) /**** acces pour mise au point janus *\/ More...
 
static void vzredundant (Pproblem XX, int i, int i2)
 
static void vzgcd (Pproblem XX, int i, int gcd, int viz)
 
static void vzextgcd (Pproblem XX, int a1, int a2, int u1, int u2, int u3, int zvx)
 
static void term (Pproblem XX, int s, Value k, int x)
 
static void ucformula (Pproblem XX, Value u1, Value u2, int v, int new1, int new2)
 
static void vzunimod (Pproblem XX, Value u1, Value u2, int u3, int za, int zb, int old1, int old2, int new1, int new2)
 
static int integrite (float vf)
 ======================================================================= More...
 
static Value dessus (float vf)
 
static Value dessous (float vf)
 
static void integerrealline (Pproblem XX, struct rproblem *RR, int ii, int ir)
 fprintf(FTRACE,"variable flottante=%14.7f dessus=%d dessous=%d\\\\\n", vf,dessus(vf),dessous(vf)); if (vf>0) testdessusdessous(XX,-vf); } void testsdessusdessous(Pproblem XX) { testdessusdessous(XX,0); testdessusdessous(XX,7.6543); testdessusdessous(XX,4.000002); testdessusdessous(XX,4.000001); testdessusdessous(XX,1.999995); testdessusdessous(XX,1.999999); } in case of test - end More...
 
static void integertoreal (Pproblem XX, struct rproblem *RR, int mini)
 
static void messrsimplex (Pproblem XX, struct rproblem *RR, int r, int ph)
 
static float localnewrsimplex (Pproblem XX, struct rproblem *RR, int min)
 
static float localrsimplex (Pproblem XX, int min)
 
static void copybound (Pproblem XX, Pproblem YY)
 
static void vid (Pproblem XX)
 
static void vidr (struct rproblem *RR)
 
static int copystructure (Pproblem XX, Pproblem YY)
 tatic int copystructure(Pproblem XX,Pproblem YY) More...
 
static int janus_egalite (Pproblem XX, int i)
 ========================================================================= More...
 
static int freevariable (Pproblem XX, int v)
 static int costvariable(Pproblem XX) /**************************\/ More...
 
static int cutvariable (Pproblem XX, int v)
 
static int fluidvariable (Pproblem XX, int v)
 
static int cutline (Pproblem XX, int i)
 
static int fluidline (Pproblem XX, int i)
 
static int freecolumn (Pproblem XX, int j)
 static int cutcolumn(Pproblem XX,int j) /*****************************\/ More...
 
static int emptylhs (Pproblem XX, int i)
 
static int useless (Pproblem XX, int i)
 
static int presence (Pproblem XX, int iv)
 
static int newfreevariable (Pproblem XX)
 
static Value dn_multiply (Value v1, Value v2)
 ======================================================================== More...
 
static Value correctm (Pproblem XX, Value k1, Value k2)
 
static int corrects (Pproblem XX, Value k1, Value k2)
 
static int ipivotage2 (Pproblem XX, int i1, int j1, int ipiv1, int ipiv2, int vtu)
 ======================================================================== More...
 
static int ipivotage (Pproblem XX, int i1, int j1)
 
static int redundant (Pproblem XX, int i1, int i2)
 
static int satisfait (Pproblem XX)
 
static int makecolumnfree (Pproblem XX, int jx)
 ========================================================================= More...
 
static void celimination (Pproblem XX, int j1)
 ========================================================================= More...
 
static void emptycolelim (Pproblem XX, int j1)
 
static void permutec (Pproblem XX, int j1, int j2)
 
static void permutel (Pproblem XX, int i1, int i2)
 
static void oppositeline (Pproblem XX, int io)
 
static void retirer (Pproblem XX, int i1)
 
static void retirerineq (Pproblem XX, int i1)
 static void badretirerineq(Pproblem XX,int i1) /***********************\/ More...
 
static void razcut (Pproblem XX)
 
static int possible (Pproblem XX, int j)
 ======================================================================= More...
 
static void fourier0 (Pproblem XX, int j)
 
static void ajouter (Pproblem XX, Value sk, int ip1, int i)
 fin fourier0 More...
 
static void fourier1 (Pproblem XX, int pn, int j, int ip1)
 integer fourier elimination criterion and: More...
 
static void fourier22 (Pproblem XX, int j)
 fin fourier1 More...
 
static Value pgcd2 (Value z1, Value z2)
 fin fourier22 More...
 
static Value extgcd (Pproblem XX, Value a1, Value a2, Value *pu1, Value *pu2, Value *pu3, int zvx)
 tatic int extgcd(Pproblem XX,int a1,int a2,int *pu1,int *pu2,int *pu3, int zvx) { int v1,v2,v3,t1,t2,t3,q; if (a1==0 || a2==0) return(1); pu1=1 ; *pu2=0 ; *pu3=abs(a1) ; v1=0 ; v2=1 ; v3=abs(a2) ; while (v3!=0) { q=*pu3/v3 ; t1= *pu1 -v1*q ; t2= *pu2-v2*q ; t3=*pu3-v3*q ; pu1=v1 ; *pu2=v2 ; *pu3=v3 ; v1=t1 ; v2=t2 ; v3=t3 ; } if (a1<0) *pu1= - *pu1 ; if (a2<0) *pu2= - *pu2 ; if(VISU>=zvx) vzextgcd(XX, a1, a2, *pu1, *pu2, *pu3,zvx); return(0); }DN More...
 
static int jnsegment (Pproblem XX, int ik, int j1, int j2)
 
static int jsegment (Pproblem XX, int ik, int j1, int j2, Value p)
 
static Value pgcdsegment (Pproblem XX, int ik, int j1, int j2)
 
static int changing2 (Pproblem XX, int i1, int ja, int jb)
 
static int build0 (Pproblem XX, int i1, int jj, int *pj1)
 
static int build1 (Pproblem XX, int i1, int jj)
 
static Value cfloor (Value v1, Value v2)
 ======================================================================= More...
 
static int newcut (Pproblem XX)
 
static void coupe (Pproblem XX, int i1, int i2, Value abpivot)
 
static int cutiteration (Pproblem XX, int i1, int j1, int turb)
 
static Value pgcd2in (Value z1, Value z2)
 ======================================================================= More...
 
static Value pgcdseg (Pproblem XX, int ik, int j1, int j2)
 
static Value inequaldivision (Pproblem XX, int i)
 
static int gcdtest (Pproblem XX, int i, int *pj1, Value *ppivot, int viz)
 ======================================================================= More...
 
static int dualentier (Pproblem XX)
 ======================================================================= More...
 
static void razfreq (Pproblem XX)
 fin dualentier More...
 
static int iprimal (Pproblem XX, int minimum, int i2, int stopcout)
 static void voirfreq(Pproblem XX) /*****\/ More...
 
static void anonymouscopyline (Pproblem XX, int is, int id)
 fin iprimal ================================================ More...
 
static void copyline (Pproblem XX, int is, int id)
 
static void inhibit (Pproblem XX, int in)
 ========================= PROCEDURES FOR FAST =========================== More...
 
static void remettre (Pproblem XX, int in)
 
static int remise (Pproblem XX, int icf)
 
static int fast (Pproblem XX, Pproblem ZZ)
 
static void anonymctol (Pproblem XX, int js, int id)
 ========================== fin fast =================================== More...
 
static void columntoline (Pproblem XX, int js, int id)
 
static void boundline (Pproblem XX, int io, Value bou)
 
static int addnonbasicbound (Pproblem XX, int jnb, Value nbb, int nonfixe)
 
static void addedbound (Pproblem XX, int iv, Value borne)
 
static int modifyconstr (Pproblem XX, int jfixe, int ifixe, Value k, int ineq)
 
static int findandmod (Pproblem XX, int v, Value k, int ineq)
 
static int hb (struct rproblem *RR, int iv)
 ================================================================== More...
 
static void copyrline (struct rproblem *RR, int is, int id)
 
static void rinverse (struct rproblem *RR, int ir)
 
static int recherche (struct rproblem *RR, int varia)
 
static void razcoutr (struct rproblem *RR, int mini)
 
static int preparephase2 (Pproblem XX, struct rproblem *RR, int rvar, int mini, int kost)
 
static int phase1 (Pproblem XX, struct rproblem *RR)
 
static int phase2 (Pproblem XX, struct rproblem *RR, int rvar, int mini)
 
static int dealtvariable (Pproblem XX, int v)
 
static int inevariable (Pproblem XX, int v)
 
static int majlowbounds (Pproblem XX, struct rproblem *RR, int ope)
 static void etatfonctions(Pproblem XX) More...
 
static int upperbound (Pproblem XX, struct rproblem *RR, int iv, int rvar, float epss)
 static int cutbounds(Pproblem XX,struct rproblem *RR,int iv, int rvar,float epss) More...
 
static int lowbound (Pproblem XX, struct rproblem *RR, int iv, int rvar, int *first, float epss)
 
static Value boundssum (Pproblem XX)
 
static int computebounds (Pproblem XX, struct rproblem *RR, int up)
 
static void voirbornes (Pproblem XX)
 
static void listehb (Pproblem XX, struct rproblem *RR)
 
static int choose (Pproblem XX, struct rproblem *RR)
 
static int ajout (Pproblem XX)
 
static int majuu (Pproblem XX, Pproblem UU, struct rproblem *RR)
 
static int majb (Pproblem XX, Pproblem UU, struct rproblem *RR)
 
static int failuresp (Pproblem XX, struct rproblem *RR, int *compb)
 
static int reducedpb (Pproblem XX, Pproblem VV, struct rproblem *RR)
 
static int splitpb (Pproblem XX, Pproblem VV, struct rproblem *RR, int jfixe, int ifixe, Value k, int ineq)
 
static int recup (Pproblem XX, Pproblem VV)
 MMM4. More...
 
static int reduction (Pproblem XX, struct rproblem *RR)
 
static int eclater (Pproblem XX, Pproblem UU, Pproblem VV, struct rproblem *RR)
 
static int failure (Pproblem XX, Pproblem UU, Pproblem VV, struct rproblem *RR)
 
static int fastplus (Pproblem XX, Pproblem VV, struct rproblem *RR)
 
static int pseudocopie (Pproblem XX, Pproblem YY, int condition)
 
static int iprimalplus (Pproblem XX, struct rproblem *RR, int minimum, int i2, int stopcout)
 
int dynam (Pproblem XX, int nd)
 ======================================================================= More...
 
static int vzlast (Pproblem XX)
 ======================================================================= More...
 
static int is2 (Pproblem XX, Pproblem VV, struct rproblem *RR)
 ======================================================================= More...
 
static int init_janus (Pinitpb II, Pproblem XX, int suit1)
 
int isolve (Pinitpb II, Pproblem XX, int suite)
 

Function Documentation

◆ addedbound()

static void addedbound ( Pproblem  XX,
int  iv,
Value  borne 
)
static

Definition at line 1531 of file isolve.c.

1532 { int iy;
1533  for (iy=NX ; iy>=1 ; iy--) if (B(iy)==iv) addnonbasicbound(XX,iy,borne,1);
1534  for (iy=IC1 ; iy<=MX-NEGAL ; iy++) if (G(iy)==iv)
1535  { newcut(XX); anonymouscopyline(XX,iy,MX); boundline(XX,MX,borne);
1536  }
1537 }
#define IC1
Definition: iabrev.h:149
#define MX
Definition: iabrev.h:140
#define B(A)
Definition: iabrev.h:61
#define NX
Definition: iabrev.h:141
#define NEGAL
Definition: iabrev.h:138
static int newcut(Pproblem XX)
Definition: isolve.c:1102
static void boundline(Pproblem XX, int io, Value bou)
Definition: isolve.c:1518
static void anonymouscopyline(Pproblem XX, int is, int id)
fin iprimal ================================================
Definition: isolve.c:1432
static int addnonbasicbound(Pproblem XX, int jnb, Value nbb, int nonfixe)
Definition: isolve.c:1522
#define G(j, a, b)
maybe most of them should be functions?

References addnonbasicbound(), anonymouscopyline(), B, boundline(), G, IC1, MX, NEGAL, newcut(), and NX.

Referenced by ajout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addnonbasicbound()

static int addnonbasicbound ( Pproblem  XX,
int  jnb,
Value  nbb,
int  nonfixe 
)
static

f (nonfixe)

Definition at line 1522 of file isolve.c.

1523 { int r;
1524  if (value_zero_p(nbb)) /*if (nonfixe)*/
1525  { celimination (XX,jnb); return(0);
1526  }
1527  if ((r=newcut(XX))) return(r); anonymctol(XX,jnb,MX);boundline(XX,MX,nbb);
1528  if (!nonfixe) ++NEGAL; return(0);
1529 }
#define value_zero_p(val)
static void celimination(Pproblem XX, int j1)
=========================================================================
Definition: isolve.c:763
static void anonymctol(Pproblem XX, int js, int id)
========================== fin fast ===================================
Definition: isolve.c:1507

References anonymctol(), boundline(), celimination(), MX, NEGAL, newcut(), and value_zero_p.

Referenced by addedbound(), and modifyconstr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ajout()

static int ajout ( Pproblem  XX)
static

Definition at line 1819 of file isolve.c.

1820 {
1821  int iv,i; Value bi;
1822  if (REDON)
1823  for (i=MX;i>=IC1;i--) if (inevariable(XX,iv=G(i)))
1824  if (XX->ilbound[iv]) {
1825  if(VW4) fprintf(FTRACE,"retrait inequa %d\\\\\n",iv);
1826  retirerineq(XX,i);
1827  }
1828  if (PMET2<7) return(0); razcut(XX);
1829  for (iv=1 ; iv<=NUMAX ; iv++) { if (dealtvariable(XX,iv)) {
1830  if (value_pos_p(value_assign(bi,int_to_value(XX->ibound[iv])))) addedbound(XX,iv,bi);
1831  else {
1832  if (value_neg_p(bi)) XBUG(72);
1833  else {if(VW6) symbold(XX,iv);}
1834  }}
1835  }
1836  if(VW7) wvoir(XX); return(0);
1837 }
#define value_pos_p(val)
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define value_assign(ref, val)
assigments
int Value
#define value_neg_p(val)
#define PMET2
Definition: iabrev.h:24
#define VW7
Definition: iabrev.h:48
#define FTRACE
=========================================================================
Definition: iabrev.h:15
#define VW6
Definition: iabrev.h:47
#define XBUG(A)
Definition: iabrev.h:153
#define VW4
Definition: iabrev.h:45
#define NUMAX
Definition: iabrev.h:146
#define REDON
Definition: iabrev.h:30
static void wvoir(Pproblem XX)
tatic void wvoir(Pproblem XX)
Definition: isolve.c:249
static void addedbound(Pproblem XX, int iv, Value borne)
Definition: isolve.c:1531
static void symbold(Pproblem XX, int v)
Definition: isolve.c:120
static int inevariable(Pproblem XX, int v)
Definition: isolve.c:1629
static void retirerineq(Pproblem XX, int i1)
static void badretirerineq(Pproblem XX,int i1) /***********************\/
Definition: isolve.c:817
static int dealtvariable(Pproblem XX, int v)
Definition: isolve.c:1626
static void razcut(Pproblem XX)
Definition: isolve.c:820
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Value ilbound[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:90
Value ibound[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:89

References addedbound(), dealtvariable(), fprintf(), FTRACE, G, problem::ibound, IC1, problem::ilbound, inevariable(), int_to_value, MX, NUMAX, PMET2, razcut(), REDON, retirerineq(), symbold(), value_assign, value_neg_p, value_pos_p, VW4, VW6, VW7, wvoir(), and XBUG.

Referenced by eclater(), and reduction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ajouter()

static void ajouter ( Pproblem  XX,
Value  sk,
int  ip1,
int  i 
)
static

fin fourier0

0

if (jk !=j) si j transmis

0

Definition at line 849 of file isolve.c.

850 { int jk;
851  Value vt,dn_tmp;
852  if (value_one_p(sk))
853  { for (jk=NX ; jk>=1 ; jk--) /*j0*/
854  if ( value_assign(vt,AK(ip1,jk))) value_addto(AK(i,jk),vt);
855  value_addto(DK(i),DK(ip1));
856  }
857  else
858  { for (jk=NX ; jk>=1 ; jk--) /* if (jk !=j) si j transmis */ /*j0*/
859  if ( value_assign(vt,AK(ip1,jk))) {
860  if (value_notzero_p(sk)) value_assign(dn_tmp,dn_multiply(vt,sk));
861  else value_assign(dn_tmp,VALUE_ZERO);
862  value_addto(AK(i,jk), dn_tmp);
863  }
864  if (value_notzero_p(sk)&&value_notzero_p(DK(ip1))) value_assign(dn_tmp,dn_multiply(DK(ip1),sk));
865  else value_assign(dn_tmp,VALUE_ZERO);
866  value_addto(DK(i),dn_tmp);
867  //DK(i)+= DK(ip1) *sk ;
868  }
869 }
#define VALUE_ZERO
#define value_notzero_p(val)
#define value_one_p(val)
#define value_addto(ref, val)
#define AK(A, B)
...............
Definition: iabrev.h:59
#define DK(A)
Definition: iabrev.h:60
static Value dn_multiply(Value v1, Value v2)
========================================================================
Definition: isolve.c:563

References AK, DK, dn_multiply(), NX, value_addto, value_assign, value_notzero_p, value_one_p, and VALUE_ZERO.

Referenced by fourier1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ anonymctol()

static void anonymctol ( Pproblem  XX,
int  js,
int  id 
)
static

========================== fin fast ===================================

0

Definition at line 1507 of file isolve.c.

1508 { int j ;
1509  for (j=1 ; j<=NX ; j++) value_assign(AK(id,j),VALUE_ZERO) ; /*j0*/
1511 }
#define VALUE_MONE

References AK, DK, NX, value_assign, VALUE_MONE, and VALUE_ZERO.

Referenced by addnonbasicbound(), and columntoline().

+ Here is the caller graph for this function:

◆ anonymouscopyline()

static void anonymouscopyline ( Pproblem  XX,
int  is,
int  id 
)
static

fin iprimal ================================================

line is (source) is copied on line id

0

Definition at line 1432 of file isolve.c.

1433 { int j ; if (is==id) return; /* line is (source) is copied on line id */
1434  value_assign(DK(id), DK(is)) ;
1435  for (j=1 ; j<=NX ; j++) value_assign(AK(id,j), AK(is,j)); /*j0*/
1436 }

References AK, DK, NX, and value_assign.

Referenced by addedbound(), and copyline().

+ Here is the caller graph for this function:

◆ boundline()

static void boundline ( Pproblem  XX,
int  io,
Value  bou 
)
static

Definition at line 1518 of file isolve.c.

1519 { oppositeline(XX,io); value_addto(DK(io),bou); if (io>MX-NEGAL) permutel(XX,io,MX-NEGAL);
1520 }
static void permutel(Pproblem XX, int i1, int i2)
Definition: isolve.c:790
static void oppositeline(Pproblem XX, int io)
Definition: isolve.c:801

References DK, MX, NEGAL, oppositeline(), permutel(), and value_addto.

Referenced by addedbound(), and addnonbasicbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ boundssum()

static Value boundssum ( Pproblem  XX)
static

Definition at line 1736 of file isolve.c.

1737 {
1738  int i,j,v;
1739  Value s = VALUE_ZERO;
1740  for (i=IC1 ; i<=MX ; i++) if (dealtvariable(XX,v=G(i)))
1741  { value_addto(s,XX->ibound[v]); value_substract(s,XX->ilbound[v]); }
1742  for (j=1 ; j<=NX ; j++) if (dealtvariable(XX,v=B(j)))
1743  { value_addto(s,XX->ibound[v]); value_substract(s,XX->ilbound[v]); }
1744  return(s);
1745 }
#define value_substract(ref, val)

References B, dealtvariable(), G, problem::ibound, IC1, problem::ilbound, MX, NX, value_addto, value_substract, and VALUE_ZERO.

Referenced by computebounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build0()

static int build0 ( Pproblem  XX,
int  i1,
int  jj,
int pj1 
)
static

A unitary coefficient is built on equation i1

jj,NX

n1+1,NX

Definition at line 1050 of file isolve.c.

1051 { int jn1=0,jn2=0 ; /* A unitary coefficient is built on equation i1 */
1052  if (VISU>=ZVEV+1) fprintf(FTRACE,
1053  "Equation $e_{%d}$ does not include a unitary coefficient.\\\\\n",G(i1));
1054  if ((jn1=jnsegment(XX,i1,NX,jj))<0) XBUG(5); /* jj,NX */
1055  while (value_notone_p(AK(i1,jn1))) {
1056  jn2 = jnsegment(XX,i1,jn1-1,jj);
1057  if (jn2<0) XBUG(6); /*jn1+1,NX*/
1058  if (makecolumnfree(XX,jn1)) XDEB(1);
1059  if (makecolumnfree(XX,jn2)) XDEB(2);
1060  if ((VRESULT=changing2(XX,i1,jn1,jn2))) return(VRESULT);
1061  }
1062  if (VISU>=ZVEV+1) fprintf(FTRACE,"Now, a unitary coefficient is available for a gaussian elimination:\n");
1063  *pj1=jn1; return(0);
1064 }
#define value_notone_p(val)
#define VRESULT
................
Definition: iabrev.h:17
#define ZVEV
define ZVU2 4
Definition: iabrev.h:84
#define XDEB(A)
Definition: iabrev.h:154
#define VISU
Definition: iabrev.h:32
static int makecolumnfree(Pproblem XX, int jx)
=========================================================================
Definition: isolve.c:743
static int changing2(Pproblem XX, int i1, int ja, int jb)
Definition: isolve.c:1022
static int jnsegment(Pproblem XX, int ik, int j1, int j2)
Definition: isolve.c:999

References AK, changing2(), fprintf(), FTRACE, G, jnsegment(), makecolumnfree(), NX, value_notone_p, VISU, VRESULT, XBUG, XDEB, and ZVEV.

Referenced by dualentier(), and is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build1()

static int build1 ( Pproblem  XX,
int  i1,
int  jj 
)
static

nitary or single coefficient built on inequality i1

o non-zero coefficient

recherche coefficient=delta

n sait que valeur absolue d'un coefficient=pgcd

t98 2eme exemple RR1828 7.3.2

Definition at line 1065 of file isolve.c.

1066 { int vj=0,jn1=0,jn2=0;/*unitary or single coefficient built on inequality i1*/
1067  Value delta= VALUE_ZERO;
1068  jn1=jnsegment(XX,i1,jj,NX);if (jn1<0) return(jn1);/*no non-zero coefficient*/
1069  permutec(XX,jj,jn1);
1070  value_assign(delta,pgcdsegment(XX,i1,jj,NX));
1071  if (VISU>=ZVNG) {fprintf(FTRACE,"Delta%3d=",i1);fprint_Value(FTRACE,delta);fprintf(FTRACE,"\\\\\n");}
1072  vj = jsegment(XX,i1,jj,NX,delta); /* recherche coefficient=delta */
1073  if (vj>=0) /*on sait que valeur absolue d'un coefficient=pgcd*/
1074  permutec(XX,jj,vj);
1075  else /* t98 2eme exemple RR1828 7.3.2 */
1076  while (value_ne(value_abs(AK(i1,jj)),delta))
1077  { jn2=jnsegment(XX,i1,jj+1,NX);
1078  if ((VRESULT=changing2(XX,i1,jj,jn2))) return(VRESULT);
1079  }
1080  return(0);
1081 }
#define value_ne(v1, v2)
#define value_abs(val)
void fprint_Value(FILE *, Value)
Definition: io.c:42
#define ZVNG
Definition: iabrev.h:104
static int jsegment(Pproblem XX, int ik, int j1, int j2, Value p)
Definition: isolve.c:1008
static void permutec(Pproblem XX, int j1, int j2)
Definition: isolve.c:780
static Value pgcdsegment(Pproblem XX, int ik, int j1, int j2)
Definition: isolve.c:1014

References AK, changing2(), fprint_Value(), fprintf(), FTRACE, jnsegment(), jsegment(), NX, permutec(), pgcdsegment(), value_abs, value_assign, value_ne, VALUE_ZERO, VISU, VRESULT, and ZVNG.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ celimination()

static void celimination ( Pproblem  XX,
int  j1 
)
static

=========================================================================

PROCEDURES FOR HANDLING MATRIX
=========================================================================

column j1 is eliminated (and replaced by column NX)

0

Definition at line 763 of file isolve.c.

764 { if (j1 != NX) /* column j1 is eliminated (and replaced by column NX) */
765  { int i;
766  B(j1)=B(NX) ;
767  for (i=1 ; i<=MX ; i++) value_assign(AK(i,j1),AK(i,NX)) ; /*i0*/
768  } ;
769  --NX ;
770 }

References AK, B, MX, NX, and value_assign.

Referenced by addnonbasicbound(), and is2().

+ Here is the caller graph for this function:

◆ cfloor()

static Value cfloor ( Value  v1,
Value  v2 
)
static

=======================================================================

PROCEDURES FOR CUT OPERATIONS
=======================================================================

printf(stderr,"cfloor VALUE_ZERO)");

printf(stderr,"cfloor_neg ");fprint_Value(stderr,v);fprintf(stderr,")");

Definition at line 1088 of file isolve.c.

1089 { Value v;
1090 //fprintf(stderr,"(v1=");fprint_Value(stderr,v1);fprintf(stderr," ");//DNDB
1091 //fprintf(stderr,"v2=");fprint_Value(stderr,v2);fprintf(stderr," ");//DNDB
1092  if (value_zero_p(v1)) {/*fprintf(stderr,"cfloor VALUE_ZERO)");*/return(VALUE_ZERO); }//DNDB
1093  if (value_pos_p(v1)) {/*
1094 fprintf(stderr,"cfloor_pos ");fprint_Value(stderr,value_div(v1,v2));fprintf(stderr,")");*///DNDB
1095 return(value_div(v1,v2));}
1097  value_decrement(v);
1098  /*fprintf(stderr,"cfloor_neg ");fprint_Value(stderr,v);fprintf(stderr,")");*///DNDB
1099  return(v);
1100 }
#define value_decrement(ref)
#define value_plus(v1, v2)
binary operators on values
#define VALUE_ONE
#define value_div(v1, v2)

References value_assign, value_decrement, value_div, VALUE_ONE, value_plus, value_pos_p, VALUE_ZERO, and value_zero_p.

Referenced by coupe(), and inequaldivision().

+ Here is the caller graph for this function:

◆ changing2()

static int changing2 ( Pproblem  XX,
int  i1,
int  ja,
int  jb 
)
static

3!=1 t97

si pas d'incident

Definition at line 1022 of file isolve.c.

1023 {
1024  int iz,old1,old2,new1,new2;
1025  Value za,zb, u1,u2,u3;
1026  value_assign(za,AK(i1,ja)) ; value_assign(zb,AK(i1,jb));
1027  if (ja==jb) XBUG(7);
1028  old1=B(ja); old2=B(jb); new1=newfreevariable(XX); new2=newfreevariable(XX);
1029 
1030  if (VISU>=ZVU1+2) igvoir3(XX,1,MX,1,i1,ja,1,i1,jb,1,i1);
1031  else if (VISU>=ZVU1+1) igvoir3(XX,i1,i1,1,i1,ja,1,i1,jb,1,i1);
1032 
1033  if (extgcd(XX,za,zb,&u1,&u2,&u3,ZVU1+3)) XBUG(10); /*u3!=1 t97*/
1034 // fprintf(stderr,"\n(in changing2: ");//DNDB
1035  for (iz=MX ; iz>=1 ; iz--) {
1036  Value aka,akb; value_assign(aka,AK(iz,ja)); value_assign(akb,AK(iz,jb));
1037  // AK(iz,ja)= u1*aka + u2*akb ;
1038  //AK(iz,jb)= (za*akb - zb*aka)/u3 ;
1039 
1040  value_assign(AK(iz,ja),value_plus(dn_multiply(u1,aka),dn_multiply(u2,akb))) ;
1041  value_assign(AK(iz,jb),value_div(value_minus(dn_multiply(za,akb),dn_multiply(zb,aka)),u3)) ;
1042  // fprint_Value(stderr,AK(iz,ja));fprintf(stderr,"AKizja");//DNDB
1043  // fprint_Value(stderr,AK(iz,jb));fprintf(stderr,"AKizjb");//DNDB
1044  }
1045 //fprintf(stderr,"in changing2)\n");//DNDB
1046  B(ja)=new1; B(jb)=new2;
1047  if (VISU) vzunimod(XX,u1,u2,u3,za,zb, old1,old2,new1,new2);
1048  return(0); /* si pas d'incident */
1049 }
#define value_minus(v1, v2)
#define ZVU1
Extended Euclid Algorithm
Definition: iabrev.h:78
static void vzunimod(Pproblem XX, Value u1, Value u2, int u3, int za, int zb, int old1, int old2, int new1, int new2)
Definition: isolve.c:330
static void igvoir3(Pproblem XX, int ia, int ib, int carre, int ip, int jp, int carre2, int ip2, int jp2, int fleche, int ifl)
Definition: isolve.c:178
static Value extgcd(Pproblem XX, Value a1, Value a2, Value *pu1, Value *pu2, Value *pu3, int zvx)
tatic int extgcd(Pproblem XX,int a1,int a2,int *pu1,int *pu2,int *pu3, int zvx) { int v1,...
Definition: isolve.c:982
static int newfreevariable(Pproblem XX)
Definition: isolve.c:539

References AK, B, dn_multiply(), extgcd(), igvoir3(), MX, newfreevariable(), value_assign, value_div, value_minus, value_plus, VISU, vzunimod(), XBUG, and ZVU1.

Referenced by build0(), and build1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ choose()

static int choose ( Pproblem  XX,
struct rproblem RR 
)
static

f (VIS2&&XX->bestup>=2)

Definition at line 1802 of file isolve.c.

1803 {
1804  int i,j,iv,prem; Value bes=VALUE_ZERO;
1805  if (XX->state<0) XBUG(61);if (XX->state==0) XBUG(62);
1806  prem=1;XX->tilt=0;
1807  for (i=IC1 ; i<=MX ; i++) if (dealtvariable(XX,iv=G(i)))
1808  if (prem||(value_lt(XX->ibound[iv],bes))) {
1809  value_assign(bes,XX->ibound[iv]); XX->vbest=iv; prem=0;}//bes initialized by prem = true :-(
1810  for (j=1; j<=NX; j++) if (dealtvariable(XX,iv=B(j)))
1811  if (prem||(value_lt(XX->ibound[iv],bes))||((MSR>=8)&&(RR->state>=0)&&(value_eq(XX->ibound[iv],bes))&&(hb(RR,iv))))
1812  {value_assign(bes,XX->ibound[iv]);XX->vbest=iv;prem=0;}
1813  value_assign(XX->bestlow,XX->ilbound[XX->vbest]); value_assign(XX->bestup,XX->ibound[XX->vbest]);
1814  if (prem) XBUG(63);
1815  if (VW4&&(value_gt(XX->bestup,int_to_value(PCOMP)))) /*if (VIS2&&XX->bestup>=2)*/ { //DN. int_to_value
1816  symbold(XX,XX->vbest);fprintf(FTRACE,"DILATATION = ");fprint_Value(FTRACE,XX->bestup); voirbornes(XX);}
1817  return(0);
1818 }
#define value_gt(v1, v2)
#define value_eq(v1, v2)
bool operators on values
#define value_lt(v1, v2)
#define RR
Definition: genspec.h:95
#define PCOMP
Definition: iabrev.h:29
#define MSR
Definition: iabrev.h:27
static int hb(struct rproblem *RR, int iv)
==================================================================
Definition: isolve.c:1567
static void voirbornes(Pproblem XX)
Definition: isolve.c:1776
int state
Definition: iproblem.h:98
Value bestup
Definition: iproblem.h:99
int vbest
Definition: iproblem.h:98
int tilt
Definition: iproblem.h:98
Value bestlow
Definition: iproblem.h:99

References B, problem::bestlow, problem::bestup, dealtvariable(), fprint_Value(), fprintf(), FTRACE, G, hb(), problem::ibound, IC1, problem::ilbound, int_to_value, MSR, MX, NX, PCOMP, RR, problem::state, symbold(), problem::tilt, value_assign, value_eq, value_gt, value_lt, VALUE_ZERO, problem::vbest, voirbornes(), VW4, and XBUG.

Referenced by eclater(), and failuresp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ columntoline()

static void columntoline ( Pproblem  XX,
int  js,
int  id 
)
static

Definition at line 1512 of file isolve.c.

1513 { anonymctol(XX,js,id) ; G(id)=B(js) ;
1514 }

References anonymctol(), B, and G.

Referenced by modifyconstr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computebounds()

static int computebounds ( Pproblem  XX,
struct rproblem RR,
int  up 
)
static

pss=0.000001;

s

Definition at line 1746 of file isolve.c.

1747 {
1748  int i0,i,j,r,first; float epss; Value s1=VALUE_ZERO,s2=VALUE_ZERO;
1749  epss=0.0001; /*epss=0.000001;*/
1750  if ((r=phase1(XX,RR))) { if(r==VRVID&&VW4) fprintf(FTRACE,"immediate "); return(r); }
1751  if (VW2) value_assign(s1,boundssum(XX));
1752  value_assign(XX->decrement,VALUE_ZERO);XX->tilt=0;first=1;i0=RR->nvar+1-IC1; majlowbounds(XX,RR,0);
1753  if (up) {
1754  for (i=IC1 ; i<=MX ; i++) if (dealtvariable(XX,G(i)))
1755  if ((r=upperbound(XX,RR,G(i),i0+i,epss))) return(r);
1756  for (j=1 ; j<=NX ; j++) if (dealtvariable(XX,B(j)))
1757  if ((r=upperbound(XX,RR,B(j),j,epss))) return(r);
1758  }
1759  for (i=IC1 ; i<=MX ; i++) if (dealtvariable(XX,G(i)))
1760  if ((r=lowbound(XX,RR,G(i),i0+i,&first,epss))) return(r);
1761  for (j=1 ; j<=NX ; j++) if (dealtvariable(XX,B(j)))
1762  if ((r=lowbound(XX,RR,B(j),j,&first,epss))) return(r);
1763  if (REDON) {
1764  for (i=IC1;i<=MX;i++) if(inevariable(XX,G(i)))
1765  if ((r=lowbound(XX,RR,G(i),i0+i,&first,epss))) return(r);
1766  }
1767  if (!XX->tilt) {
1768  value_assign(XX->bestlow,XX->ilbound[XX->vbest]); value_assign(XX->bestup,XX->ibound[XX->vbest]);}
1769  if (VW2) value_assign(s2,boundssum(XX));
1770  if (VW3) {fprintf(FTRACE,"etat=%d s1=",XX->state);fprint_Value(FTRACE,s1);fprintf(FTRACE," s2=");
1772  fprintf(FTRACE," decrement=");fprint_Value(FTRACE,XX->decrement);fprintf(FTRACE,"\\\\\n");}
1773  if (PMET2>=66) if (value_zero_p(XX->decrement)) XBUG(93);
1774  XX->state=1; return(0); /*xs*/
1775 }
#define VW2
Definition: iabrev.h:43
#define VW3
Definition: iabrev.h:44
#define VRVID
Definition: iproblem.h:114
static int upperbound(Pproblem XX, struct rproblem *RR, int iv, int rvar, float epss)
static int cutbounds(Pproblem XX,struct rproblem *RR,int iv, int rvar,float epss)
Definition: isolve.c:1685
static int majlowbounds(Pproblem XX, struct rproblem *RR, int ope)
static void etatfonctions(Pproblem XX)
Definition: isolve.c:1640
static int lowbound(Pproblem XX, struct rproblem *RR, int iv, int rvar, int *first, float epss)
Definition: isolve.c:1709
static int phase1(Pproblem XX, struct rproblem *RR)
Definition: isolve.c:1610
static Value boundssum(Pproblem XX)
Definition: isolve.c:1736
s1
Definition: set.c:247
Value decrement
Definition: iproblem.h:99

References B, problem::bestlow, problem::bestup, boundssum(), dealtvariable(), problem::decrement, rproblem::epss, fprint_Value(), fprintf(), FTRACE, G, problem::ibound, IC1, problem::ilbound, inevariable(), lowbound(), majlowbounds(), MX, NX, phase1(), PMET2, REDON, RR, s1, problem::state, problem::tilt, upperbound(), value_assign, value_minus, VALUE_ZERO, value_zero_p, problem::vbest, VRVID, VW2, VW3, VW4, and XBUG.

Referenced by failuresp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copybound()

static void copybound ( Pproblem  XX,
Pproblem  YY 
)
static

Definition at line 435 of file isolve.c.

436 { int i; for (i=1; i<= XX->numax; i++) value_assign(YY->ibound[i],XX->ibound[i]);
437  for (i=1; i<= XX->numax; i++) value_assign(YY->ilbound[i],XX->ilbound[i]);
438 }
int numax
Definition: iproblem.h:78

References problem::ibound, problem::ilbound, problem::numax, and value_assign.

Referenced by copystructure(), and majb().

+ Here is the caller graph for this function:

◆ copyline()

static void copyline ( Pproblem  XX,
int  is,
int  id 
)
static

line is (source) is copied on line id)

Definition at line 1437 of file isolve.c.

1438 { if (is==id) return; /* line is (source) is copied on line id) */
1439  anonymouscopyline(XX,is,id) ; G(id)=G(is) ;
1440 }

References anonymouscopyline(), and G.

Referenced by fast(), and splitpb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyrline()

static void copyrline ( struct rproblem RR,
int  is,
int  id 
)
static

line is (source) is copied on line id)

Definition at line 1571 of file isolve.c.

1572 { if (is != id) /* line is (source) is copied on line id) */
1573  { int j ; RR->d[id]= RR->d[is] ;
1574  for (j=1 ; j<=RR->n ; j++) RR->a[id][j] = RR->a[is][j] ;
1575  }
1576 }

References RR.

Referenced by preparephase2().

+ Here is the caller graph for this function:

◆ copystructure()

static int copystructure ( Pproblem  XX,
Pproblem  YY 
)
static

tatic int copystructure(Pproblem XX,Pproblem YY)

nt copystructure(Pproblem XX,Pproblem YY)

Y->result=XX->result;

Y->jinfini=XX->jinfini;

Y->nub=XX->nub;

Definition at line 447 of file isolve.c.

448 { int i,j;
449  if (XX==YY) return(1); if (XX->state<0) return(2); YY->state=XX->state;
450  YY->nvar=XX->nvar; YY->mcontr=XX->mcontr; YY->nvpos=XX->nvpos;
451  YY->ftrace=XX->ftrace; YY->dyn=XX->dyn;
452  YY->ntrace=XX->ntrace; YY->ntrac2=XX->ntrac2; YY->ntrac3=XX->ntrac3;
453  YY->fourier=XX->fourier; YY->varc=XX->varc; YY->forcer=XX->forcer;
454  YY->meth=XX->meth; YY->met2=XX->met2; YY->met3=XX->met3; YY->met4=XX->met4;
455  YY->met5=XX->met5; YY->met6=XX->met6; YY->met7=XX->met7; YY->met8=XX->met8;
456  YY->critermax=XX->critermax; YY->remove=XX->remove; YY->turbo=XX->turbo;
457  YY->choixpiv=XX->choixpiv; YY->choixprim=XX->choixprim;
458  YY->negal=XX->negal; YY->icout=XX->icout;
459  YY->minimum=XX->minimum;
460  YY->mx=XX->mx; YY->nx=XX->nx;
461  YY->tmax=XX->tmax;
462  YY->numero=XX->numero; YY->numax=XX->numax; YY->lastfree=XX->lastfree;
463  YY->niter=XX->niter;
464  /*YY->result=XX->result;*/ /*YY->jinfini=XX->jinfini;*/ /*YY->nub=XX->nub;*/
465  YY->ic1=XX->ic1; YY->ntp=XX->ntp;
466  YY->vdum=XX->vdum;
467  for (i=1; i<= XX->mx; i++) {
468  for (j=1; j<= XX->nx; j++)
469  value_assign(YY->ak[i][j],XX->ak[i][j]);
470  value_assign(YY->dk[i],XX->dk[i]);
471  YY->g[i]=XX->g[i];
472  }
473  for (j=1; j<= XX->nx; j++)
474  value_assign(YY->b[j],XX->b[j]);
475  if (XX->state) copybound(XX,YY); return(0);
476 }
static void copybound(Pproblem XX, Pproblem YY)
Definition: isolve.c:435
int remove
in any case non negative variables
Definition: iproblem.h:44
int met8
Definition: iproblem.h:46
int nvpos
nombre de fonctions et contraintes originales
Definition: iproblem.h:20
int ntrac3
Definition: iproblem.h:32
int lastfree
Definition: iproblem.h:79
int met3
Definition: iproblem.h:46
int niter
Definition: iproblem.h:76
int met4
Definition: iproblem.h:46
int met7
Definition: iproblem.h:46
int critermax
Definition: iproblem.h:47
int dyn
numero "file system" pour "trace"
Definition: iproblem.h:25
int turbo
Definition: iproblem.h:47
int mx
Definition: iproblem.h:74
int ntrac2
niveau "trace" (execution accompagnee de commentaires) 0: aucune impression >= 1: volume d'informatio...
Definition: iproblem.h:31
int ntp
Definition: iproblem.h:81
int g[AKLIGNES]
Definition: iproblem.h:87
int minimum
Definition: iproblem.h:73
Value ak[AKLIGNES][AKCOLONNES]
Definition: iproblem.h:84
int b[AKCOLONNES+1]
Definition: iproblem.h:86
int met5
Definition: iproblem.h:46
int tmax
Definition: iproblem.h:75
int icout
Definition: iproblem.h:72
int meth
redundant inequalities are removed
Definition: iproblem.h:45
int choixprim
(0-1) choix du pivot (simplexe dual) 0 plus petit pivot 1 plus grand pivot
Definition: iproblem.h:51
int ntrace
Definition: iproblem.h:27
int varc
(3) elimination FOURIER-MOTZKIN 0: elimination non appliquee 1: cas triviaux ( >= 2: lorsque le nombr...
Definition: iproblem.h:38
int nvar
column in case of infinite vale of function
Definition: iproblem.h:18
Value dk[AKLIGNES]
Definition: iproblem.h:85
int choixpiv
Definition: iproblem.h:48
FILE * ftrace
nombre de variables originales contraintes (rangees en tete).
Definition: iproblem.h:22
int mcontr
nombre de variables originales
Definition: iproblem.h:19
int nx
Definition: iproblem.h:74
int vdum
Definition: iproblem.h:82
int forcer
(0-1) introduction variables contraintes 0 "strategie simplexe" 1 pivot unitaire sinon "strategie sim...
Definition: iproblem.h:43
int negal
nature contraintes 0 egalite 1 inequation <= -1 inequation >= 2 fonction a minimiser -2 fonction a ma...
Definition: iproblem.h:71
int numero
Definition: iproblem.h:78
int met6
Definition: iproblem.h:46
int fourier
Definition: iproblem.h:33
int met2
(0-1) methode finale de resolution
Definition: iproblem.h:46
int ic1
Definition: iproblem.h:74

References problem::ak, problem::b, problem::choixpiv, problem::choixprim, copybound(), problem::critermax, problem::dk, problem::dyn, problem::forcer, problem::fourier, problem::ftrace, problem::g, problem::ic1, problem::icout, problem::lastfree, problem::mcontr, problem::met2, problem::met3, problem::met4, problem::met5, problem::met6, problem::met7, problem::met8, problem::meth, problem::minimum, problem::mx, problem::negal, problem::niter, problem::ntp, problem::ntrac2, problem::ntrac3, problem::ntrace, problem::numax, problem::numero, problem::nvar, problem::nvpos, problem::nx, problem::remove, problem::state, problem::tmax, problem::turbo, value_assign, problem::varc, and problem::vdum.

Referenced by eclater(), fast(), fastplus(), iprimalplus(), pseudocopie(), and recup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ correctm()

static Value correctm ( Pproblem  XX,
Value  k1,
Value  k2 
)
static

Definition at line 575 of file isolve.c.

576 {
577  Value k;
578  if (value_notzero_p(k1) && value_notzero_p(k2)) {// must not be zero
580  if value_eq(k1,value_div(k,k2)) return(k);
581  }
582  if (VISU>=ZVO)
583  {
584  fprintf(FTRACE,"\nDNDNDN JANUS WARNING: correctm overflow");
585  assert(false);
586  }
587  return(0);//should check parameter notzero before use, so return zero means overflow
588 }
#define value_direct_multiply(v1, v2)
#define ZVO
Definition: iabrev.h:65
#define assert(ex)
Definition: newgen_assert.h:41
static int k2
static int k1

References assert, fprintf(), FTRACE, k1, k2, value_direct_multiply, value_div, value_eq, value_notzero_p, VISU, and ZVO.

Referenced by ipivotage2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ corrects()

static int corrects ( Pproblem  XX,
Value  k1,
Value  k2 
)
static

Definition at line 589 of file isolve.c.

590 {
591  Value k;
592  k=value_plus(k1,k2);
593  if value_eq(k1,value_minus(k,k2)) return(1);
594  if (VISU>=ZVO)
595  {
596  assert(false);
597  fprintf(FTRACE,"\nDNDNDN JANUS WARNING: corrects overflow");
598  }
599  return(0);//means overflow
600 }

References assert, fprintf(), FTRACE, k1, k2, value_eq, value_minus, value_plus, VISU, and ZVO.

Referenced by ipivotage2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coupe()

static void coupe ( Pproblem  XX,
int  i1,
int  i2,
Value  abpivot 
)
static

fprintf(stderr,"\n(in coupe: abpivot = ");fprint_Value(stderr,abpivot);fprintf(stderr,"");

fprintf(stderr," DKi2 =");fprint_Value(stderr,DK(i2));fprintf(stderr,"\n");

0

fprintf(stderr," AKi2j2 = ");fprint_Value(stderr,AK(i2,j2));fprintf(stderr,"\n");

vc2 4

vc4 6

vc3 5

uppression annulee 13juin 00

Definition at line 1105 of file isolve.c.

1106 {int j2;
1107 /* fprintf(stderr,"\n(in coupe: abpivot = ");fprint_Value(stderr,abpivot);fprintf(stderr,"");*///DNDB
1108  value_assign(DK(i2),cfloor(DK(i1),abpivot));
1109 /* fprintf(stderr," DKi2 =");fprint_Value(stderr,DK(i2));fprintf(stderr,"\n");*///DNDB
1110  for (j2=1 ; j2<=NX ; j2++) /*j0*/ {
1111  value_assign(AK(i2,j2),cfloor(AK(i1,j2),abpivot));
1112 /* fprintf(stderr," AKi2j2 = ");fprint_Value(stderr,AK(i2,j2));fprintf(stderr,"\n");*///DNDB
1113 }
1114 // fprintf(stderr,"\nin coupe)\n");//DNDB
1115  if (VISU>=ZVC1) /*3*/
1116  { if (VISU>=ZVC1+1) fprintf(FTRACE,"Let's build at "); /*zvc2 4*/
1117  fprintf(FTRACE,"cut $"); symbol(XX,G(i2));
1118  if(i1==i2) {fprintf(FTRACE,"$ (by "); fprint_Value(FTRACE,abpivot);
1119  fprintf(FTRACE,") from surrogate inequality");}
1120  else {fprintf(FTRACE,"$ (by "); fprint_Value(FTRACE,abpivot);
1121  fprintf(FTRACE,") from source row $y_{%d}$",G(i1));}
1122  if (VISU>=ZVC1+3) w1voir(XX,i2); /*zvc4 6*/
1123  if (VISU>=ZVC1+2) /*zvc3 5*/
1124  { fprintf(FTRACE," as follows:"); vzcut(XX,i1,abpivot,i2);
1125  }
1126  else fprintf(FTRACE,"\\\\\n"); /*suppression annulee 13juin 00 */
1127  }
1128 }
#define ZVC1
cut
Definition: iabrev.h:106
static void vzcut(Pproblem XX, int i, int divisor, int i2)
static void symboldn(Pproblem XX,int v) /***************************\/
Definition: isolve.c:126
static void symbol(Pproblem XX, int v)
N note: if use janus.c then not static DN.
Definition: isolve.c:113
static void w1voir(Pproblem XX, int ix)
fin igvoir
Definition: isolve.c:245
static Value cfloor(Value v1, Value v2)
=======================================================================
Definition: isolve.c:1088

References AK, cfloor(), DK, fprint_Value(), fprintf(), FTRACE, G, NX, symbol(), value_assign, VISU, vzcut(), w1voir(), and ZVC1.

Referenced by cutiteration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutiteration()

static int cutiteration ( Pproblem  XX,
int  i1,
int  j1,
int  turb 
)
static

surrogate cut

PPP9

Definition at line 1129 of file isolve.c.

1131 { int r=0,ix=0;
1132  Value abpivot =VALUE_ZERO;
1133  if (value_notone_p(value_assign(abpivot,value_abs(AK(i1,j1))))) {
1134  if (value_zero_p(abpivot)) { NUB=13; return(VRBUG); }
1135  if (cutline(XX,i1)) /* surrogate cut*/
1136  { coupe(XX,i1,i1,abpivot); ix=i1;
1137  }
1138  else
1139  { if ((r=newcut(XX))) return(r); coupe(XX,i1,MX,abpivot); ix=MX;
1140  if (PMETH==9) /* PPP9 */
1141  {localrsimplex(XX,1);fprintf(FTRACE,"(apres cut,avant piv)\\\\\n");
1142  }
1143  }
1144  if (VISU>=ZVCP1) igvoir3(XX,1,MX,1,i1,j1,1,ix,j1,1,i1);
1145  }
1146  else
1147  { ix=i1; if (VISU>=ZVCP1) igvoir3(XX,1,MX,1,i1,j1,0,0,0,0,0);
1148  }
1149  if (turb)
1150  { int tu,j;
1151  tu= ++XX->nturb; XX->jturb[tu]=j1; value_assign(XX->dturb[tu],DK(ix));
1152  if (XX->nturb>29)
1153  {fprintf(FTRACE,"turbo insuffisant %d\\\\\n",XX->nturb);return(VROVF);}
1154  for (j=1; j<=NX; j++) value_assign(XX->tturb[tu][j],AK(ix,j));
1155  if ((r=ipivotage2(XX,ix,j1,IC1,MX,0))) return(r);
1156  }
1157  else if ((r=ipivotage(XX,ix,j1))) return(r);
1158  if (fluidline(XX,ix))
1159  { if (VISU>=ZVCP2) wvoir(XX); retirer(XX,ix);
1160  }
1161  if (VISU>=ZVCP3) wvoir(XX);
1162  return(0);
1163 }
#define NUB
Definition: iabrev.h:147
#define PMETH
Definition: iabrev.h:23
#define ZVCP1
define ZVC2 4
Definition: iabrev.h:110
#define ZVCP2
Definition: iabrev.h:111
#define ZVCP3
Definition: iabrev.h:112
#define VRBUG
Definition: iproblem.h:119
#define VROVF
Definition: iproblem.h:120
static int fluidline(Pproblem XX, int i)
Definition: isolve.c:501
static int ipivotage(Pproblem XX, int i1, int j1)
Definition: isolve.c:717
static int cutline(Pproblem XX, int i)
Definition: isolve.c:498
static void retirer(Pproblem XX, int i1)
Definition: isolve.c:806
static int ipivotage2(Pproblem XX, int i1, int j1, int ipiv1, int ipiv2, int vtu)
========================================================================
Definition: isolve.c:604
static void coupe(Pproblem XX, int i1, int i2, Value abpivot)
Definition: isolve.c:1105
static float localrsimplex(Pproblem XX, int min)
Definition: isolve.c:432
int jturb[30]
Definition: iproblem.h:97
Value dturb[30]
Definition: iproblem.h:96
int nturb
Definition: iproblem.h:83
Value tturb[30][AKCOLONNES]
Definition: iproblem.h:95

References AK, coupe(), cutline(), DK, problem::dturb, fluidline(), fprintf(), FTRACE, IC1, igvoir3(), ipivotage(), ipivotage2(), problem::jturb, localrsimplex(), MX, newcut(), problem::nturb, NUB, NX, PMETH, retirer(), problem::tturb, value_abs, value_assign, value_notone_p, VALUE_ZERO, value_zero_p, VISU, VRBUG, VROVF, wvoir(), ZVCP1, ZVCP2, and ZVCP3.

Referenced by dualentier(), fast(), iprimal(), and is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutline()

static int cutline ( Pproblem  XX,
int  i 
)
static

is the constraint a cut inequality ?

Definition at line 498 of file isolve.c.

499 { return(cutvariable(XX,G(i))); /* is the constraint a cut inequality ? */
500 }
static int cutvariable(Pproblem XX, int v)
Definition: isolve.c:492

References cutvariable(), and G.

Referenced by cutiteration(), and razcut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutvariable()

static int cutvariable ( Pproblem  XX,
int  v 
)
static

Definition at line 492 of file isolve.c.

493 { return(v>NUMAX);
494 }

References NUMAX.

Referenced by cutline(), fluidvariable(), makecolumnfree(), redundant(), and useless().

+ Here is the caller graph for this function:

◆ dealtvariable()

static int dealtvariable ( Pproblem  XX,
int  v 
)
static

Definition at line 1626 of file isolve.c.

1627 { return((v<=NV && v>0));
1628 }

Referenced by ajout(), boundssum(), choose(), computebounds(), listehb(), lowbound(), majlowbounds(), majuu(), reduction(), and voirbornes().

+ Here is the caller graph for this function:

◆ dessous()

static Value dessous ( float  vf)
static

Definition at line 368 of file isolve.c.

369 { return(-dessus(-vf));
370 }
static Value dessus(float vf)
Definition: isolve.c:362

References dessus().

Referenced by iprimalplus(), and upperbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dessus()

static Value dessus ( float  vf)
static

Definition at line 362 of file isolve.c.

363 { Value borne; float vf2;
364  if (integrite(vf)) vf2=vf-0.5; else vf2=vf;
365  if (vf2<0) borne=vf2; else borne=vf2+1;
366  return(borne);
367 }
static int integrite(float vf)
=======================================================================
Definition: isolve.c:356

References integrite().

Referenced by dessous(), iprimalplus(), and lowbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dn_multiply()

static Value dn_multiply ( Value  v1,
Value  v2 
)
static

========================================================================

PROCEDURES for data overflow test
========================================================================

Definition at line 563 of file isolve.c.

564 {
565  Value v;
566  if (value_zero_p(v1) || value_zero_p(v2)) return(VALUE_ZERO);
567  v = value_direct_multiply(v1,v2);
568  if value_eq(v1,value_div(v,v2)) return(v);
569  else {
570  fprintf(stderr,"\nDNDNDN JANUS WARNING, multiplication overflow");
571  assert(false);
572  return VALUE_NAN;
573  }
574 }
#define VALUE_NAN

References assert, fprintf(), value_direct_multiply, value_div, value_eq, VALUE_NAN, VALUE_ZERO, and value_zero_p.

Referenced by ajouter(), changing2(), extgcd(), fourier22(), gcdtest(), ipivotage2(), pgcd2(), and pgcd2in().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dualentier()

static int dualentier ( Pproblem  XX)
static

=======================================================================

BASIC ALL-INTEGER SIMPLEX PROCEDURES
=======================================================================

available solution

more than one possible pivot

1=MX;

f (VISU) fprintf(FTRACE,"Etat sortie dyn=%d r=%d\\\\\n",DYN,r);

Definition at line 1241 of file isolve.c.

1242 { int i,j,i1=0,j1,boul2,nn,nvn;
1243  Value teta,tet,pivot=VALUE_ZERO;
1244  if (VISU>=ZVS)
1245  { fprintf(FTRACE,"{*} STEP DUAL ALL.I. ,NX=%3d,MX=%3d,t=%4d,CHOIXPIV=%d ",
1246  NX,MX,NITER,CHOIXPIV);
1247  if (PMETH==MTDI2) fprintf(FTRACE," surrogate\\\\\n");
1248  else fprintf(FTRACE," simple\\\\\n");
1249  }
1250  XX->nturb=0; if (satisfait(XX)) return(VRFIN) ;
1251  for (;;)
1252  { int vg,r; vg=10000; value_assign(tet,VALUE_ZERO); nn=0 ;
1253  for (i=IC1 ; i<=MX ; i++)
1254  if (value_neg_p(value_assign(teta,DK(i))))
1255  { boul2=1; ++nn ;
1256  for (j=1 ; j<=NX ; j++)
1257  if (value_neg_p(AK(i,j))) { boul2=0; break; }
1258  if (boul2) { if (VISU>=ZVDEND) wvoir(XX); return(VRVID); }
1259  if (CHOIXPIV==4) { if (vg>G(i)) { i1=i; value_assign(tet,teta); vg=G(i);} }
1260  else if (value_lt(teta,tet)) { i1=i; value_assign(tet,teta); }
1261  }
1262  if (value_zero_p(tet))
1263  { if (XX->turbo>=3) if (XX->nturb)
1264  { int tu;
1265  for (tu=1 ; tu<=XX->nturb ; tu++)
1266  if ((r=ipivotage2(XX,tu,XX->jturb[tu],1,IC1-1,1))) return(r);
1267  XX->nturb=0;
1268  }
1269  if (VISU>=ZVDEND) wvoir(XX); return(VRFIN) ; /* available solution */
1270  }
1271  nvn=0;
1272  for (j=1 ; j<=NX ; j++) if (value_neg_p(AK(i1,j)))
1273  { if (++nvn >1) break; j1=j ; value_assign(pivot, AK(i1,j)) ;
1274  }
1275  if (nvn >1) /* more than one possible pivot */
1276  { if (CHOIXPIV==2||CHOIXPIV==4)
1277  { int comptj,compp; compp=0;
1278  for (j=1 ; j<=NX ; j++) if (AK(i1,j)<0)
1279  { comptj=0;
1280  for (i=IC1; i<=MX; i++) if ( DK(i) < 0)
1281  if (AK(i,j)<0) ++comptj;
1282  if (comptj>compp) { compp=comptj; j1=j; }
1283  }
1284  }
1285  else
1286  if (CHOIXPIV==3)
1287  { int comptj,compp; compp=0;
1288  for (j=1 ; j<=NX ; j++) if (value_neg_p(AK(i1,j)))
1289  { comptj=0;
1290  for (i=IC1 ; i<=MX ; i++)
1291  if ((value_neg_p(DK(i))) && (value_neg_p(AK(i,j)))) ++comptj; /*> > */
1292  if (comptj>compp) { compp=comptj; j1=j; }
1293  }
1294  }
1295  else
1296  if (CHOIXPIV)
1297  { for (j=1 ; j<=NX ; j++) if (value_neg_p(AK(i1,j)))
1298  if (value_lt(pivot,AK(i1,j))) value_assign(pivot, AK(i1,j1=j));
1299  }
1300  else for (j=1; j<=NX; j++) if (value_gt(pivot,AK(i1,j))) value_assign(pivot,AK(i1,j1=j));
1301  }
1302  if (nn>1 && PMETH==MTDI2) /************ construction surrogate */
1303  { int mx1; if (VISU>=ZVDS) fprintf(FTRACE,
1304  "surrogate inequality from %d inequalities\n",nn);
1305  mx1=MX ; if ((r=newcut(XX))) return(r); /*i1=MX;*/
1307  for (j=1 ; j<=NX ; j++) value_assign(AK(MX,j),VALUE_ZERO);
1308  for (i=IC1 ; i<=mx1 ; i++)
1309  if (value_neg_p(DK(i)))
1310  { value_addto(DK(MX),DK(i)) ;
1311  for (j=1 ; j<=NX ; j++) value_addto(AK(MX,j),AK(i,j));
1312  }
1313  if (value_posz_p(DK(MX))) return(VROVF);
1314  if (VISU>=ZVDS) igvoir(XX,MX,MX);
1315  boul2=1; value_assign(pivot,VALUE_ZERO); /*** choix pivot surrogate ***/
1316  if (CHOIXPIV)
1317  { for (j=1; j<=NX; j++) if (value_neg_p(AK(MX,j)))
1318  if (boul2 || value_lt(pivot,AK(MX,j)))
1319  { boul2=0 ; j1=j ; value_assign(pivot,AK(MX,j)) ;
1320  }
1321  }
1322  else for (j=1 ; j<=NX ; j++) if (value_neg_p(AK(MX,j)))
1323  if (boul2 || value_gt(pivot,AK(MX,j)))
1324  { boul2=0 ; j1=j ; value_assign(pivot, AK(MX,j)) ;
1325  }
1326  if (boul2) return(VRVID); i1=MX;
1327  }
1328  r=0;
1329  if (DYN)
1330  { if (VISU) { fprintf(FTRACE,"Dual, constraints:"); wvoir(XX);}
1331  r=dynam(XX,1);
1332  if (VISU)
1333  { if (r)fprintf(FTRACE,"sortie dynam Dual constraints: OUI\\\\\n");
1334  else fprintf(FTRACE,"sortie dynam Dual constraints: non\\\\\n");
1335  }
1336  }
1337  /*if (VISU) fprintf(FTRACE,"Etat sortie dyn=%d r=%d\\\\\n",DYN,r);*/
1338  if (DYN && r)
1339  { if (VISU) fprintf(FTRACE,"unimodular change in DUAL\\\\\n");
1340  if ((r=build0(XX,i1,1,&j1))) return(r);
1341  }
1342  if (XX->turbo>=2)
1343  { if ((r=cutiteration(XX,i1,j1,1))) return(r);
1344  if (XX->turbo==2)
1345  { int tu; tu=XX->nturb;
1346  if (tu!=1) {fprintf(FTRACE,"ARRET D URGENCE\\\\\n"); XBUG(37);}
1347  if ((r=ipivotage2(XX,tu,XX->jturb[tu],1,IC1-1,1))) return(r);
1348  XX->nturb=0;
1349  }
1350  }
1351  else if ((r=cutiteration(XX,i1,j1,0))) return(r);
1352  }
1353 } /* fin dualentier */ ;
#define value_posz_p(val)
#define CHOIXPIV
Definition: iabrev.h:40
#define ZVDEND
Definition: iabrev.h:119
#define NITER
Definition: iabrev.h:18
#define DYN
Definition: iabrev.h:31
#define ZVDS
dual
Definition: iabrev.h:118
#define ZVS
Definition: iabrev.h:66
#define MTDI2
Definition: iproblem.h:111
#define VRFIN
.....................
Definition: iproblem.h:113
static int satisfait(Pproblem XX)
Definition: isolve.c:735
static int cutiteration(Pproblem XX, int i1, int j1, int turb)
Definition: isolve.c:1129
static void igvoir(Pproblem XX, int ia, int ib)
fin igvoir3
Definition: isolve.c:241
static int build0(Pproblem XX, int i1, int jj, int *pj1)
Definition: isolve.c:1050
int dynam(Pproblem XX, int nd)
=======================================================================
Definition: isolve.c:2082
void pivot(frac *X, frac A, frac B, frac C, frac D, bool ofl_ctrl)

References AK, build0(), CHOIXPIV, cutiteration(), DK, DYN, dynam(), fprintf(), FTRACE, G, IC1, igvoir(), ipivotage2(), problem::jturb, MTDI2, MX, newcut(), NITER, problem::nturb, NX, pivot(), PMETH, satisfait(), problem::turbo, value_addto, value_assign, value_gt, value_lt, value_neg_p, value_posz_p, VALUE_ZERO, value_zero_p, VISU, VRFIN, VROVF, VRVID, wvoir(), XBUG, ZVDEND, ZVDS, and ZVS.

Referenced by fastplus(), and is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dynam()

int dynam ( Pproblem  XX,
int  nd 
)

=======================================================================

DYNAM.c
=======================================================================

truct problem AVV; struct rproblem ARR; vid(&AVV); vidr(&ARR);

printf(FTRACE,"fourier=%d varc=%d choixpiv=%d forcer=%d\\\\\n", PFOURIER,VARC,CHOIXPIV,FORCER);

lse if (ca!=10) printf("commande ?\n");

rintf("selon c c=%c\n",c); printf("selon d c=%d\n",c);

=isalpha(c); printf("produit par isalpha v=%d\n",v);

=isdigit(c); printf("produit par isdigit v=%d\n",v);

rintf("conversion \n"); v=atoi(&c); printf("produit par atoi v=%d\n",v);

rintf("action direct:0 suite:1 visu:2 dynam:3 ? ");scanf("%2d",&v);

Definition at line 2082 of file isolve.c.

2083 { /*struct problem AVV; struct rproblem ARR; vid(&AVV); vidr(&ARR);*/
2084  /*fprintf(FTRACE,"fourier=%d varc=%d choixpiv=%d forcer=%d\\\\\n",
2085  PFOURIER,VARC,CHOIXPIV,FORCER);*/
2086  int ca,v,uni; ++XX->dyit; uni=0;
2087  if (DYN==1)
2088  { printf("dynamic visualization\n");
2089  XX->itdirect=0; DYN=2; return(0);
2090  }
2091  if (XX->niter < XX->itdirect) return(0);
2092  printf("passage dynamic iter no=%d ----------------\n",XX->dyit);
2093  if (nd==1) printf("dual dual dual dual dual dual iteration\n");
2094  if (DYN) printf("dynam, iteration %d ",NITER);
2095  printf("query: "); ca= getchar();
2096  fclose(XX->ftrace) ;
2097  while (ca!=10)
2098  {
2099  if (ca==117) { uni=1;printf("unimodular change "); }
2100  else if (ca==118) { printf("visu= "); scanf("%2d",&v); VISU=v;}
2101  else if (ca==104) /*h*/
2102  { printf("help\n");
2103  printf(" visu=%d\n",VISU);
2104  printf(" direct ");
2105  if(DYN)printf("NO\n");else printf("YES\n");
2106  printf(" itdirect=%d\n",XX->itdirect);
2107  }
2108  else if (ca==100) DYN=0; /*d*/
2109  else if (ca==115) /*s*/
2110  { printf("System state will be vizualized\n");
2111  XX->ftrace=fopen("/tmp/jtrace.tex","a") ;
2112  wvoir(XX) ; fclose(XX->ftrace) ;
2113  }
2114  else if (ca==105) /*i*/
2115  { printf("go to iteration: "); scanf("%2d",&v); XX->itdirect=v; DYN=2;}
2116  else if (ca!=10) printf("commande %d?\n",ca);
2117  /*else if (ca!=10) printf("commande ?\n");*/
2118  printf("another query: ");
2119  ca= getchar();
2120  ca= getchar();
2121  }
2122  XX->ftrace=fopen("/tmp/jtrace.tex","a") ;
2123  return(uni);
2124  /************************* while (c!=10)
2125  { c= getchar(); printf("vidage caractere =%d\n",c); }************/
2126  /*printf("selon c c=%c\n",c); printf("selon d c=%d\n",c);*/
2127  /*v=isalpha(c); printf("produit par isalpha v=%d\n",v);*/
2128  /*v=isdigit(c); printf("produit par isdigit v=%d\n",v);*/
2129  /*printf("conversion \n"); v=atoi(&c); printf("produit par atoi v=%d\n",v);*/
2130 
2131  /*printf("action direct:0 suite:1 visu:2 dynam:3 ? ");scanf("%2d",&v);*/
2132 }
int printf()
int dyit
Definition: iproblem.h:26
int itdirect
Definition: iproblem.h:77

References problem::dyit, DYN, problem::ftrace, problem::itdirect, NITER, problem::niter, printf(), VISU, and wvoir().

Referenced by dualentier(), ipivotage2(), isolve(), and sc_to_iproblem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eclater()

static int eclater ( Pproblem  XX,
Pproblem  UU,
Pproblem  VV,
struct rproblem RR 
)
static

sss

Definition at line 1949 of file isolve.c.

1950 {
1951  int r,ivb; Value k; struct problem AYY; vid(&AYY); /*ssss*/
1952  if ((r=recup(UU,VV))) return(r);
1953  if ((r=choose(UU,RR))) return(r); ivb=UU->vbest;
1954  if (value_notzero_p(UU->ilbound[ivb])) XBUG(54);
1955  for (value_assign(k,UU->ilbound[ivb]); value_le(k,UU->ibound[ivb]); value_increment(k)) {
1956  if (copystructure(UU,&AYY)) XBUG(44); AYY.vbest=ivb;
1957  if ((r=ajout(&AYY))) return(r); if (value_notzero_p(k)) vidr(RR);
1958  RR->namev=ivb; RR->vc = hb(RR,ivb);
1959  if (!presence(&AYY,ivb)) XBUG(53); r=splitpb(&AYY,VV,RR,AYY.cu,AYY.lu,k,0);
1960  if (r==VRFIN) value_assign(XX->dk[1],AYY.dk[1]); if (r!=VRVID) return(r); }
1961  if (VW4) fprintf(FTRACE,"INDIRECT PROOF NX=%d\\\\\n",NX);
1962  return(VRVID);
1963 }
#define value_increment(ref)
#define value_le(v1, v2)
static int presence(Pproblem XX, int iv)
Definition: isolve.c:533
static int recup(Pproblem XX, Pproblem VV)
MMM4.
Definition: isolve.c:1936
static void vidr(struct rproblem *RR)
Definition: isolve.c:442
static int choose(Pproblem XX, struct rproblem *RR)
Definition: isolve.c:1802
static int splitpb(Pproblem XX, Pproblem VV, struct rproblem *RR, int jfixe, int ifixe, Value k, int ineq)
Definition: isolve.c:1909
static int copystructure(Pproblem XX, Pproblem YY)
tatic int copystructure(Pproblem XX,Pproblem YY)
Definition: isolve.c:447
static void vid(Pproblem XX)
Definition: isolve.c:439
static int ajout(Pproblem XX)
Definition: isolve.c:1819
#define UU
Definition: newgen_types.h:98
=========================================================================
Definition: iproblem.h:16

References ajout(), choose(), copystructure(), problem::cu, problem::dk, fprintf(), FTRACE, hb(), problem::lu, NX, presence(), recup(), RR, splitpb(), UU, value_assign, value_increment, value_le, value_notzero_p, problem::vbest, vid(), vidr(), VRFIN, VRVID, VW4, and XBUG.

Referenced by failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emptycolelim()

static void emptycolelim ( Pproblem  XX,
int  j1 
)
static

empty column j1 is eliminated and replaced by column NX

0

Definition at line 771 of file isolve.c.

772 { if (j1 != NX) /* empty column j1 is eliminated and replaced by column NX */
773  { int i;
774  B(j1)=B(NX) ;
775  for (i=1 ; i<=MX ; i++) /*i0*/
776  if (value_notzero_p(AK(i,NX))) value_assign(AK(i,j1),AK(i,NX));
777  }
778  --NX ;
779 }

References AK, B, MX, NX, value_assign, and value_notzero_p.

Referenced by fourier0(), fourier1(), fourier22(), and is2().

+ Here is the caller graph for this function:

◆ emptylhs()

static int emptylhs ( Pproblem  XX,
int  i 
)
static

Definition at line 517 of file isolve.c.

518 { int j; for (j=1; j<=NX; j++) if value_notzero_p(AK(i,j)) return(0);//DN
519  return(1);
520 }

References AK, NX, and value_notzero_p.

Referenced by is2().

+ Here is the caller graph for this function:

◆ extgcd()

static Value extgcd ( Pproblem  XX,
Value  a1,
Value  a2,
Value pu1,
Value pu2,
Value pu3,
int  zvx 
)
static

tatic int extgcd(Pproblem XX,int a1,int a2,int *pu1,int *pu2,int *pu3, int zvx) { int v1,v2,v3,t1,t2,t3,q; if (a1==0 || a2==0) return(1); pu1=1 ; *pu2=0 ; *pu3=abs(a1) ; v1=0 ; v2=1 ; v3=abs(a2) ; while (v3!=0) { q=*pu3/v3 ; t1= *pu1 -v1*q ; t2= *pu2-v2*q ; t3=*pu3-v3*q ; pu1=v1 ; *pu2=v2 ; *pu3=v3 ; v1=t1 ; v2=t2 ; v3=t3 ; } if (a1<0) *pu1= - *pu1 ; if (a2<0) *pu2= - *pu2 ; if(VISU>=zvx) vzextgcd(XX, a1, a2, *pu1, *pu2, *pu3,zvx); return(0); }DN

Definition at line 982 of file isolve.c.

983 { Value v1,v2,v3,t1,t2,t3,q;
984  if (value_zero_p(a1) || value_zero_p(a2)) return(VALUE_ONE);
987  while (value_notzero_p(v3))
988  { value_assign(q,value_div(*pu3,v3)) ;
989  value_assign(t1,value_minus(*pu1,dn_multiply(v1,q)));
990  value_assign(t2,value_minus(*pu2,dn_multiply(v2,q)));
991  value_assign(t3,value_minus(*pu3,dn_multiply(v3,q)));
992  value_assign(*pu1,v1); value_assign(*pu2,v2); value_assign(*pu3,v3);
993  value_assign(v1,t1); value_assign(v2,t2); value_assign(v3,t3) ;
994  }
995  if (value_neg_p(a1)) value_oppose(*pu1) ; if (value_neg_p(a2)) value_oppose(*pu2) ;
996  if(VISU>=zvx) vzextgcd(XX, a1, a2, *pu1, *pu2, *pu3,zvx);
997  return(VALUE_ZERO);
998 }
#define value_oppose(ref)
static void vzextgcd(Pproblem XX, int a1, int a2, int u1, int u2, int u3, int zvx)
Definition: isolve.c:299

References dn_multiply(), value_abs, value_assign, value_div, value_minus, value_neg_p, value_notzero_p, VALUE_ONE, value_oppose, VALUE_ZERO, value_zero_p, VISU, and vzextgcd().

Referenced by changing2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ failure()

static int failure ( Pproblem  XX,
Pproblem  UU,
Pproblem  VV,
struct rproblem RR 
)
static

Definition at line 1964 of file isolve.c.

1965 {
1966  int r,compb;
1967  if ((r=failuresp(XX,RR,&compb))) {
1968  if (r!=VRVID) XBUG(99); if (VW4) fprintf(FTRACE,"real proof\\\\\n");
1969  return(r);}
1970  if (compb) if ((r=majb(XX,UU,RR))) {
1971  if (r!=99) XBUG(96);
1972  else {
1973  value_assign(XX->dk[1],UU->dk[1]);
1974  if ((r=recup(UU,VV))) XBUG(94);
1975  if (VW4) fprintf(FTRACE,"integ sol\\\\\n");
1976  return(VRFIN);
1977  }}
1978  if (VW3&&MSR>=8) {fprintf(FTRACE,"U: "); listehb(UU,RR);}
1979  if (XX->tilt||XX->bloquer) {
1980  if ((r=reduction(UU,RR))) return(r);
1981  if ((r=reducedpb(UU,VV,RR))==VRFIN) {
1982  if (VW4&&XX->bloquer) fprintf(FTRACE,"solution bloquee\\\\\n");
1983  value_assign(XX->dk[1],UU->dk[1]);
1984  }
1985  return(r);
1986  } else return(eclater(XX,UU,VV,RR));
1987 }
static int failuresp(Pproblem XX, struct rproblem *RR, int *compb)
Definition: isolve.c:1861
static int eclater(Pproblem XX, Pproblem UU, Pproblem VV, struct rproblem *RR)
Definition: isolve.c:1949
static int reducedpb(Pproblem XX, Pproblem VV, struct rproblem *RR)
Definition: isolve.c:1892
static int majb(Pproblem XX, Pproblem UU, struct rproblem *RR)
Definition: isolve.c:1852
static int reduction(Pproblem XX, struct rproblem *RR)
Definition: isolve.c:1941
static void listehb(Pproblem XX, struct rproblem *RR)
Definition: isolve.c:1795
int bloquer
Definition: iproblem.h:98

References problem::bloquer, problem::dk, eclater(), failuresp(), fprintf(), FTRACE, listehb(), majb(), MSR, recup(), reducedpb(), reduction(), RR, problem::tilt, UU, value_assign, VRFIN, VRVID, VW3, VW4, and XBUG.

Referenced by check_delete_workspace(), fastplus(), and unsplit_internal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ failuresp()

static int failuresp ( Pproblem  XX,
struct rproblem RR,
int compb 
)
static

X->bestup<=PCOMP

s

Definition at line 1861 of file isolve.c.

1862 {
1863  int r,up; *compb=1; XX->bloquer=0; up=1;
1864  if (VW7) {fprintf(FTRACE," failure:\n"); wvoir(XX); }
1865  if (PMET2>=66) XX->bloquer=1;
1866  else if (PCOMP&&XX->state>0) {
1867  if ((r=choose(XX,RR))) return(r);
1868  if (XX->tilt) XBUG(67);
1869  if ((PCOMP==9)||(value_le(XX->bestup,VALUE_ONE))) *compb=0; /*XX->bestup<=PCOMP*/
1870  else if (PCOMP==2) up=0;
1871  }
1872  if (!(*compb)) {
1873  if (MSR>=8&&RR->state==0&&RR->vc){
1874  if (VW3) fprintf(FTRACE,"SIMULER y%d col%d\\\\\n",RR->namev,RR->vc);
1875  if (!RR->vc) XBUG(84); if (RR->vc!=hb(RR,RR->namev)) XBUG(87);
1876  elimination(RR,RR->vc);
1877  } else if ((r=phase1(XX,RR))) {
1878  if (r==VRVID&&VW4) fprintf(FTRACE,"qimmediate "); return(r);}
1879  if ((r=choose(XX,RR))) return(r);
1880  XX->state++; /*xs*/
1881  if (VW3&&MSR>=8) {
1882  if (hb(RR,XX->vbest)) fprintf(FTRACE,"HB:%d\\\\\n",XX->vbest);
1883  else fprintf(FTRACE,"echec HB:%d\\\\\n",XX->vbest);}
1884  }
1885  else {
1886  if (VW3&&MSR>=8) fprintf(FTRACE,"COMPUTE TOTAL %d\\\\\n",XX->state);
1887  if ((r=computebounds(XX,RR,up))) return(r);
1888  if (VW4) {fprintf(FTRACE,"apres compute:"); voirbornes(XX);}
1889  }
1890  return(0);
1891 }
static int computebounds(Pproblem XX, struct rproblem *RR, int up)
Definition: isolve.c:1746
void elimination(Prproblem RR, int j1)
fin norm()
Definition: r1.c:301

References problem::bestup, problem::bloquer, choose(), computebounds(), elimination(), fprintf(), FTRACE, hb(), MSR, PCOMP, phase1(), PMET2, RR, problem::state, problem::tilt, value_le, VALUE_ONE, problem::vbest, voirbornes(), VRVID, VW3, VW4, VW7, wvoir(), and XBUG.

Referenced by failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fast()

static int fast ( Pproblem  XX,
Pproblem  ZZ 
)
static

PPP3

no solution

Definition at line 1451 of file isolve.c.

1452 { int icf,iopt,r,i,j,exicou;
1453  exicou=ICOUT; icf=IC1 ; newcut(XX) ; inhibit(XX,MX); G(icf)=0;
1454  for (i=IC1; i<=MX; i++) if (value_neg_p(DK(i))) inhibit(XX,i);
1455  while (icf<IC1-1)
1456  { iopt=0;
1457  if (PMETH<=3) /* PPP3 */
1458  { value_assign(DK(icf),VALUE_ZERO);
1459  for (j=1; j<=NX; j++) value_assign(AK(icf,j),VALUE_ZERO);
1460  for (i=icf+1; i<IC1; i++)
1461  { value_addto(DK(icf), DK(i));
1462  for (j=1; j<=NX; j++) value_addto(AK(icf,j),AK(i,j));
1463  }
1464  }
1465  else
1466  { Value dkopt; value_assign(dkopt,VALUE_ZERO);
1467  for (i=icf+1; i<IC1; i++) if (value_lt(DK(i),dkopt)) value_assign(dkopt,DK(iopt=i));
1468  copyline(XX,iopt,icf);
1469  }
1470  ICOUT=icf;
1471  if(VW4){fprintf(FTRACE,"passage fast(IC1=%d), ",IC1);symbold(XX,G(icf));}
1472  if (PMET3) { if (copystructure(XX,ZZ)) XBUG(41); remise(ZZ,icf);}
1473  r=iprimal(XX,1,icf,1);
1474  if (VW4)
1475  { if (r==VRINS) fprintf(FTRACE," (too many)");
1476  fprintf(FTRACE," %d iterations\\\\\n",NITER);
1477  }
1478  if (r==VRINS) { remise(XX,icf); return(r);}
1479  if (r==VRINF)
1480  { int ik;
1481  fprintf(FTRACE,"ENTIER INFINI %d\\\\\n",XX->jinfini); wvoir(XX);
1482  if (value_mone_p(AK(icf,XX->jinfini)))
1483  { if (!iopt) XBUG(24);
1484  remettre(XX,iopt); ik=IC1;
1485  }
1486  else ik=icf;
1487  if ((r=cutiteration(XX,ik,XX->jinfini,0))) return(r); r=10;
1488  }
1489  ICOUT=exicou;
1490  if (value_neg_p(DK(icf)) && r!=11) /* no solution */
1491  { remise(XX,icf);
1492  if (VISU>=ZVSAT3) { fprintf(FTRACE," fast vide\n"); wvoir(XX); }
1493  return(VRVID);
1494  }
1495  for (i=IC1-1 ; i>icf ; i--) if (value_posz_p(DK(i))) remettre(XX,i);
1496  if (VISU>=ZVSAT4) {fprintf(FTRACE,"STEP FAST IC1==%d\n",IC1); wvoir(XX);}
1497  }
1498  remise(XX,icf);
1499  if (VW2 || VISU>=ZVSAT4)
1500  { fprintf(FTRACE,"Feasibility proof (primal), cost = ");
1502  vzlast(XX); wvoir(XX);
1503  }
1504  if (!satisfait(XX)) { NUB=27; return(VRBUG); } return(VRFIN);
1505 } /* ========================== fin fast =================================== */
#define value_mone_p(val)
#define value_uminus(val)
unary operators on values
#define PMET3
Definition: iabrev.h:25
#define ICOUT
Definition: iabrev.h:139
#define ZVSAT3
Definition: iabrev.h:122
#define ZVSAT4
Definition: iabrev.h:123
#define VRINS
Definition: iproblem.h:116
#define VRINF
Definition: iproblem.h:115
static int iprimal(Pproblem XX, int minimum, int i2, int stopcout)
static void voirfreq(Pproblem XX) /*****\/
Definition: isolve.c:1363
static void remettre(Pproblem XX, int in)
Definition: isolve.c:1445
static void copyline(Pproblem XX, int is, int id)
Definition: isolve.c:1437
static void inhibit(Pproblem XX, int in)
========================= PROCEDURES FOR FAST ===========================
Definition: isolve.c:1442
static int remise(Pproblem XX, int icf)
Definition: isolve.c:1448
static int vzlast(Pproblem XX)
=======================================================================
Definition: isolve.c:2136
int jinfini
Definition: iproblem.h:17

References AK, copyline(), copystructure(), cutiteration(), DK, fprint_Value(), fprintf(), FTRACE, G, IC1, ICOUT, inhibit(), iprimal(), problem::jinfini, MX, newcut(), NITER, NUB, NX, PMET3, PMETH, remettre(), remise(), satisfait(), symbold(), value_addto, value_assign, value_lt, value_mone_p, value_neg_p, value_posz_p, value_uminus, VALUE_ZERO, VISU, VRBUG, VRFIN, VRINF, VRINS, VRVID, VW2, VW4, vzlast(), wvoir(), XBUG, ZVSAT3, and ZVSAT4.

Referenced by fastplus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fastplus()

static int fastplus ( Pproblem  XX,
Pproblem  VV,
struct rproblem RR 
)
static

sss

PP8 mise au point

evoir utilite

PP7

PP6

sss

Definition at line 1988 of file isolve.c.

1989 {
1990  int r; struct problem AUU; vid(&AUU); /*ssss*/
1991  if (PMETH>=8) return(failure(XX,XX,VV,RR)); /*PPP8 mise au point*/
1992  if (copystructure(XX,&AUU)) XBUG(45); /*revoir utilite*/
1993  if (PMETH>=7) return(failure(XX,&AUU,VV,RR)); /*PPP7*/
1994  NITER=0; if (CRITERMAX) TMAX=(NX * CRITERMAX)+NITER;
1995  if (PMETH>=6) /*PPP6*/ {
1996  if ((r=dualentier(XX))==VRINS) return(failure(XX,&AUU,VV,RR));
1997  if (VW2) if (r==VRFIN){
1998  fprintf(FTRACE,"Feasibility proof (dual), cost = ");
2000  vzlast(XX); if (VW4) wvoir(XX);
2001  }
2002  } else {
2003  struct problem AZZ; vid(&AZZ); /*ssss*/
2004  if ((r=fast(XX,&AZZ))==VRINS) {
2005  if (PMET3==0) r=failure(XX,&AUU,VV,RR);
2006  else { r=failure(&AZZ,&AUU,VV,RR); value_assign(XX->dk[1],AZZ.dk[1]); }
2007  ICOUT=0; /******* revoir!!!!! necessaire 2 cas ********/
2008  }
2009  }
2010  return(r);
2011 }
#define CRITERMAX
Definition: iabrev.h:39
#define TMAX
Definition: iabrev.h:144
static int failure(Pproblem XX, Pproblem UU, Pproblem VV, struct rproblem *RR)
Definition: isolve.c:1964
static int dualentier(Pproblem XX)
=======================================================================
Definition: isolve.c:1241
static int fast(Pproblem XX, Pproblem ZZ)
Definition: isolve.c:1451

References copystructure(), CRITERMAX, DK, problem::dk, dualentier(), failure(), fast(), fprint_Value(), fprintf(), FTRACE, ICOUT, NITER, NX, PMET3, PMETH, RR, TMAX, value_assign, value_uminus, vid(), VRFIN, VRINS, VW2, VW4, vzlast(), wvoir(), and XBUG.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findandmod()

static int findandmod ( Pproblem  XX,
int  v,
Value  k,
int  ineq 
)
static

Definition at line 1557 of file isolve.c.

1558 {
1559  int c,l,r; c=l=0;
1560  if (!(r=presence(XX,v)))XBUG(82); if (r>0) c=r; else l= -r;
1561  if (VW4&&ineq) {fprintf(FTRACE,"increment y(%d)= ",v);fprint_Value(FTRACE,k);}
1562  if (modifyconstr(XX,c,l,k,ineq)) XBUG(90);
1563  if (VW5){if(c)fprintf(FTRACE,"(column)");fprintf(FTRACE," - variable %d",v);}
1564  return(0);
1565 }
#define VW5
Definition: iabrev.h:46
static int modifyconstr(Pproblem XX, int jfixe, int ifixe, Value k, int ineq)
Definition: isolve.c:1539

References fprint_Value(), fprintf(), FTRACE, modifyconstr(), presence(), VW4, VW5, and XBUG.

Referenced by iprimalplus(), majuu(), and reduction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fluidline()

static int fluidline ( Pproblem  XX,
int  i 
)
static

Definition at line 501 of file isolve.c.

502 { return(fluidvariable(XX,G(i)));
503 }
static int fluidvariable(Pproblem XX, int v)
Definition: isolve.c:495

References fluidvariable(), and G.

Referenced by cutiteration(), and is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fluidvariable()

static int fluidvariable ( Pproblem  XX,
int  v 
)
static

or cut variable

Definition at line 495 of file isolve.c.

496 { return( freevariable(XX,v) || cutvariable(XX,v) ); /* or cut variable */
497 }
static int freevariable(Pproblem XX, int v)
static int costvariable(Pproblem XX) /**************************\/
Definition: isolve.c:486

References cutvariable(), and freevariable().

Referenced by fluidline().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fourier0()

static void fourier0 ( Pproblem  XX,
int  j 
)
static

all non-zero coefficients of a column have the same sign

vv

Definition at line 834 of file isolve.c.

835 { int i ; /* all non-zero coefficients of a column have the same sign */
836  if (VISU>=ZVS) vznowstep(XX);
837  if (VISU>=ZVF1)
838  { fprintf(FTRACE,"fourier-Motzkin 0 : variable $x_{%d}$ - inequalities:",
839  B(j)); /*vvv*/
840  for (i=MX ; i>=1 ; i--)
841  if (value_notzero_p(AK(i,j))) fprintf(FTRACE," $y_{%d}$ ",G(i)) ;
842  if (VISU<ZVF3) fprintf(FTRACE,"\\\\\n") ;
843  }
844  for (i=MX ; i>=IC1 ; i--)
845  if (value_notzero_p(AK(i,j))) retirer(XX,i) ;
846  emptycolelim(XX,j) ;
847  if (VISU>=ZVF3) wvoir(XX);
848 } /* fin fourier0 */
#define ZVF3
Definition: iabrev.h:96
#define ZVF1
fourier
Definition: iabrev.h:94
static void vznowstep(Pproblem XX)
Definition: isolve.c:62
static void emptycolelim(Pproblem XX, int j1)
Definition: isolve.c:771

References AK, B, emptycolelim(), fprintf(), FTRACE, G, IC1, MX, retirer(), value_notzero_p, VISU, vznowstep(), wvoir(), ZVF1, ZVF3, and ZVS.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fourier1()

static void fourier1 ( Pproblem  XX,
int  pn,
int  j,
int  ip1 
)
static

integer fourier elimination criterion and:

a single positive coefficient or a single negative coefficient

f (pn==1)

ligne ip1 sur ligne i

Definition at line 870 of file isolve.c.

873 { int i,bj;
874  Value sk,vt;
875  bj=B(j);
876  if (VISU>=ZVS) vznowstep(XX);
877  /*if (pn==1)*/
878  if (value_one_p(value_assign(vt,AK(ip1,j))))
879  { for (i=MX ; i>=IC1 ; i--)
880  if (value_neg_p(value_assign(sk,AK(i,j)))) ajouter(XX,value_uminus(sk),ip1,i);/* ligne ip1 sur ligne i */
881  }
882  else
883  for (i=MX ; i>=IC1 ; i--)
884  if (value_pos_p(value_assign(sk,AK(i,j)))) ajouter(XX,sk,ip1,i);
885  retirer(XX,ip1) ; emptycolelim(XX,j) ;
886  if (VISU) {
887  if (VISU>=ZVF1) {
888  fprintf(FTRACE,"fourier-Motzkin ");fprint_Value(FTRACE,vt);fprintf(FTRACE," variable $x_{%d}$\\\\\n",bj);}
889  if (VISU>=ZVF3) wvoir(XX);
890  }
891 } /* fin fourier1 */
static void ajouter(Pproblem XX, Value sk, int ip1, int i)
fin fourier0
Definition: isolve.c:849

References ajouter(), AK, B, emptycolelim(), fprint_Value(), fprintf(), FTRACE, IC1, MX, retirer(), value_assign, value_neg_p, value_one_p, value_pos_p, value_uminus, VISU, vznowstep(), wvoir(), ZVF1, ZVF3, and ZVS.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fourier22()

static void fourier22 ( Pproblem  XX,
int  j 
)
static

fin fourier1

integer fourier elimination criterion and: 2 positive coefficients and 2 negative coefficients

vv

0

Definition at line 892 of file isolve.c.

895 { int ip1=0,ip2=0,im1=0,im2=0,i,jk;
896  Value sk,rp1,rp2=0,rm1,rm2=0,dp1,dp2,dm1,dm2,ap1,ap2,am1,am2;
897 
898  if (VISU>=ZVS) vznowstep(XX);
899  rp1=0 ; rm1=0;
900  for (i=MX ; i>=IC1 ; i--)
901  if (value_assign(sk,AK(i,j))){
902  if (value_pos_p(sk))
903  { if (value_zero_p(rp1))
904  { value_assign(rp1,sk) ; ip1=i;
905  }
906  else
907  { value_assign(rp2,sk) ; ip2=i;
908  }
909  }
910  else {
911  if (value_zero_p(rm1))
912  { value_assign(rm1,sk) ; im1=i;
913  }
914  else
915  { value_assign(rm2,sk) ; im2=i;
916  }
917  }}
918  if (VISU>=ZVF1) fprintf(FTRACE, /*vvv*/
919  "Fourier-Motzkin 2-2 variable $x_{%d}$ inequalities +: $y_{%d}$ $y_{%d}$ inequalities -: $y_{%d}$ $y_{%d}$\\\\\n",B(j),G(ip1),G(ip2),G(im1),G(im2));
920 
921  value_assign(dp1,DK(ip1)); value_assign(dp2,DK(ip2));
922  value_assign(dm1,DK(im1)); value_assign(dm2,DK(im2));
923 
924  value_assign(DK(im1),value_minus(dn_multiply(rp1,dm1),dn_multiply(rm1,dp1)));
925  value_assign(DK(im2),value_minus(dn_multiply(rp2,dm1),dn_multiply(rm1,dp2)));
926  value_assign(DK(ip1),value_minus(dn_multiply(rp1,dm2),dn_multiply(rm2,dp1)));
927  value_assign(DK(ip2),value_minus(dn_multiply(rp2,dm2),dn_multiply(rm2,dp2)));
928  //DK(im1) = rp1*dm1 - rm1*dp1; DK(im2) = rp2*dm1 - rm1*dp2;
929  //DK(ip1) = rp1*dm2 - rm2*dp1; DK(ip2) = rp2*dm2 - rm2*dp2;
930 
931  for (jk=NX ; jk>=1 ; jk--) /*j0*/ {
932  value_assign(ap1,AK(ip1,jk)); value_assign(ap2,AK(ip2,jk));
933  value_assign(am1,AK(im1,jk)); value_assign(am2,AK(im2,jk));
934 
935  value_assign(AK(im1,jk),value_minus(dn_multiply(rp1,am1),dn_multiply(rm1,ap1)));
936  value_assign(AK(im2,jk),value_minus(dn_multiply(rp2,am1),dn_multiply(rm1,ap2)));
937  value_assign(AK(ip1,jk),value_minus(dn_multiply(rp1,am2),dn_multiply(rm2,ap1)));
938  value_assign(AK(ip2,jk),value_minus(dn_multiply(rp2,am2),dn_multiply(rm2,ap2)));
939  //AK(im1,jk),rp1*am1 - rm1*ap1; AK(im2,jk) = rp2*am1 - rm1*ap2;
940  // AK(ip1,jk) = rp1*am2 - rm2*ap1; AK(ip2,jk) = rp2*am2 - rm2*ap2;
941  }
942  if (VISU>=ZVF2) wvoir(XX);
943  emptycolelim(XX,j);
944  if (VISU>=ZVF3) wvoir(XX);
945 } /* fin fourier22 */
#define ZVF2
Definition: iabrev.h:95

References AK, B, DK, dn_multiply(), emptycolelim(), fprintf(), FTRACE, G, IC1, MX, NX, value_assign, value_minus, value_pos_p, value_zero_p, VISU, vznowstep(), wvoir(), ZVF1, ZVF2, ZVF3, and ZVS.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ freecolumn()

static int freecolumn ( Pproblem  XX,
int  j 
)
static

static int cutcolumn(Pproblem XX,int j) /*****************************\/

{ return(cutvariable(XX,B(j))); } static int fluidcolumn(Pproblem XX, int j) /**************************\/ { return(fluidvariable(XX,B(j))); }

Definition at line 510 of file isolve.c.

511 { return(freevariable(XX,B(j)));
512 }

References B, and freevariable().

Referenced by is2(), and makecolumnfree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ freevariable()

static int freevariable ( Pproblem  XX,
int  v 
)
static

static int costvariable(Pproblem XX) /**************************\/

{ return(NV+1); }

Definition at line 486 of file isolve.c.

487 { return((v>NP && v<=NV) || v<0);
488 }
#define NP
Definition: iabrev.h:22
#define NV
Definition: iabrev.h:21

References NP, and NV.

Referenced by fluidvariable(), freecolumn(), and symbol().

+ Here is the caller graph for this function:

◆ gcdtest()

static int gcdtest ( Pproblem  XX,
int  i,
int pj1,
Value ppivot,
int  viz 
)
static

=======================================================================

GCD TEST
=======================================================================

GCD test + division by GCD ** 0: fails * -1: empty polyedron

is LHS empty?

GCD test

division by GCD

Definition at line 1213 of file isolve.c.

1214 {
1215  int j;
1216  Value gcd; /* GCD test + division by GCD ** 0: fails * -1: empty polyedron */
1217  if (value_zero_p(value_assign(gcd,pgcdsegment(XX,i,1,NX))))/* is LHS empty? */ {
1218  if (value_notzero_p(DK(i))) {
1219  if (VISU) vzgcd(XX,i,0,viz); return(-1); /*1*/
1220  }
1221  } else if (value_gt(gcd,VALUE_ONE)) {
1222  Value dp ;
1223  if (VISU>=viz+1) { fprintf(FTRACE,"* ligne%3d gcd=",i);fprint_Value(FTRACE,gcd);fprintf(FTRACE,"\\\\\n");} /*2*/
1224  if (value_notzero_p(DK(i))) /* GCD test */ {
1225  value_assign(dp,value_div(DK(i),gcd));
1226  if (value_ne(dn_multiply(dp,gcd),DK(i))) {
1227  if (VISU) vzgcd(XX,i,gcd,viz); return(-1);}
1228  value_assign(DK(i),dp);
1229  }
1230  for (j=NX; j>=1; j--) value_division(AK(i,j),gcd); /* division by GCD */
1231  for (j=NX; j>=1; j--) if (value_one_p(value_abs(AK(i,j)))) {
1232  *pj1=j ; value_assign(*ppivot,VALUE_ONE); break; }
1233  if (VISU>=viz+1){
1234  fprintf(FTRACE,"Line %d was divided by gcd = ",i);fprint_Value(FTRACE,gcd);fprintf(FTRACE,"\\\\\n");}
1235  }
1236  return(0);
1237 }
#define value_division(ref, val)
static void vzgcd(Pproblem XX, int i, int gcd, int viz)
Definition: isolve.c:294

References AK, DK, dn_multiply(), fprint_Value(), fprintf(), FTRACE, NX, pgcdsegment(), value_abs, value_assign, value_div, value_division, value_gt, value_ne, value_notzero_p, VALUE_ONE, value_one_p, value_zero_p, VISU, and vzgcd().

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hb()

static int hb ( struct rproblem RR,
int  iv 
)
static

==================================================================

Definition at line 1567 of file isolve.c.

1568 { int j; for (j=1; j<=RR->nb; j++) if (RR->iname[RR->b[j]]==iv) return(j);
1569  return(0);
1570 }

References RR.

Referenced by choose(), eclater(), failuresp(), listehb(), and splitpb().

+ Here is the caller graph for this function:

◆ igvoir()

static void igvoir ( Pproblem  XX,
int  ia,
int  ib 
)
static

fin igvoir3

rint latex arrays

Definition at line 241 of file isolve.c.

242 { igvoir3(XX,ia,ib,0,0,0,0,0,0,0,0);
243 } /* fin igvoir */

References igvoir3().

Referenced by dualentier(), w1voir(), and wvoir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ igvoir3()

static void igvoir3 ( Pproblem  XX,
int  ia,
int  ib,
int  carre,
int  ip,
int  jp,
int  carre2,
int  ip2,
int  jp2,
int  fleche,
int  ifl 
)
static

rint latex arrays * ak et dk between lines ia and ib

istances

0

0

Definition at line 178 of file isolve.c.

180 { int i,j ; /*print latex arrays * ak et dk between lines ia and ib */
181  if (NX>16) fprintf(FTRACE,"{\\scriptsize\n");
182  else if (NX>13)
183  fprintf(FTRACE,"{\\footnotesize\n");
184  fprintf(FTRACE,"\\begin{center}\n");
185  fprintf(FTRACE,"\\fbox{$\n");
186  fprintf(FTRACE," \\begin{array}{rrrrrrrrrrrrrrrrrrrrrrrrr}\n");
187  for ( i=ia ; i <= ib ; i++)
188  {
189  int s,nk; Value k;//DN, unused ab
190  s=0; nk=0;
191  if (fleche && i==ifl) fprintf(FTRACE,"\\Rightarrow ") ;
192  if (i<IC1)
193  {
194  if (i==ICOUT) fprintf(FTRACE,"\\bullet ") ;
195 
196  if ((i==ICOUT) || (G(i)==0)) fprintf(FTRACE,"-d_{%d}",IC1-i);
197  else symbol(XX,G(i));
198  s=1;/*distances*/
199  }
200  else
201  { if (janus_egalite(XX,i)) fprintf(FTRACE,"e_{%d}",G(i));
202  else symbol(XX,G(i));
203  fprintf(FTRACE,":") ;
204  }
205  for ( j=1 ; j <= NX ; j++) /*j0*/
206  {
207  int boite; boite=0;
208  if (value_assign(k,AK(i,j))) ++nk;
209  if (nk==17) { nk=0; fprintf(FTRACE," \\\\ & \n") ; }
210  if (( NX <= 24) || value_notzero_p(k) ) fprintf(FTRACE," &") ;
211  if ((((fleche && i==ifl) || (carre && i==ip)) && j==jp)
212  || (carre2 && i==ip2 && j==jp2))
213  {
214  fprintf(FTRACE,"\\fbox{$"); boite=1;
215  }
216  if value_notzero_p(k)
217  {
218  if value_neg_p(k) fprintf(FTRACE,"-"); else if (s) fprintf(FTRACE,"+");
220  symbol(XX,B(j));
221  s=1;
222  }
223  if (boite) { fprintf(FTRACE,"$}"); boite=0; }
224  }
225  fprintf(FTRACE," & ") ;
226  if ((i<IC1)||janus_egalite(XX,i)) fprintf(FTRACE,"=") ;
227  else fprintf(FTRACE,"\\leq") ;
228  {fprintf(FTRACE," & ");fprint_Value(FTRACE,DK(i));fprintf(FTRACE," \\\\\n") ;}
229  if (i==IC1-1) {
230  if (NX>24) fprintf(FTRACE," .....") ;
231  else
232  for (j=1; j <= NX; j++) fprintf(FTRACE," &.....") ; /*j0*/
233  fprintf(FTRACE," \\\\\n") ;
234  }
235  } ;
236  fprintf(FTRACE," \\end{array} \n") ;
237  fprintf(FTRACE,"$}\n");
238  fprintf(FTRACE,"\\end{center}\n");
239  if (NX>14) fprintf(FTRACE,"}\n");
240 } /* fin igvoir3 */
static int janus_egalite(Pproblem XX, int i)
=========================================================================
Definition: isolve.c:480

References AK, B, DK, fprint_Value(), fprintf(), FTRACE, G, IC1, ICOUT, janus_egalite(), NX, symbol(), value_abs, value_assign, value_neg_p, value_notone_p, and value_notzero_p.

Referenced by changing2(), cutiteration(), igvoir(), is2(), and vzredundant().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inequaldivision()

static Value inequaldivision ( Pproblem  XX,
int  i 
)
static

return 0: all coefficients are null * otherwise gcd

is LHS empty?

2000

division by GCD

Definition at line 1191 of file isolve.c.

1192 { int j;
1193  Value gcd; /* return 0: all coefficients are null * otherwise gcd */
1194  if (value_zero_p(value_assign(gcd,pgcdseg(XX,i,1,NX)))) return(VALUE_ZERO); /* is LHS empty? */
1195  else if (value_gt(gcd,VALUE_ONE))
1196  { Value dp ;
1197  if (VISU>=ZVS) vznowstep(XX);
1198  if (VISU>=ZVI1)
1199  { if (VISU>=4) wvoir(XX); /* 2000 */
1200  fprintf(FTRACE," line %d: inequality $",i); symbol(XX,G(i));
1201  {fprintf(FTRACE," $ divided by gcd=");fprint_Value(FTRACE,gcd);fprintf(FTRACE,"\n");}
1202  if (VISU<ZVI3) fprintf(FTRACE,"\\\\\n");
1203  }
1204  if (value_assign(dp,DK(i))) value_assign(DK(i),cfloor(dp,gcd));
1205  for (j=NX ; j>=1 ; j--) value_division(AK(i,j),gcd); /* division by GCD */
1206  if (VISU>=ZVI3) w1voir(XX,i);
1207  }
1208  return(gcd);
1209 }
#define ZVI1
define ZVG3 3
Definition: iabrev.h:91
#define ZVI3
Definition: iabrev.h:92
static Value pgcdseg(Pproblem XX, int ik, int j1, int j2)
Definition: isolve.c:1182

References AK, cfloor(), DK, fprint_Value(), fprintf(), FTRACE, G, NX, pgcdseg(), symbol(), value_assign, value_division, value_gt, VALUE_ONE, VALUE_ZERO, value_zero_p, VISU, vznowstep(), w1voir(), wvoir(), ZVI1, ZVI3, and ZVS.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inevariable()

static int inevariable ( Pproblem  XX,
int  v 
)
static

Definition at line 1629 of file isolve.c.

1630 { return(v>NV+1 && v<NV+MC);
1631 }
#define MC
...............
Definition: iabrev.h:20

References MC, and NV.

Referenced by ajout(), computebounds(), lowbound(), majlowbounds(), and voirbornes().

+ Here is the caller graph for this function:

◆ inhibit()

static void inhibit ( Pproblem  XX,
int  in 
)
static

========================= PROCEDURES FOR FAST ===========================

Definition at line 1442 of file isolve.c.

1443 { permutel(XX,in,IC1++);
1444 }

References IC1, and permutel().

Referenced by fast().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_janus()

static int init_janus ( Pinitpb  II,
Pproblem  XX,
int  suit1 
)
static

ICOUT: ligne ou se trouve la fonction cout a optimiser; information indiquee par le step 1 (initialisations); en absence de cout, =0

111111111111111111111111 VERIFICATIONS INITIALISATIONS 11111111111111

equations a la fin, inequations m sens

erniere inequation

tepvoir(XX);

Definition at line 2396 of file isolve.c.

2397 { /* ICOUT: ligne ou se trouve la fonction cout a optimiser; information
2398  indiquee par le step 1 (initialisations); en absence de cout, =0 */
2399  /* 111111111111111111111111 VERIFICATIONS INITIALISATIONS 11111111111111 */
2400  NITER=0; TMAX=2*MC+NV; VRESULT=0 ; XX->nredun=0;
2401  if (VISU>=ZVS) fprintf(FTRACE, "\\begin{center} {\\bf ENTER INTEGER SOLVER} \\end{center}\n");
2402  if (MC>MAXLIGNES || NV>MAXCOLONNES) {
2403  if (VISU) fprintf(FTRACE,"entree: mc=%d maxl=%d --- nv=%d maxcol=%d\n",MC,MAXLIGNES,NV,MAXCOLONNES);
2404  return(VRDEB);
2405  }
2406  if (NP>NV) return(VRCAL) ;
2407  if (!suit1) {/* equations a la fin, inequations m sens */
2408  int i,j,i1,i2,ifi,ni,ii2,mf,ncou,Ei;
2409  NUMAX=NUMERO=NV+MC ; NX=NV; MX=MC; mf=ni=0 ; ncou=0; ICOUT=0; LASTFREE=0;//ii2=0;
2410  for (j=1 ; j<=NV ; j++) B(j)=j ;
2411  for (i=1 ; i<=MC ; i++) {
2412  Ei = E(i); //if (ii2!=0) fprintf(stderr,"Ei = %d, E(i) = %d, I->e[i] = %d",Ei,II.e(i),II.e[i]);//DNDB
2413  if (( abs(Ei)==2)||(Ei==3)) {
2414  ++mf; //number of function "cout" DN
2415  if (( abs(Ei) ==2)&&(++ncou>1)) {
2416  if (VISU>=ZVB) fprintf(FTRACE,"nombre de couts>1\n");
2417  return(VRCAL);
2418  }
2419  }
2420  else
2421  if (Ei!=0) {
2422  if (Ei!=1 && Ei!= -1) {
2423  if (VISU>=ZVB) fprintf(FTRACE,"! e[%3d]=%3d\n",i,Ei);
2424  return(VRCAL);
2425  }
2426 // if (ii2!=0) fprintf(stderr,"Ei danglefai+= %d",Ei);//DNDB
2427  ni++ ;//number of inequation DN
2428  }
2429  }//of for
2430  ii2=0;ifi=0;i1=mf;i2=mf+ni; IC1=mf+1; ii2=IC1-1+ni;/*derniere inequation*/
2431  NEGAL=MX-ii2;
2432  for (i=1 ; i<=MC ; i++) {
2433  int i3; i3=(abs(Ei=E(i))==2)? mf :(Ei==3)? ++ifi :(Ei) ? ++i1 :++i2;
2434  if (Ei== -1) {
2435  value_assign(DK(i3),value_uminus(D(i)));
2436  for (j=1; j<=NV; j++) value_assign(AK(i3,j),value_uminus(A(i,j)));
2437  } else {
2438  value_assign(DK(i3),value_uminus(D(i)));
2439  for (j=1; j<=NV; j++) value_assign(AK(i3,j),value_uminus(A(i,j)));
2440  }
2441  G(i3)=NV+i ;
2442  if (abs(Ei)==2) {
2443  ICOUT=i3; XX->minimum=(Ei==2);
2444  }
2445  }
2446  if (VISU) {
2447  VDUM=0;
2448  if (VISU>=ZVA1) fprintf(FTRACE," %d variables %d functions\
2449  %d inequalities %d equalities\\\\\n",NX,mf,ni,MC-ni-mf);
2450  if(VISU>=ZVA4) wvoir(XX); /*stepvoir(XX);*/
2451  }
2452 //fprintf(stderr,"\n DN %d %d %d %d %d %d %d %d %d %d",i,j,i1,i2,ifi,ni,ii2,mf,ncou,Ei); //DNDB
2453  } //of if suit1
2454  return(0);
2455 }
#define A(i, j)
comp_matrice.c
Definition: comp_matrice.c:63
#define ZVB
...............
Definition: iabrev.h:64
#define ZVA4
Definition: iabrev.h:72
#define ZVA1
initial problem
Definition: iabrev.h:71
#define VDUM
Definition: iabrev.h:151
#define D(A)
Definition: iabrev.h:56
#define LASTFREE
Definition: iabrev.h:148
#define E(A)
Definition: iabrev.h:57
#define MAXLIGNES
Definition: iproblem.h:54
#define VRCAL
Definition: iproblem.h:118
#define VRDEB
Definition: iproblem.h:117
#define MAXCOLONNES
(-) choix du pivot (simplexe primal)
Definition: iproblem.h:53
int nredun
Definition: iproblem.h:77
#define abs(v)
Definition: syntax-local.h:48

References A, abs, AK, B, D, DK, E, fprintf(), FTRACE, G, IC1, ICOUT, LASTFREE, MAXCOLONNES, MAXLIGNES, MC, problem::minimum, MX, NEGAL, NITER, NP, problem::nredun, NUMAX, NUMERO, NV, NX, TMAX, value_assign, value_uminus, VDUM, VISU, VRCAL, VRDEB, VRESULT, wvoir(), ZVA1, ZVA4, ZVB, and ZVS.

Referenced by isolve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ integerrealline()

static void integerrealline ( Pproblem  XX,
struct rproblem RR,
int  ii,
int  ir 
)
static

fprintf(FTRACE,"variable flottante=%14.7f dessus=%d dessous=%d\\\\\n", vf,dessus(vf),dessous(vf)); if (vf>0) testdessusdessous(XX,-vf); } void testsdessusdessous(Pproblem XX) { testdessusdessous(XX,0); testdessusdessous(XX,7.6543); testdessusdessous(XX,4.000002); testdessusdessous(XX,4.000001); testdessusdessous(XX,1.999995); testdessusdessous(XX,1.999999); } in case of test - end

Definition at line 384 of file isolve.c.

385 { int j;
386  RR->d[ir]=DK(ii); if (ir==0) RR->e[0]=XX->minimum ; else RR->e[ir]=1 ;
387  for (j=1 ; j<=NX ; j++) RR->a[ir][j]=AK(ii,j);
388  if (MSR>=7) RR->iname[NX+ir]=G(ii);
389 }

References AK, DK, G, problem::minimum, MSR, NX, and RR.

Referenced by integertoreal().

+ Here is the caller graph for this function:

◆ integertoreal()

static void integertoreal ( Pproblem  XX,
struct rproblem RR,
int  mini 
)
static

Definition at line 390 of file isolve.c.

391 { int i,j;
392  RR->nvar=NX; RR->mcontr=MX-IC1+1; RR->nvpos=RR->nvar; RR->copie=0;
393  RR->ntrace=XX->ntrac3; RR->meth=0; if (PRECR) RR->testp=0; else RR->testp=3;
394  RR->ftrace=FTRACE; RR->base=0; RR->cost=0; RR->rhs=0;
395  for (i=IC1 ; i<=MX ; i++) integerrealline(XX,RR,i,i+1-IC1);
396  if (ICOUT) integerrealline(XX,RR,ICOUT,0);
397  else
398  { RR->d[0]=0; if (mini==1) RR->e[0]=1 ; else
399  {RR->e[0]= -1 ;fprintf(FTRACE,"creation real mini %d\\\\\n",mini);
400  }
401  for (j=1 ; j<=NX ; j++) RR->a[0][j]=0;
402  }
403  if (mini<0) RR->e[0]= -1 ;
404  RR->state=0; if (MSR>=7) for (j=1 ; j<=NX ; j++) RR->iname[j]=B(j);
405 }
#define PRECR
Definition: iabrev.h:28
static void integerrealline(Pproblem XX, struct rproblem *RR, int ii, int ir)
fprintf(FTRACE,"variable flottante=%14.7f dessus=%d dessous=%d\\\\\n", vf,dessus(vf),...
Definition: isolve.c:384

References B, fprintf(), FTRACE, IC1, ICOUT, integerrealline(), MSR, MX, problem::ntrac3, NX, PRECR, and RR.

Referenced by localnewrsimplex(), phase1(), and phase2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ integrite()

static int integrite ( float  vf)
static

=======================================================================

FOR REAL SIMPLEX
=======================================================================

pss=0.000001;

Definition at line 356 of file isolve.c.

357 { int vi ; float vfp, epss; epss=0.00001; /*epss=0.000001;*/
358  if (vf<0) vfp= -vf ; else vfp= vf ;
359  vi=vfp+epss ;
360  if (vfp-vi<epss) return(1) ; return(0) ;
361 }

Referenced by dessus().

+ Here is the caller graph for this function:

◆ ipivotage()

static int ipivotage ( Pproblem  XX,
int  i1,
int  j1 
)
static

Definition at line 717 of file isolve.c.

718 { return ipivotage2(XX,i1,j1,1,MX,0);
719 }

References ipivotage2(), and MX.

Referenced by cutiteration(), is2(), and modifyconstr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipivotage2()

static int ipivotage2 ( Pproblem  XX,
int  i1,
int  j1,
int  ipiv1,
int  ipiv2,
int  vtu 
)
static

========================================================================

PIVOTING PROCEDURE
======================================================================== La matrice ak et les seconds membres dk sont entiers Le pivot est egal a 1 ou -1. le pivotage de la matrice s'effectue a partir de la ligne i1 et de la colonne j1. Les numeros de la variable d'ecart (basique) de la ligne i1, et de la variable independante (hors-base) de la colonne j1, contenus respectivement dans les tableaux g et b, sont permutes. Dans le cas de l'elimination d'une egalite, l'operation equivaut a chasser de la base une variable d'ecart identiquement nulle

variables travail

printf(stderr,"%d %d %d %d %d \n",i1,j1,ipiv1,ipiv2,vtu);

printf(stderr,"%d %d ",i,j);fprint_Value(stderr,pv);fprintf(stderr," "); fprint_Value(stderr,p2);fprintf(stderr," ");fprint_Value(stderr,p3);fprintf(stderr," "); fprint_Value(stderr,pd);fprintf(stderr," ");fprint_Value(stderr,pp);fprintf(stderr," "); fprint_Value(stderr,dn_tmp);fprintf(stderr," \n");

f(VISU)

0

0

printf(stderr,"ketthucipivotage2 :i %dj %d pv",i,j);fprint_Value(stderr,pv);fprintf(stderr," p2"); fprint_Value(stderr,p2);fprintf(stderr," p3");fprint_Value(stderr,p3);fprintf(stderr," pd"); fprint_Value(stderr,pd);fprintf(stderr," pp");fprint_Value(stderr,pp);fprintf(stderr," dn_tmp"); fprint_Value(stderr,dn_tmp);fprintf(stderr," \n");

Definition at line 604 of file isolve.c.

614 {
615  int i,j; /* variables travail */
616  Value pv,p2,p3,pd,pp,dn_tmp;
617 i = 0;j=0;
620 /*fprintf(stderr,"%d %d %d %d %d \n",i1,j1,ipiv1,ipiv2,vtu);*///DNDB
621 
622  if (NITER >=TMAX) return(VRESULT=VRINS);
623  if (DYN) dynam(XX,0);
624  NITER +=1; VRESULT=VRFIN;
625  if (vtu) value_assign(pv,XX->tturb[i1][j1]);
626  else { value_assign(pv,AK(i1,j1)); j=B(j1); B(j1)=G(i1); G(i1)=j ; }//DN
627 
628 /*fprintf(stderr,"%d %d ",i,j);fprint_Value(stderr,pv);fprintf(stderr," ");
629 fprint_Value(stderr,p2);fprintf(stderr," ");fprint_Value(stderr,p3);fprintf(stderr," ");
630 fprint_Value(stderr,pd);fprintf(stderr," ");fprint_Value(stderr,pp);fprintf(stderr," ");
631 fprint_Value(stderr,dn_tmp);fprintf(stderr," \n");*///DNDB
632 
633  if (value_notone_p(value_abs(pv)))
634  { /*if(VISU)*/
635  fprintf(FTRACE,"*** bug,pivot different +-1:");
636  fprint_Value(FTRACE,pv);fprintf(FTRACE,"\n");
637  return(VRESULT=VRBUG);
638  }
639  if (XX->turbo)
640  { if (vtu)
641  { for (i=ipiv1; i<=ipiv2; i++)
642  if (value_assign(p2,AK(i,j1))) { //p2 <> 0
643  if value_neg_p(pv) value_oppose(p2);
644 
645  //DK(i)-=XX->dturb[i1]*p2;
646  if value_notzero_p(XX->dturb[i1])
647  value_assign(dn_tmp,dn_multiply(XX->dturb[i1],p2));
648  else value_assign(dn_tmp,VALUE_ZERO);
649  value_substract(DK(i),dn_tmp);//DN
650 
651  for (j=1; j<=NX; j++)
652  if (j==j1) value_assign(AK(i,j),value_uminus(p2));
653  else if (value_assign(p3,XX->tturb[i1][j])) {
654  //AK(i,j)-=p2*p3;
655  if (value_assign(dn_tmp,dn_multiply(p2,p3))) value_substract(AK(i,j),dn_tmp);//DN
656  }
657  }
658  return(VRESULT=0);
659  }
660  for (i=ipiv1; i<=ipiv2; i++)
661  if (i != i1 && (value_assign(p2,AK(i,j1)))) {
662  if (value_neg_p(pv)) value_oppose(p2);
663  //DK(i)-=DK(i1)*p2 ;
664  if (value_assign(dn_tmp,dn_multiply(DK(i1),p2))) value_substract(DK(i1),dn_tmp);
665  for (j=1; j<=NX; j++)
666  if (j==j1) value_assign(AK(i,j),value_uminus(p2));
667  else if (value_assign(p3,AK(i1,j))) {
668  //AK(i,j)-=p2*p3;
669  if (value_assign(dn_tmp,dn_multiply(p2,p3))) value_substract(AK(i,j),dn_tmp);//DN
670  }
671  }
672  if (value_mone_p(pv))
673  { value_oppose(DK(i1));
674  for (j=1; j<=NX; j++)
675  if (j!=j1) value_oppose(AK(i1,j));
676  }
677  }
678  else
679  { for (i=ipiv1; i<=ipiv2; i++)
680  if ((value_assign(p2,AK(i,j1))) && i != i1)
681  { if (value_neg_p(pv)) value_oppose(p2);
682  if (value_assign(pd,DK(i1))) {
683  if (value_assign(pp,dn_multiply(pd,p2)))
684  { if (corrects(XX,DK(i),pp)==0) return(VRESULT=VROVF); value_substract(DK(i),pp);
685  }
686  else return(VRESULT=VROVF);
687  }
688  for (j=1 ; j<=NX ; j++) /*j0*/
689  if (j==j1) value_assign(AK(i,j),value_uminus(p2));
690  else if (value_notzero_p(AK(i1,j)))
691  { if (value_zero_p(value_assign(p3,correctm(XX,p2,AK(i1,j))))) return(VRESULT=VROVF);
692  if (corrects(XX,AK(i,j),value_uminus(p3))==0) return(VRESULT=VROVF);
693  value_substract(AK(i,j),p3);
694  }
695  }
696  if (value_mone_p(pv))
697  { value_oppose(DK(i1));
698  for (j=1 ; j<=NX ; j++) /*j0*/
699  if (j!=j1) value_oppose(AK(i1,j)) ;
700  }
701  }
702  if (VISU>=ZVP1)
703  { fprintf(FTRACE,"{\\bf iteration} %d: ",NITER);
704  fprintf(FTRACE,"pivot(%3d,%3d), ",i1,j1);
705  fprintf(FTRACE," variables $");
706  if (janus_egalite(XX,i1)) fprintf(FTRACE,"e_{%d}",B(j1));
707  else symbol(XX,B(j1));
708  fprintf(FTRACE,"$ - $"); symbol(XX,G(i1)); fprintf(FTRACE,"$\\\\\n");
709  if (VISU>=ZVP2) wvoir(XX) ;
710  }
711 /*fprintf(stderr,"ketthucipivotage2 :i %dj %d pv",i,j);fprint_Value(stderr,pv);fprintf(stderr," p2");
712 fprint_Value(stderr,p2);fprintf(stderr," p3");fprint_Value(stderr,p3);fprintf(stderr," pd");
713 fprint_Value(stderr,pd);fprintf(stderr," pp");fprint_Value(stderr,pp);fprintf(stderr," dn_tmp");
714 fprint_Value(stderr,dn_tmp);fprintf(stderr," \n");*///DNDB
715  return(VRESULT) ;
716 }
#define ZVP2
Definition: iabrev.h:68
#define ZVP1
Definition: iabrev.h:67
static Value correctm(Pproblem XX, Value k1, Value k2)
Definition: isolve.c:575
static int corrects(Pproblem XX, Value k1, Value k2)
Definition: isolve.c:589

References AK, B, correctm(), corrects(), DK, dn_multiply(), problem::dturb, DYN, dynam(), fprint_Value(), fprintf(), FTRACE, G, janus_egalite(), NITER, NX, symbol(), TMAX, problem::tturb, problem::turbo, value_abs, value_assign, value_mone_p, value_neg_p, value_notone_p, value_notzero_p, value_oppose, value_substract, value_uminus, VALUE_ZERO, value_zero_p, VISU, VRBUG, VRESULT, VRFIN, VRINS, VROVF, wvoir(), ZVP1, and ZVP2.

Referenced by cutiteration(), dualentier(), and ipivotage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ iprimal()

static int iprimal ( Pproblem  XX,
int  minimum,
int  i2,
int  stopcout 
)
static

static void voirfreq(Pproblem XX) /*****\/

{ int i; fprintf(FTRACE,"FREQUENCY:\\\\\n"); for (i=1 ; i<=NUMAX ; i++) if (XX->frequency[i]) fprintf(FTRACE,"frequence %d: %d\\\\\n",i,XX->frequency[i]); }

encore provisoire

very particular case, some variables are unconstrained

olution infinie

10/2/98

PPP9

Definition at line 1363 of file isolve.c.

1365 { int r,i,j,i1=0,j1=0,i3=0,bool1,lastit;
1366  float c1,c2,alpha=0,zeta ;
1367  Value pivot,lastdk,tet1,tet2;
1368 
1369  if (CRITERMAX) TMAX=(NX * CRITERMAX)+NITER;
1370  if (i2>=IC1 || !satisfait(XX)) { NUB=12; return(VRBUG);}
1371  if (VW6) fprintf(FTRACE,"Choix primal: %d (dual %d) iter %d $->$ %d",
1373  if (VISU)
1374  { vzphase(XX,3);
1375  if (minimum) fprintf(FTRACE," MIN"); else fprintf(FTRACE," MAX");
1376  {fprintf(FTRACE,"IMIZATION function line %d (current value: ",i2);
1377  fprint_Value(FTRACE,value_uminus(DK(i2)));fprintf(FTRACE,")\\\\\n");}
1378  if (VISU>=ZVBR3) wvoir(XX) ; /* encore provisoire */
1379  }
1380  if (NTP<NX) /* very particular case, some variables are unconstrained */
1381  { for (j=NX ; j>NTP ; j--)
1382  if (value_notzero_p(AK(i2,j)))
1383  { for (i=IC1 ; i<= MX ; i++)
1384  if (value_notzero_p(AK(i,j))) { NUB=14; return(VRBUG);}
1385  XX->jinfini=j; return(VRINF);
1386  }
1387  }
1388  value_assign(lastdk,DK(i2)); lastit=NITER; razfreq(XX);
1389  for (;;)
1390  { bool1=1; c1=0 ; value_assign(tet2,VALUE_ZERO);
1391  for (j=NX ; j>=1 ; j--)
1392  { if (value_neg_p(value_assign(tet1,(minimum) ? AK(i2,j) : value_uminus(AK(i2,j)))))
1393  { bool1=1;
1394  for (i=IC1 ; i<= MX ; i++)
1395  if (value_pos_p(AK(i,j)))
1396  { int selection;
1397  zeta = VALUE_TO_FLOAT(value_div(DK(i), AK(i,j))) ;
1398  if (CHOIXPRIM<=1) selection=(bool1||zeta<alpha);
1399  else selection=(bool1 || ((zeta>=1.0)&&(zeta<alpha))
1400  || ((zeta<1.0)&&(zeta>alpha))
1401  || ((zeta<1.0)&&(alpha>=1.0)) );
1402  if (selection)
1403  { bool1=0; alpha=zeta ; i3=i ; value_assign(pivot, AK(i,j));
1404  }
1405  }
1406  if (bool1) { XX->jinfini=j; return(VRINF);} /*solution infinie*/
1407  if (CHOIXPRIM==1) if (alpha<1.0) alpha=0; /* 10/2/98 */
1408  if (((c2=alpha*(VALUE_TO_FLOAT(tet1)))<c1) || (c2==c1) && (value_lt(tet1,tet2))) //float multiplied by Value
1409  { c1=c2 ; j1=j ; i1=i3 ; value_assign(tet2,tet1) ;
1410  }
1411  }
1412  }
1413  if (bool1) return(VRFIN);
1414  ++XX->frequency[G(i1)];
1415  if ((r=cutiteration(XX,i1,j1,0))) return(r); /* PPP9 */
1416  if (stopcout==9) return(stopcout);
1417  if (PMETH==9){localrsimplex(XX,1);fprintf(FTRACE,"(apres tou)\\\\\n");}
1418  if (value_ne(DK(i2),lastdk)) {
1419  if (VISU>=ZVPRI) {fprintf(FTRACE,"{\\bf iteration} %d improved cost value: ",NITER);
1420  fprint_Value(FTRACE,value_uminus(DK(i2)));fprintf(FTRACE,"\\\\\n");}
1421  value_assign(lastdk,DK(i2)); lastit=NITER; razfreq(XX);
1422  }
1423  if (stopcout && stopcout!=9)
1424  { if (value_posz_p(DK(i2))) return(10);
1425  for (i=i2+1; i< IC1 ; i++)
1426  if (value_posz_p(DK(i)))
1427  { razfreq(XX); return(11);
1428  }
1429  }
1430  }
1431 } /* fin iprimal ================================================ */
#define VALUE_TO_FLOAT(val)
#define NTP
Definition: iabrev.h:150
#define ZVPRI
primal
Definition: iabrev.h:125
#define CHOIXPRIM
Definition: iabrev.h:41
#define ZVBR3
Definition: iabrev.h:132
static void vzphase(Pproblem XX, int n)
Definition: isolve.c:37
static void razfreq(Pproblem XX)
fin dualentier
Definition: isolve.c:1355
int frequency[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:94

References AK, CHOIXPIV, CHOIXPRIM, CRITERMAX, cutiteration(), DK, fprint_Value(), fprintf(), problem::frequency, FTRACE, G, IC1, problem::jinfini, localrsimplex(), MX, NITER, NTP, NUB, NX, pivot(), PMETH, razfreq(), satisfait(), TMAX, value_assign, value_div, value_lt, value_ne, value_neg_p, value_notzero_p, value_pos_p, value_posz_p, VALUE_TO_FLOAT, value_uminus, VALUE_ZERO, VISU, VRBUG, VRFIN, VRINF, VW6, vzphase(), wvoir(), ZVBR3, and ZVPRI.

Referenced by fast(), iprimalplus(), and isolve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ iprimalplus()

static int iprimalplus ( Pproblem  XX,
struct rproblem RR,
int  minimum,
int  i2,
int  stopcout 
)
static

sss

s

f (XX->minimum)

descendant

ascendant. Par curiosite, si 5, ->inequation

MMM5

rovisoire

MMM5

MMM4

f(PMETH==8) XBUG(39);

esure cout step 1

Definition at line 2019 of file isolve.c.

2020 {
2021  int r,step,dispo;float rsr;
2022  Value bornesr,bornepai,bornea,solution;
2023  struct problem AYY,AZZ,AVV,AWW,*pty,*ptv,*ptw;
2024 
2025  vid(&AYY); vid(&AZZ); vid(&AVV); vid(&AWW); dispo=0; /*ssss*/ /*xs*/
2026  pty=&AYY;ptv=&AVV;ptw=&AWW; XX->state=0;if (copystructure(XX,&AZZ)) XBUG(46);
2027  if ((r=iprimal(XX,minimum,i2,stopcout))!=VRINS) return(r); value_assign(bornepai,DK(ICOUT));
2028  rsr=localrsimplex(XX,1);
2029  if (XX->minimum) value_assign(bornesr,dessous(rsr)); else value_assign(bornesr,dessus(rsr));
2030  if (VW2) {fprintf(FTRACE,"PRIMAL FAILS (%d ITER), possible integer values %13.6f $<$ ",NITER,-rsr);
2031  fprint_Value(FTRACE,value_uminus(bornesr));fprintf(FTRACE," $<=$ cost $<=$ ");
2033  value_assign(solution,bornepai); value_assign(bornea,bornesr); VRESULT=VRFIN; step=0;
2034  while (value_lt(solution,bornea)) {
2035  Value possible,expossible=VALUE_ZERO,typspl; ++step; /*if (XX->minimum)*/
2036 
2038  else if (PDICO==1 || (step==1&&PDICO==2)) value_assign(possible,value_div(value_plus(bornea,solution),2));
2039  else if (PDICO==3) value_assign(possible,value_plus(solution,VALUE_ONE)); /* descendant */
2041  else value_assign(possible,bornea); /* ascendant. Par curiosite, si 5, ->inequation */
2042 
2043  if ((value_eq(possible,bornea)) && (PDICO!=5)) typspl=0; else typspl=1;
2044  if (VW2) {fprintf(FTRACE,"dichoto%d NX=%d poss=",step,NX);fprint_Value(FTRACE,possible);fprintf(FTRACE,"\\\\\n");}
2045  ptw->marque=0; ptw->repere=11;
2046  if (dispo) { /*2MMM5*/
2047  if (pseudocopie(ptv,pty,(PMET2>=5 && (value_eq(possible,value_plus(solution,VALUE_ONE)))))) XBUG(47);
2048  findandmod(pty,G(1),(value_minus(possible,expossible)),1); /*provisoire*/
2049  if (VW4) wvoir(pty); vidr(RR); VRESULT=reducedpb(pty,ptw,RR);
2050  }
2051  else {
2052  if (copystructure(&AZZ,pty)) XBUG(48);
2053  vidr(RR); VRESULT=splitpb(pty,ptw,RR,0,ICOUT,possible,typspl);
2054  }
2055  if (VRESULT!=VRFIN&&VRESULT!=VRVID) return(VRESULT);
2056  if (PMET2>=4) { if(PMET2<7)if (!ptw->marque) XBUG(55);if (VIS2&&PMET2<7) wvoir(ptw);}
2058  else {
2059  if (pseudocopie(ptw,ptv,(PMET2>=5 && dispo))) XBUG(49); /*2MMM5*/
2060  if (PMET2>=4) {dispo=1; value_assign(expossible,possible); } /*2MMM4*/
2061  if (typspl==0) value_assign(solution,possible);
2062  else
2063  if (value_eq(value_assign(solution,pty->dk[1]),possible)) {
2064  if (VIS2) {
2067  XBUG(56);}
2068  else
2069  if (VW1) {
2070  fprintf(FTRACE," verified solution ");fprint_Value(FTRACE,value_uminus(possible));
2071  fprintf(FTRACE," improved solution ");fprint_Value(FTRACE,value_uminus(solution));
2072  fprintf(FTRACE," \\\\\n");
2073  }
2074  } /*if(PMETH==8) XBUG(39);*//*mesure cout step 1*/
2075  }
2076  if (VW1) {fprintf(FTRACE,"Final solution:");fprint_Value(FTRACE,value_uminus(solution));fprintf(FTRACE,"\\\\\n");}
2077  return(VRESULT);
2078 }
#define VIS2
Definition: iabrev.h:33
#define PDICO
Definition: iabrev.h:26
#define VW1
Definition: iabrev.h:42
static int findandmod(Pproblem XX, int v, Value k, int ineq)
Definition: isolve.c:1557
static int pseudocopie(Pproblem XX, Pproblem YY, int condition)
Definition: isolve.c:2012
static int possible(Pproblem XX, int j)
=======================================================================
Definition: isolve.c:828
static Value dessous(float vf)
Definition: isolve.c:368
int repere
Definition: iproblem.h:98
int marque
Definition: iproblem.h:98
void solution(Tableau *tp, int nvar, int nparm, Entier D)
Definition: traiter.c:188

References copystructure(), dessous(), dessus(), DK, problem::dk, findandmod(), fprint_Value(), fprintf(), FTRACE, G, ICOUT, iprimal(), localrsimplex(), problem::marque, problem::minimum, NITER, NX, PDICO, PMET2, possible(), pseudocopie(), reducedpb(), problem::repere, RR, solution(), splitpb(), problem::state, value_assign, value_div, value_eq, value_lt, value_minus, VALUE_ONE, value_plus, value_uminus, VALUE_ZERO, vid(), vidr(), VIS2, VRESULT, VRFIN, VRINS, VRVID, VW1, VW2, VW4, wvoir(), and XBUG.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is2()

static int is2 ( Pproblem  XX,
Pproblem  VV,
struct rproblem RR 
)
static

=======================================================================

MAIN PROCEDURE
=======================================================================

nlibre: information donnee par step 4 au step 5

nt forcer; forcer=(PFOURIER>3);

ICOUT: ligne ou se trouve la fonction cout a optimiser; information indiquee par le step 1 (initialisations); en absence de cout, =0

111111111111111111111111 VERIFICATIONS INITIALISATIONS 11111111111111

22222222222222222222 ELIMINATION EGALITES 22222222222222222222222222

equation surabondante ou incompatible

603

next line : t602

hoice of the equality with the smallest rhs

unimodular change of variables is necessary

equalities still remain

2323232323232323232323 INEQUALITIES DIVISION 23232323232323232323

3333333333333333333333 FOURIER-MOTZKIN trivial 33333333333333333333333

4444444444444444444 FOURIER-MOTZKIN - DUMMY ELIMINATIONS 4444444444444

rovisoire

***** pas de pivot unitaire possible

criteres F-M 1 et 2

dummy elimination

auvais


envisager traitement cas trivial NX==1

555555555555555 NON-NEGATIVE VARIABLES 55555555555555

regroupement des variables contraintes

rovisoire

segment libre est vide!

tres provisoire

5656565656565656 FOURIER ON CONSTRAINED VARIABLES 5656565656565656

f (freecolumn(XX,j))

66666666666666 VARIOUS REDUNDANT INEQUALITIES 666666666666666

66666666666666666 RESOLUTION SIMPLEXE ENTIERS phase 1 666666666666666666

777777777777777777 OPTIMISATION FONCTION COUT ENTIERE 777777777777777777

./shj p-6 ./shj p3-7

Definition at line 2158 of file isolve.c.

2159 {
2160  int nlibre; /* nlibre: information donnee par step 4 au step 5 */
2161  int prevnx,stfou; /*int forcer; forcer=(PFOURIER>3);*/
2162  /* ICOUT: ligne ou se trouve la fonction cout a optimiser; information
2163  indiquee par le step 1 (initialisations); en absence de cout, =0 */
2164  /* 111111111111111111111111 VERIFICATIONS INITIALISATIONS 11111111111111 */
2165  /* 22222222222222222222 ELIMINATION EGALITES 22222222222222222222222222 */
2166  nlibre =0; prevnx = 0; stfou = 0;
2167  if (VISU) if (NEGAL) vzstep(XX,1);
2168  while (NEGAL) {
2169  int r,ik=0,jk; Value pivot; {
2170  int i; Value dm = VALUE_MONE;
2171  for (i=MX ; i>=1 ; i--) if (janus_egalite(XX,i)) {
2172  int j; Value sk,de; value_assign(pivot,VALUE_ZERO);
2173  for (j=NX; j>=1; j--) { if (value_assign(sk,value_abs(AK(i,j))))
2174  if (value_one_p(value_assign(pivot,sk))) { ik=i; jk=j; break;}}
2175  if (value_zero_p(pivot)) /* equation surabondante ou incompatible */ {
2176  if (value_notzero_p(DK(i))) return(VRVID);
2177  if (VISU>=ZVEV) fprintf(FTRACE, "Equation $e_{%d}$ is empty.\\\\\n",G(i));
2178  retirer(XX,i); NEGAL-- ; break ; /*t603 */
2179  } /* next line : t602 */
2180  if (value_one_p(pivot)) break;
2181  if ((value_lt(value_assign(de,value_abs(DK(i))),dm))||(value_neg_p(dm))) {
2182  value_assign(dm,de); ik=i; /*choice of the equality with the smallest rhs*/
2183  }
2184  }
2185  }
2186  if (value_zero_p(pivot)) continue ;
2187  if (value_notone_p(pivot)) { /* unimodular change of variables is necessary */
2188  int jojo;
2189  if (gcdtest(XX,ik,&jk,&pivot,ZVG2)) return(VRVID);
2191  for (jojo=NX; jojo>=1; jojo--)
2192  if (value_one_p(value_abs(AK(ik,jojo)))) { jk=jojo; value_assign(pivot,VALUE_ONE); break;}
2193  if (value_notone_p(pivot)) if ((r=build0(XX,ik,1,&jk))) return(r);
2194  } else if (VISU>=ZVEV+1) fprintf(FTRACE,"Equation $e_{%d}$ includes a unitary coefficient.\\\\\n",G(ik));
2195  if (VISU>=ZVEV+1) igvoir3(XX,1,MX,1,ik,jk,0,0,0,0,0);
2196  if ((r=ipivotage(XX,ik,jk))) return(r);
2197  celimination(XX,jk);
2198  if (fluidline(XX,ik)) retirer(XX,ik); else permutel(XX,ik,MX+1-NEGAL);
2199  NEGAL-- ;
2200  }//of while
2201  if (NEGAL) XBUG(15); /* equalities still remain */
2202  /* 2323232323232323232323 INEQUALITIES DIVISION 23232323232323232323 */
2203  {
2204  int i; if (VISU) vznewstep(XX,2);
2205  for (i=IC1 ; i<=MX ; i++)
2206  { inequaldivision(XX,i); }
2207  }
2208  /* 3333333333333333333333 FOURIER-MOTZKIN trivial 33333333333333333333333 */
2209  if (PFOURIER) {
2210  int i,j; if (VISU) vznewstep(XX,3);
2211  for (j=NX ; j>=1 ; j--)
2212  if (freecolumn(XX,j))
2213  if (possible(XX,j)) {
2214  int tplus,tmoins; Value k; tplus= tmoins= 0 ;
2215  for (i=MX ; i>=IC1 ; i--)
2216  if (value_assign(k,AK(i,j))) {if (value_pos_p(k)) tplus++ ; else tmoins++ ;}
2217  if (tplus==0||tmoins==0) {
2218  if (tplus+tmoins) {
2219  fourier0(XX,j); if (!FORCER) if (ICOUT==0 && satisfait(XX)) return (VRFIN);
2220  } else { /* ********** colonne vide */
2221  if(VISU>=ZVFEC) vzemptycol(XX,j); emptycolelim(XX,j); }
2222  }
2223  }
2224  }
2225  /* 4444444444444444444 FOURIER-MOTZKIN - DUMMY ELIMINATIONS 4444444444444*/
2226  stfou=0;// fprintf(stderr,"%d %d %d\n",nlibre,prevnx,stfou);
2227  while (stfou==0 || (NX<prevnx && nlibre)) {
2228  int i=0,j=0;//DN
2229  prevnx = NX; nlibre=0 ; stfou++;
2230  {for (j=NX ; j>=1 ; j--)
2231  if (freecolumn(XX,j)) {
2232  int tplus,tmoins,ip1=0,im1=0,tp2,tm2,i1; Value sk,dkmin;
2233  tplus= tmoins= tp2= tm2=0 ; i1= -100000 ;
2234  value_assign(sk,VALUE_ZERO); value_assign(dkmin,int_to_value(1000000));
2235  for (i=MX ; i>=IC1 ; i--)
2236  if (value_notzero_p(AK(i,j))) {
2237  value_assign(sk,AK(i,j));
2238  if (value_pos_p(sk)) {
2239  tplus++ ;
2240  {if (value_one_p(sk)) {
2241  ip1= i ; if (value_lt(DK(i),dkmin)) { i1=i; value_assign(dkmin,DK(i)); }
2242  } else tp2++;}
2243  } else {
2244  tmoins++ ;
2245  {if (value_mone_p(sk)) {
2246  im1=i;if (value_lt(DK(i),dkmin)) {i1=i; value_assign(dkmin,DK(i)); }
2247  } else tm2++ ;}}
2248  }
2249  if (value_zero_p(sk)) /* ********** colonne vide */ {
2250  if (possible(XX,j)) {
2251  if (VISU>=ZVFEC) vzemptycol(XX,j); emptycolelim(XX,j);
2252  } else if (VISU>=ZVFW) fprintf(FTRACE,"****colonne%3d vide bloquee\n",j);/*provisoire*/
2253  } else {
2254  if (i1 < 0) { nlibre++ ; continue ; } /* ***** pas de pivot unitaire possible */
2255  if (possible(XX,j)) {
2256  if (!FORCER) if (ICOUT==0 && satisfait(XX)) return (VRFIN) ;
2257  if (PFOURIER>0)
2258  if (tplus==0||tmoins==0) { fourier0(XX,j); continue; }
2259  if (PFOURIER>1) {
2260  if (tp2==0||tm2==0) /* criteres F-M 1 et 2 */ {
2261  if (tplus==1&&tp2==0) {fourier1(XX,1,j,ip1); continue;}
2262  else if (tmoins==1 && tm2==0 ) { fourier1(XX, -1,j,im1); continue; }
2263  else if (PFOURIER>2 && tmoins==2 && tplus==2 ) { fourier22(XX,j) ; continue ; }}}
2264  }
2265  if (VARC) /* dummy elimination */ {
2266  if (VISU>2) fprintf(FTRACE,"Dummy elimination: ");
2267  if (ipivotage(XX,i1,j)) return(VRESULT) ; retirer(XX,i1) ;
2268  if (VISU>=ZVTS) wvoir(XX); /*mauvais*/
2269  } else nlibre++ ;
2270  }}
2271  }
2272  }
2273  /* ------------------------------- */
2274  if (!FORCER) if (ICOUT==0 && satisfait(XX)) return (VRFIN) ;
2275  if (NX==0 && (!satisfait(XX))) return(VRVID) ;
2276  /* envisager traitement cas trivial NX==1 */
2277  /* 555555555555555 NON-NEGATIVE VARIABLES 55555555555555 */
2278 // fprintf(stderr,"%d %d %d\n",nlibre,prevnx,stfou);//DNDB
2279  if (!nlibre) NTP=NX;
2280  else {
2281  int i,j;
2282  if (VISU) vzstep(XX,4);
2283  if (VARC<=2) /******** strategie simplexe *******/ {
2284  int jj=0,idk=0; Value dkn = VALUE_ZERO;
2285  NTP=0; /** regroupement des variables contraintes **/
2286  for (jj=1 ; jj<=NX ; jj++)
2287  if (!freecolumn(XX,jj)) permutec(XX,++NTP,jj);
2288  if (VISU>=ZVNPC) wvoir(XX);
2289  for (;;) {
2290  if (NTP==NX) break;
2291  if (!FORCER) if (ICOUT==0 && satisfait(XX)) return (VRFIN) ;
2292  // value_assign(dkn,VALUE_ZERO);
2293  value_assign(dkn,int_to_value(1000000)); /*provisoire*/
2294 // fprintf(stderr,"dkn = int_to_value(1000000) = ");fprint_Value(stderr,dkn);fprintf(stderr,"\n");//DNDB
2295  for (i=MX ; i>=IC1 ; i--)
2296  if (value_lt(DK(i),dkn)) { value_assign(dkn,DK(i)); idk=i; }
2297  jj=NTP+1;
2298  if (VISU>=ZVN1) {
2299  fprintf(FTRACE,"rhs=");fprint_Value(FTRACE,dkn);fprintf(FTRACE,", let us select inequality $y_{%d}$.\\\\\n",G(idk));
2300  }
2301  if (build1(XX,idk,jj) <0) { /* segment libre est vide! */
2302  int absent ; absent=1;
2303  if (VISU>=ZVN1) fprintf(FTRACE,"No non-zero coefficient!!\\\\\n");
2304  for (i=MX ; i>=IC1 ; i--)
2305  if ((absent||(value_lt(DK(i),dkn))) && jnsegment(XX,i,jj,NX)>=0) {
2306  value_assign(dkn,DK(i)); idk=i; absent=0;
2307  }
2308  if (absent) {
2309  if (VISU>=ZVNW) fprintf(FTRACE,"WARNING, all columns of free variables are empty\\\\\n");
2310  if (ICOUT==0) NX=NTP; break; }
2311  if (VISU>=ZVN1) fprintf(FTRACE,"Then, we select inequality $y_{%d}$.\\\\\n",G(idk));
2312  if (value_pos_p(dkn)) if (VISU>=ZVN2) fprintf(FTRACE,"WARNING SIMPLEX STRATEGY rhs positif\\\\\n");
2313  if (build1(XX,idk,jj) <0) XBUG(33);
2314  }
2315  ++NTP;
2316 // fprintf(stderr,"%d %d %d %d %d %d %d",nlibre,prevnx,stfou, i,j,jj,idk);fprint_Value(stderr,dkn);fprintf(stderr,"\n");//DNDB
2317  if ((i=cutiteration(XX,idk,jj,0))) return(i);
2318  }//of for
2319  } else if (VARC==3) { /********* variable unique *************/
2320  if (VISU>1) fprintf(FTRACE,"SINGLE ADDED VARIABLE\n");
2321  if (++NX>MAXNX) return(VRDEB) ;
2322  for (i=MX ; i>=1 ; i--) {
2323  Value temporaire ; value_assign(temporaire,VALUE_ZERO);
2324  for (j=1 ; j<NX ; j++) if (freecolumn(XX,j)) value_substract(temporaire, AK(i,j)) ;
2325  value_assign(AK(i,NX),temporaire);
2326  }
2327  B(NX)= NUMERO = ++NUMAX ; if (VISU>3) wvoir(XX) ;
2328  }
2329  else if (VARC>=4) {/******* variables libres doublees *******/
2330  for (j=NX ; j>=1 ; j--)
2331  if (freecolumn(XX,j)) {
2332  if (++NX>MAXNX) return(VRDEB); B(NX)=B(j) ; /* tres provisoire */
2333  for (i=MX; i>=1; i--) value_assign(AK(i,NX),value_uminus(AK(i,j)));
2334  }
2335  if (VISU) fprintf(FTRACE,"map: variables libres ont ete doublees \n");
2336  }
2337  }
2338  /* 5656565656565656 FOURIER ON CONSTRAINED VARIABLES 5656565656565656 */
2339  if (PFOURIER) {
2340  int i,j; if (VISU) vznewstep(XX,5);
2341  for (j=NX ; j>=1 ; j--)
2342  if (possible(XX,j)) { /*if (freecolumn(XX,j))*/
2343  int tplus,tmoins; Value k;
2344  tplus= tmoins= 0 ;
2345  for (i=MX ; i>=IC1 ; i--)
2346  if (value_assign(k,AK(i,j))) { if (value_pos_p(k)) tplus++ ; else tmoins++ ;}
2347  if (tplus==0) {
2348  if (VISU>=ZVS) vznowstep(XX);
2349  if (tplus+tmoins) { fourier0(XX,j); if(!FORCER) if (ICOUT==0 && satisfait(XX)) return(VRFIN);}
2350  else { if(VISU>=ZVFEC) vzemptycol(XX,j); emptycolelim(XX,j); } /* ********** colonne vide */
2351  }
2352  }
2353  }
2354  /* 66666666666666 VARIOUS REDUNDANT INEQUALITIES 666666666666666 */
2355  if (XX->remove) {
2356  int i,u,i1,i2,exmx; exmx=MX;
2357  if (VISU>=ZVS) vznewstep(XX,6);
2358  for (i=MX ; i>=IC1 ; i--) /******** empty lhs (left-hand side */
2359  if (emptylhs(XX,i)) {
2360  if (value_neg_p(DK(i))) return(VRVID); VREDUN(++NREDUN)=G(i);
2361  if(VISU>=ZVR1) vzredundant(XX,i,-1); retirer(XX,i);
2362  }
2363  for (i=MX ; i>=IC1 ; i--) /************ intrinsic redundancies */
2364  if (useless(XX,i)==1) {if (VISU>=ZVR1) vzredundant(XX,i,0); VREDUN(++NREDUN)=G(i);retirer(XX,i);}
2365  for (i1=MX ; i1>=IC1+1 ; i1--) /****** redundancies when comparison */
2366  for (i2=i1-1 ; i2>=IC1 ; i2--)
2367  if ((u=redundant(XX,i1,i2))) {
2368  if (VISU>=ZVR1) { int v; if (u==i1)v=i2;else v=i1; vzredundant(XX,u,v);}
2369  VREDUN(++NREDUN)=G(u); retirer(XX,u); break;
2370  }
2371  if ((VISU>=ZVR3) && MX<exmx) {
2372  fprintf(FTRACE,"%d redundant inequalities were removed\\\\",exmx-MX);
2373  wvoir(XX);
2374  }
2375  if (XX->nredun!=exmx-MX) XBUG(69);
2376  }
2377  /* 66666666666666666 RESOLUTION SIMPLEXE ENTIERS phase 1 666666666666666666 */
2378  {
2379  int r;
2380  if (satisfait(XX)) {
2381  r=VRFIN; if (VISU>=ZVS) fprintf(FTRACE,"{\\bf {*} PHASE: DUAL SIMPLEX} is unnecessary\\\\\n");
2382  } else {
2383  if (PMETH==MTDAI||PMETH==MTDI2) r=dualentier(XX);
2384  else r=fastplus(XX,VV,RR);
2385  }
2386  if ((r!=VRFIN) || !ICOUT) return(r);
2387  }
2388  /* 777777777777777777 OPTIMISATION FONCTION COUT ENTIERE 777777777777777777 */
2389  if (VW2) {
2390  fprintf(FTRACE,"Primal %d variables precr=%d comp=%d msr=%d dico=%d met3=%d met2=%d meth=%d - varc=%d choixpiv=%d crit=%d m8=%d\\\\\n",NX,PRECR,PCOMP,MSR,PDICO,PMET3,PMET2,PMETH,VARC,CHOIXPIV,CRITERMAX,REDON);
2391  wvoir(XX);
2392  }
2393 // fprintf(stderr,"%d %d %d\n",nlibre,prevnx,stfou);//DNDB
2394  return(iprimalplus(XX,RR,XX->minimum,ICOUT,0)); /* ./shj p-6 ./shj p3-7 */
2395 }
#define ZVR1
redundant inequalities
Definition: iabrev.h:114
#define ZVN2
Definition: iabrev.h:102
#define PFOURIER
Definition: iabrev.h:38
#define ZVTS
Definition: iabrev.h:69
#define VREDUN(A)
Definition: iabrev.h:143
#define ZVG2
define ZVE4 4
Definition: iabrev.h:88
#define ZVFEC
Definition: iabrev.h:97
#define FORCER
Definition: iabrev.h:37
#define ZVR3
Definition: iabrev.h:115
#define ZVNPC
Non-negative variables
Definition: iabrev.h:100
#define ZVN1
Definition: iabrev.h:101
#define NREDUN
Definition: iabrev.h:142
#define ZVFW
Definition: iabrev.h:98
#define ZVNW
Definition: iabrev.h:103
#define VARC
Definition: iabrev.h:36
#define MTDAI
Definition: iproblem.h:110
#define MAXNX
Definition: iproblem.h:55
static void fourier0(Pproblem XX, int j)
Definition: isolve.c:834
static Value inequaldivision(Pproblem XX, int i)
Definition: isolve.c:1191
static void vzemptycol(Pproblem XX, int j)
static void stepvoir(Pproblem XX) /**** acces pour mise au point janus *\/
Definition: isolve.c:279
static void vzredundant(Pproblem XX, int i, int i2)
Definition: isolve.c:283
static int gcdtest(Pproblem XX, int i, int *pj1, Value *ppivot, int viz)
=======================================================================
Definition: isolve.c:1213
static void vzstep(Pproblem XX, int n)
Definition: isolve.c:48
static int iprimalplus(Pproblem XX, struct rproblem *RR, int minimum, int i2, int stopcout)
Definition: isolve.c:2019
static int build1(Pproblem XX, int i1, int jj)
Definition: isolve.c:1065
static int redundant(Pproblem XX, int i1, int i2)
Definition: isolve.c:720
static void fourier1(Pproblem XX, int pn, int j, int ip1)
integer fourier elimination criterion and:
Definition: isolve.c:870
static int freecolumn(Pproblem XX, int j)
static int cutcolumn(Pproblem XX,int j) /*****************************\/
Definition: isolve.c:510
static int emptylhs(Pproblem XX, int i)
Definition: isolve.c:517
static int fastplus(Pproblem XX, Pproblem VV, struct rproblem *RR)
Definition: isolve.c:1988
static int useless(Pproblem XX, int i)
Definition: isolve.c:521
static void vznewstep(Pproblem XX, int n)
Definition: isolve.c:66
static void fourier22(Pproblem XX, int j)
fin fourier1
Definition: isolve.c:892

References AK, B, build0(), build1(), celimination(), CHOIXPIV, CRITERMAX, cutiteration(), DK, dualentier(), emptycolelim(), emptylhs(), fastplus(), fluidline(), FORCER, fourier0(), fourier1(), fourier22(), fprint_Value(), fprintf(), freecolumn(), FTRACE, G, gcdtest(), IC1, ICOUT, igvoir3(), inequaldivision(), int_to_value, ipivotage(), iprimalplus(), janus_egalite(), jnsegment(), MAXNX, problem::minimum, MSR, MTDAI, MTDI2, MX, NEGAL, NREDUN, problem::nredun, NTP, NUMAX, NUMERO, NX, PCOMP, PDICO, permutec(), permutel(), PFOURIER, pivot(), PMET2, PMET3, PMETH, possible(), PRECR, REDON, redundant(), problem::remove, retirer(), RR, satisfait(), useless(), value_abs, value_assign, value_lt, VALUE_MONE, value_mone_p, value_neg_p, value_notone_p, value_notzero_p, VALUE_ONE, value_one_p, value_pos_p, value_substract, value_uminus, VALUE_ZERO, value_zero_p, VARC, VISU, VRDEB, VREDUN, VRESULT, VRFIN, VRVID, VW2, vzemptycol(), vznewstep(), vznowstep(), vzredundant(), vzstep(), wvoir(), XBUG, ZVEV, ZVFEC, ZVFW, ZVG2, ZVN1, ZVN2, ZVNPC, ZVNW, ZVR1, ZVR3, ZVS, and ZVTS.

Referenced by isolve(), main(), reducedpb(), sc_cute_convex_hull(), splitpb(), and stencil8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isolve()

int isolve ( Pinitpb  II,
Pproblem  XX,
int  suite 
)

printf(FTRACE,"fourier=%d varc=%d choixpiv=%d forcer=%d\\\\\n", PFOURIER,VARC,CHOIXPIV,FORCER);

uit2=suite/10; suit1=suite-10*suit2;

f (su3) fprintf(FTRACE,"DEBUT ISOLVE icout=%d\\\\\n",ICOUT);

topcout

sss

Definition at line 2458 of file isolve.c.

2459 {
2460  struct problem AVV;struct rproblem ARR;int suit1,suit2,su3,su,r,stopc;
2461  vid(&AVV);vidr(&ARR);
2462  /*fprintf(FTRACE,"fourier=%d varc=%d choixpiv=%d forcer=%d\\\\\n",
2463  PFOURIER,VARC,CHOIXPIV,FORCER);*/
2464  if (DYN) dynam(XX,0);
2465  su3=suite/100; su=suite-100*su3; suit2=su/10; suit1=suite-10*suit2;
2466  /*suit2=suite/10; suit1=suite-10*suit2;*/
2467  /*if (su3) fprintf(FTRACE,"DEBUT ISOLVE icout=%d\\\\\n",ICOUT);*/
2468  if ((r=init_janus(II,XX,suit1))) return(r); stopc=0; if (su3) stopc=9;
2469  if (suit2) VRESULT=iprimal(XX,XX->minimum,ICOUT,stopc); /*stopcout*/
2470  else VRESULT=is2(XX,&AVV,&ARR); /*ssss*/
2471  if (VISU>=ZVL) vzlast(XX) ; return(VRESULT) ;
2472 }
#define ZVL
last
Definition: iabrev.h:127
static int init_janus(Pinitpb II, Pproblem XX, int suit1)
Definition: isolve.c:2396
static int is2(Pproblem XX, Pproblem VV, struct rproblem *RR)
=======================================================================
Definition: isolve.c:2158
define RMAXCOLONNES 800
Definition: rproblem.h:21

References DYN, dynam(), ICOUT, init_janus(), iprimal(), is2(), problem::minimum, vid(), vidr(), VISU, VRESULT, vzlast(), and ZVL.

Referenced by sc_janus_feasibility().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ janus_egalite()

static int janus_egalite ( Pproblem  XX,
int  i 
)
static

=========================================================================

PROCEDURES FOR INFORMATION ABOUT VARIABLES AND SYSTEM
=========================================================================

Definition at line 480 of file isolve.c.

481 { return(i>MX-NEGAL);
482 }

References MX, and NEGAL.

Referenced by igvoir3(), ipivotage2(), is2(), and vzcut().

+ Here is the caller graph for this function:

◆ jnsegment()

static int jnsegment ( Pproblem  XX,
int  ik,
int  j1,
int  j2 
)
static

ndique indice jk sur segment ligne ik tel que abs(coefficient)non nul, sinon renvoie -1

Definition at line 999 of file isolve.c.

1000 { /*indique indice jk sur segment ligne ik tel que abs(coefficient)non nul, sinon renvoie -1 */
1001  int j ;
1002  if (j1<=j2) {
1003  for (j=j1 ; j<=j2 ; j++) if (value_abs(AK(ik,j))) return(j);
1004  }else {
1005  for (j=j1 ; j>=j2 ; j--) if (value_abs(AK(ik,j))) return(j);}
1006  return(-1);
1007 }

References AK, and value_abs.

Referenced by build0(), build1(), and is2().

+ Here is the caller graph for this function:

◆ jsegment()

static int jsegment ( Pproblem  XX,
int  ik,
int  j1,
int  j2,
Value  p 
)
static

indique indice jk sur la ligne ik tel que abs(coefficient)==p , sinon renvoie -1

Definition at line 1008 of file isolve.c.

1009 { /* indique indice jk sur la ligne ik tel que abs(coefficient)==p , sinon renvoie -1 */
1010  int j ;
1011  for (j=j1 ; j<=j2 ; j++) if (value_eq(value_abs(AK(ik,j)),p)) return(j);
1012  return(-1);
1013 }

References AK, value_abs, and value_eq.

Referenced by build1().

+ Here is the caller graph for this function:

◆ listehb()

static void listehb ( Pproblem  XX,
struct rproblem RR 
)
static

Definition at line 1795 of file isolve.c.

1796 {
1797  int iv,c;
1798  for (iv=1; iv<=NUMAX ; iv++) if (dealtvariable(XX,iv)) if ((c=hb(RR,iv)))
1799  if (value_le(XX->ibound[iv],VALUE_ONE)) {fprintf(FTRACE," (%d):",c); symbold(XX,iv);}
1800  fprintf(FTRACE," hors-base possibles\\\\\n");
1801 }

References dealtvariable(), fprintf(), FTRACE, hb(), problem::ibound, NUMAX, RR, symbold(), value_le, and VALUE_ONE.

Referenced by failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ localnewrsimplex()

static float localnewrsimplex ( Pproblem  XX,
struct rproblem RR,
int  min 
)
static

printf(FTRACE,"Real dual simplex x[0]=%13.6f\\\\\n",vpara.x[0]);

f (VW6) fprintf(FTRACE,"REEL-PRIMAL:%13.6f \n",rrp);

X->itemp=rsr; XX->ftemp=RR->x[0]; * revoir

Definition at line 414 of file isolve.c.

415 { int rsr,rd=0; float rrd =0,rrp;
416  if (MSR==0)
417  { integertoreal(XX,RR,min); RR->meth=1; rd=realsimplex(RR); rrd=RR->x[0];
418  /*fprintf(FTRACE,"Real dual simplex x[0]=%13.6f\\\\\n",vpara.x[0]);*/
419  }
420  integertoreal(XX,RR,min); rsr=realsimplex(RR);
421  if (rsr) messrsimplex(XX,RR,rsr,1); rrp=RR->x[0];
422  /*if (VW6) fprintf(FTRACE,"REEL-PRIMAL:%13.6f \n",rrp);*/
423  if (MSR==0)
424  { if (rd!=rsr) fprintf(FTRACE,"DIVERGENCE DUAL:%d PRIMAL:%d\n",rd,rsr);
425  else if (VW6) fprintf(FTRACE,
426  "REEL DUAL:%13.6f PRIMAL:%13.6f ECART:%13.6f\n",rrd,rrp,rrd-rrp);
427  }
428  else if (VW6) fprintf(FTRACE,"REEL PRIMAL:%13.6f \n",rrp);
429  /*XX->itemp=rsr; XX->ftemp=RR->x[0]; * revoir */
430  return(RR->x[0]);
431 }
#define min(a, b)
static void integertoreal(Pproblem XX, struct rproblem *RR, int mini)
Definition: isolve.c:390
static void messrsimplex(Pproblem XX, struct rproblem *RR, int r, int ph)
Definition: isolve.c:406
int realsimplex(Prproblem RR)
Definition: r1.c:152

References fprintf(), FTRACE, integertoreal(), messrsimplex(), min, MSR, realsimplex(), RR, and VW6.

Referenced by localrsimplex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ localrsimplex()

static float localrsimplex ( Pproblem  XX,
int  min 
)
static

Definition at line 432 of file isolve.c.

433 { struct rproblem ARR; localnewrsimplex(XX,&ARR,min); return(ARR.x[0]);
434 }
static float localnewrsimplex(Pproblem XX, struct rproblem *RR, int min)
Definition: isolve.c:414

References localnewrsimplex(), min, and rproblem::x.

Referenced by cutiteration(), iprimal(), and iprimalplus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lowbound()

static int lowbound ( Pproblem  XX,
struct rproblem RR,
int  iv,
int  rvar,
int first,
float  epss 
)
static

remplacer par 7

Definition at line 1709 of file isolve.c.

1710 {
1711  Value range,r=VALUE_ZERO; float rrv;
1712  if(VW2&&inevariable(XX,iv)) fprintf(FTRACE,"examen fonc y%d\\\\\n",iv);
1713  if (MSR<6 || XX->ilbound[iv])
1714  { if (MSR>=7) if ((r=majlowbounds(XX,RR,1))) return(r);; /* remplacer par 7 */
1715  if ((r=phase2(XX,RR,rvar,-1))) return(r);
1716  rrv=RR->x[0]-epss; XX->rlbound[iv]=rrv; value_assign(XX->ilbound[iv],dessus(rrv));
1717  value_addto(XX->decrement,XX->ilbound[iv]);
1718  if(VW2&&inevariable(XX,iv)) fprintf(FTRACE,"calcul fonc y%d\\\\\n",iv);
1719  if(VW6||(VW2&&inevariable(XX,iv))) if (MSR>=6 && (value_zero_p(XX->ilbound[iv])))
1720  {symbold(XX,iv);fprintf(FTRACE," preuve basse par calcul\\\\\n"); };
1721  }
1722  rrv=XX->rbound[iv]; value_assign(range,value_minus(XX->ibound[iv],XX->ilbound[iv]));
1723  if(VW6) if (value_notzero_p(XX->ilbound[iv])){
1724  symbold(XX,iv); messrsimplex(XX,RR,r,2);
1725  fprintf(FTRACE," lbound = ");fprint_Value(FTRACE,XX->ilbound[iv]);fprintf(FTRACE," bound = ");
1727  if (value_zero_p(range)) {fprintf(FTRACE," {*} TILT {*} ");fprint_Value(FTRACE,XX->ibound[iv]);fprintf(FTRACE,"\\\\\n");}
1728  else if (value_neg_p(range)) fprintf(FTRACE," $->$ {*}{*} EMPTY {*}{*}\\\\\n");
1729  else fprintf(FTRACE,"\\\\\n");
1730  }
1731  if (value_neg_p(range)) return(VRVID); if (value_zero_p(range)) ++XX->tilt;
1732  if (dealtvariable(XX,iv))
1733  if (*first||rrv<XX->rrbest) { XX->rrbest=rrv; XX->vbest=iv; *first=0;}
1734  return(0);
1735 }
static int phase2(Pproblem XX, struct rproblem *RR, int rvar, int mini)
Definition: isolve.c:1614
struct _newgen_struct_range_ * range
Definition: message.h:21
float rbound[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:92
float rrbest
Definition: iproblem.h:100
float rlbound[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:93

References dealtvariable(), problem::decrement, dessus(), rproblem::epss, fprint_Value(), fprintf(), FTRACE, problem::ibound, problem::ilbound, inevariable(), majlowbounds(), messrsimplex(), MSR, phase2(), problem::rbound, problem::rlbound, RR, problem::rrbest, symbold(), problem::tilt, value_addto, value_assign, value_minus, value_neg_p, value_notzero_p, VALUE_ZERO, value_zero_p, problem::vbest, VRVID, VW2, and VW6.

Referenced by computebounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ majb()

static int majb ( Pproblem  XX,
Pproblem  UU,
struct rproblem RR 
)
static

MMM3

s

VRFIN)

s

Definition at line 1852 of file isolve.c.

1853 {
1854  if (PMET2>=3) {/*2MMM3*/
1855  if (majuu(XX,UU,RR)) XBUG(97); UU->state=1; /*xs*/
1856  if(VW4) { fprintf(FTRACE,"apres majuu: "); voirbornes(UU);}
1857  if (satisfait(UU)) { if (VW4) wvoir(UU); return(99); } /*(VRFIN)*/
1858  } else { copybound(XX,UU); UU->state=1;} /*xs*/
1859  return(0);
1860 }
static int majuu(Pproblem XX, Pproblem UU, struct rproblem *RR)
Definition: isolve.c:1838

References copybound(), fprintf(), FTRACE, majuu(), PMET2, RR, satisfait(), UU, voirbornes(), VW4, wvoir(), and XBUG.

Referenced by failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ majlowbounds()

static int majlowbounds ( Pproblem  XX,
struct rproblem RR,
int  ope 
)
static

static void etatfonctions(Pproblem XX)

{ int iv; if (!REDON) return; fprintf(FTRACE,"FONCTIONS "); /*sans info*\/ for (iv=1; iv<=NUMAX ; iv++) if (inevariable(XX,iv)) if (presence(XX,iv)) if (value_notzero_p(XX->ilbound[iv])) {symbold(XX,iv);fprintf(FTRACE,"(");fprint_Value(FTRACE,XX->ilbound[iv]);fprintf(FTRACE,") "); } fprintf(FTRACE,"\\\\\n"); }

mai1999

tatfonctions(XX);

mai1999

Definition at line 1640 of file isolve.c.

1641 { int i,j,iv; if (MSR<6) return(0);
1642  if (ope==0) {
1643  if(REDON)for(iv=1;iv<=NUMAX;iv++){
1644  value_assign(XX->ilbound[iv],VALUE_MONE);value_assign(XX->ibound[iv],100000);XX->utilb[iv]=-1;}
1645  else for (iv=1;iv<=NUMAX;iv++) if(dealtvariable(XX,iv))
1646  { value_assign(XX->ilbound[iv],VALUE_MONE); XX->utilb[iv]=-1; } /*6mai1999*/
1647  }
1648  else if (MSR<7)
1649  { for (i=IC1 ; i<=MX ; i++) if (dealtvariable(XX,iv=G(i)))
1650  if (recherche(RR,RR->nvar+i+1-IC1)>0) value_assign(XX->ilbound[iv],VALUE_ZERO);
1651  for (j=1 ; j<=NX ; j++) if (dealtvariable(XX,iv=B(j)))
1652  if (recherche(RR,j)>0) value_assign(XX->ilbound[iv],VALUE_ZERO);
1653  }
1654  else {
1655  for (j=1 ; j<=RR->nvar ; j++)
1656  if (dealtvariable(XX,iv=RR->iname[RR->b[j]])||REDON) {
1657  if(inevariable(XX,iv)) {
1658  if (value_pos_p(XX->ilbound[iv])) XBUG(85);
1659  else if(value_neg_p(XX->ilbound[iv])&&VW5) fprintf(FTRACE,"%d:HB ",iv);
1660  }
1661  value_assign(XX->ilbound[iv],VALUE_ZERO);
1662  } /*etatfonctions(XX);*/
1663  if (MSR>=9&&XX->state>0) /*6mai1999*/
1664  for (i=1; i<=RR->mcontr; i++)
1665  if (dealtvariable(XX,iv=RR->iname[RR->g[i]]))
1666  if (XX->utilb[iv])
1667  if (RR->x[RR->g[i]]>=XX->ibound[iv]) //comparison of float and Value. DN
1668  { XX->utilb[iv]=0;
1669  if(VW3) {fprintf(FTRACE,"y%d ancien ",iv);fprint_Value(FTRACE,XX->ibound[iv]);
1670  fprintf(FTRACE," actuel %13.6f\\\\\n",RR->x[RR->g[i]]);}
1671  }
1672  }
1673  return(0);
1674 }
static int recherche(struct rproblem *RR, int varia)
Definition: isolve.c:1582
int utilb[AKCOLONNES+1+AKLIGNES]
Definition: iproblem.h:91

References B, dealtvariable(), fprint_Value(), fprintf(), FTRACE, G, problem::ibound, IC1, problem::ilbound, inevariable(), MSR, MX, NUMAX, NX, recherche(), REDON, RR, problem::state, problem::utilb, value_assign, VALUE_MONE, value_neg_p, value_pos_p, VALUE_ZERO, VW3, VW5, and XBUG.

Referenced by computebounds(), lowbound(), and upperbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ majuu()

static int majuu ( Pproblem  XX,
Pproblem  UU,
struct rproblem RR 
)
static

Definition at line 1838 of file isolve.c.

1839 { int iv,ns; Value bl; ns=0;
1840  for (iv=1; iv<=NUMAX; iv++)
1841  if (dealtvariable(XX,iv)) {
1842  if (value_pos_p(value_assign(bl,XX->ilbound[iv]))) {
1843  if (VW4||(VW3&&MSR>=8)) {fprintf(FTRACE,"majuu, y%d=",iv);fprint_Value(FTRACE,bl);fprintf(FTRACE,"\\\\\n");}
1844  if (findandmod(UU,iv,bl,1)) XBUG(95); vidr(RR);
1845  }
1846  value_assign(UU->ibound[iv],value_minus(XX->ibound[iv],XX->ilbound[iv]));
1847  value_assign(UU->ilbound[iv],VALUE_ZERO);
1848  if (value_ge(UU->ibound[iv],2)) ++ns;
1849  }
1850  return(0);
1851 }
#define value_ge(v1, v2)

References dealtvariable(), findandmod(), fprint_Value(), fprintf(), FTRACE, problem::ibound, problem::ilbound, MSR, NUMAX, RR, UU, value_assign, value_ge, value_minus, value_pos_p, VALUE_ZERO, vidr(), VW3, VW4, and XBUG.

Referenced by majb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makecolumnfree()

static int makecolumnfree ( Pproblem  XX,
int  jx 
)
static

=========================================================================

PROCEDURE FOR REPLACING A CONSTRAINED VARIABLE BY A FREE VARIABLE
=========================================================================

Definition at line 743 of file isolve.c.

744 { if (freecolumn(XX,jx)) return(0);
745  if (cutvariable(XX,B(jx))) B(jx)= newfreevariable(XX);
746  else
747  { int jj; if (++MX >MAXMX) return(VRDEB); G(MX)= B(jx) ;
749  for (jj=1 ; jj<=NX ; jj++) value_assign(AK(MX,jj),VALUE_ZERO);
751  B(jx) = newfreevariable(XX);
752  if (VISU>=ZVVF)
753  { fprintf(FTRACE,
754  "constrained feature of column %2d is specified by an inequality:\n",jx);
755  w1voir(XX,MX);
756  }
757  }
758  return(0);
759 }
#define ZVVF
Variables status
Definition: iabrev.h:74
#define MAXMX
Definition: iproblem.h:56

References AK, B, cutvariable(), DK, fprintf(), freecolumn(), FTRACE, G, MAXMX, MX, newfreevariable(), NX, value_assign, VALUE_MONE, VALUE_ZERO, VISU, VRDEB, w1voir(), and ZVVF.

Referenced by build0().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ messrsimplex()

static void messrsimplex ( Pproblem  XX,
struct rproblem RR,
int  r,
int  ph 
)
static

Definition at line 406 of file isolve.c.

407  { if (!r) {fprintf(FTRACE," REEL-PHASE %d:%13.6f \n",ph,RR->x[0]); return; }
408  if(r==VRVID)fprintf(FTRACE,"(EMPTY)");
409  else if(r==2)fprintf(FTRACE,"(INFINI)");
410  else if(r==3)fprintf(FTRACE,"INSUF");
411  else if(r==8)fprintf(FTRACE,"(EPSILON)");
412  fprintf(FTRACE,"ANOMALIE PHASE %d REEL %d it=%d\\\\\n",ph,r,RR->iter);
413 }

References fprintf(), FTRACE, RR, and VRVID.

Referenced by localnewrsimplex(), lowbound(), phase2(), and upperbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyconstr()

static int modifyconstr ( Pproblem  XX,
int  jfixe,
int  ifixe,
Value  k,
int  ineq 
)
static

==0: celimination(XX,jfixe);

Definition at line 1539 of file isolve.c.

1540 { if (jfixe)
1541  { if (ineq)
1542  { int v; TMAX +=1;
1543  newcut(XX);v=G(MX);columntoline(XX,jfixe,MX);B(jfixe)=v;value_substract(DK(MX),k);
1544  if (ipivotage(XX,MX,jfixe)) XBUG(81);
1545  retirer(XX,MX); --NUMERO; if (VW5) wvoir(XX);
1546  }
1547  else addnonbasicbound(XX,jfixe,k,0); /*k==0: celimination(XX,jfixe);*/
1548  }
1549  else
1550  { value_substract(DK(ifixe),k);
1551  if (ifixe<IC1) { permutel(XX,ifixe,--IC1); permutel(XX,IC1,MX-NEGAL);}
1552  else permutel(XX,ifixe,MX-NEGAL);
1553  if (ineq==0) ++NEGAL;
1554  }
1555  return(0);
1556 }
static void columntoline(Pproblem XX, int js, int id)
Definition: isolve.c:1512

References addnonbasicbound(), B, columntoline(), DK, G, IC1, ipivotage(), MX, NEGAL, newcut(), NUMERO, permutel(), retirer(), TMAX, value_substract, VW5, wvoir(), and XBUG.

Referenced by findandmod(), and splitpb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newcut()

static int newcut ( Pproblem  XX)
static

Definition at line 1102 of file isolve.c.

1103 { if (++MX >MAXMX) return(VRDEB); G(MX)= ++NUMERO ; return(0);
1104 }

References G, MAXMX, MX, NUMERO, and VRDEB.

Referenced by addedbound(), addnonbasicbound(), cutiteration(), dualentier(), fast(), and modifyconstr().

+ Here is the caller graph for this function:

◆ newfreevariable()

static int newfreevariable ( Pproblem  XX)
static

Definition at line 539 of file isolve.c.

540 { return(--LASTFREE);
541 }

References LASTFREE.

Referenced by changing2(), and makecolumnfree().

+ Here is the caller graph for this function:

◆ oppositeline()

static void oppositeline ( Pproblem  XX,
int  io 
)
static

0

Definition at line 801 of file isolve.c.

802 { int j ;
803  value_oppose(DK(io));
804  for (j=1; j<=NX; j++) value_oppose(AK(io,j)) ; /*j0*/
805 }

References AK, DK, NX, and value_oppose.

Referenced by boundline().

+ Here is the caller graph for this function:

◆ permutec()

static void permutec ( Pproblem  XX,
int  j1,
int  j2 
)
static

columns j1 and j2 are permuted

0

Definition at line 780 of file isolve.c.

781 { if (j1 != j2) /* columns j1 and j2 are permuted */
782  { int i,dn_tmp;
783  Value vi;
784  dn_tmp=B(j1); B(j1)=B(j2) ; B(j2)=dn_tmp;
785  for (i=1 ; i<=MX ; i++) /*i0*/
786  { value_assign(vi,AK(i,j1)); value_assign(AK(i,j1),AK(i,j2)); value_assign(AK(i,j2),vi);
787  }
788  }
789 }

References AK, B, MX, and value_assign.

Referenced by build1(), and is2().

+ Here is the caller graph for this function:

◆ permutel()

static void permutel ( Pproblem  XX,
int  i1,
int  i2 
)
static

lines i1 and i2 are permuted

0

Definition at line 790 of file isolve.c.

791 { if (i1 != i2) /* lines i1 and i2 are permuted */
792  { int j,v;
793  Value vi;
794  v=G(i1) ; G(i1)=G(i2) ; G(i2)=v ;
795  value_assign(vi,DK(i1)); value_assign(DK(i1),DK(i2)); value_assign(DK(i2),vi);
796  for (j=1 ; j<=NX ; j++) /*j0*/
797  { value_assign(vi,AK(i1,j)); value_assign(AK(i1,j),AK(i2,j)); value_assign(AK(i2,j),vi);
798  }
799  }
800 }

References AK, DK, G, NX, and value_assign.

Referenced by boundline(), inhibit(), is2(), modifyconstr(), remettre(), and retirerineq().

+ Here is the caller graph for this function:

◆ pgcd2()

static Value pgcd2 ( Value  z1,
Value  z2 
)
static

fin fourier22

======================================================================= PROCEDURES FOR UNIMODULAR CHANGES OF VARIABLES
=======================================================================

retour 0 si z1==z2==0

Definition at line 956 of file isolve.c.

957 {
958  Value p,v,r;
960  while (value_notzero_p(v)) {
962  value_assign(p,v); value_assign(v,r);
963  }
964  return(p); /* retour 0 si z1==z2==0 */
965 }

References dn_multiply(), value_abs, value_assign, value_div, value_minus, and value_notzero_p.

Referenced by pgcdsegment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgcd2in()

static Value pgcd2in ( Value  z1,
Value  z2 
)
static

=======================================================================

INEQUALITY DIVISION
=======================================================================

retour 0 si z1==z2==0

Definition at line 1174 of file isolve.c.

1175 { Value p,v,r; value_assign(p,value_abs(z1)); value_assign(v,value_abs(z2));
1176  while (value_notzero_p(v))
1177  { value_assign(r,value_minus(p,dn_multiply(value_div(p,v),v)));
1178  value_assign(p,v);value_assign(v,r);
1179  }
1180  return(p); /* retour 0 si z1==z2==0 */
1181 }

References dn_multiply(), value_abs, value_assign, value_div, value_minus, and value_notzero_p.

Referenced by pgcdseg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgcdseg()

static Value pgcdseg ( Pproblem  XX,
int  ik,
int  j1,
int  j2 
)
static

return: 0 if all coefficients null - otherwise gcd

Definition at line 1182 of file isolve.c.

1183 { int j;
1184  Value aa, p;
1186  for (j=j1 ; j<=j2 ; j++)
1187  if (value_assign(aa,AK(ik,j)))
1188  if (value_one_p(value_assign(p,pgcd2in(p,aa)))) break;
1189  return(p); /* return: 0 if all coefficients null - otherwise gcd */
1190 }
static Value pgcd2in(Value z1, Value z2)
=======================================================================
Definition: isolve.c:1174

References AK, pgcd2in(), value_assign, value_one_p, and VALUE_ZERO.

Referenced by inequaldivision().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgcdsegment()

static Value pgcdsegment ( Pproblem  XX,
int  ik,
int  j1,
int  j2 
)
static

return: 0 if all coefficients null - otherwise gcd

Definition at line 1014 of file isolve.c.

1015 { int j;
1016  Value aa,p = VALUE_ZERO;
1017  for (j=j1 ; j<=j2 ; j++)
1018  if (value_assign(aa,AK(ik,j)))
1019  if (value_one_p(value_assign(p,pgcd2(p,aa)))) break;
1020  return(p); /* return: 0 if all coefficients null - otherwise gcd */
1021 }
static Value pgcd2(Value z1, Value z2)
fin fourier22
Definition: isolve.c:956

References AK, pgcd2(), value_assign, value_one_p, and VALUE_ZERO.

Referenced by build1(), and gcdtest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ phase1()

static int phase1 ( Pproblem  XX,
struct rproblem RR 
)
static

Definition at line 1610 of file isolve.c.

1611 { int r; integertoreal(XX,RR,1); razcoutr(RR,1);
1612  if (MSR>=5) RR->meth=1; r=realsimplex(RR); RR->meth=0; return(r);/*?*/
1613 }
static void razcoutr(struct rproblem *RR, int mini)
Definition: isolve.c:1588

References integertoreal(), MSR, razcoutr(), realsimplex(), and RR.

Referenced by computebounds(), failuresp(), and phase2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ phase2()

static int phase2 ( Pproblem  XX,
struct rproblem RR,
int  rvar,
int  mini 
)
static

repetee pour verifications

ntrouvable

Definition at line 1614 of file isolve.c.

1615 { int rsr;
1616  if (MSR<=2)
1617  { integertoreal(XX,RR,1); razcoutr(RR,1); if (MSR==1) RR->meth=1;
1618  preparephase2(XX,RR,rvar,mini,0);
1619  }
1620  else
1621  { if (MSR<=3) rsr=phase1(XX,RR); /* repetee pour verifications */
1622  if (preparephase2(XX,RR,rvar,mini,-1)==0) XBUG(51);/*introuvable*/
1623  }
1624  if ((rsr=realsimplex(RR))) if (VIS2) messrsimplex(XX,RR,rsr,2); return(rsr);
1625 }
static int preparephase2(Pproblem XX, struct rproblem *RR, int rvar, int mini, int kost)
Definition: isolve.c:1593

References integertoreal(), messrsimplex(), MSR, phase1(), preparephase2(), razcoutr(), realsimplex(), RR, VIS2, and XBUG.

Referenced by lowbound(), simbad(), and upperbound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ possible()

static int possible ( Pproblem  XX,
int  j 
)
static

=======================================================================

PROCEDURES FOR FOURIER-MOTZKIN
=======================================================================

Fourier-Motzkin should not spoil functions

Definition at line 828 of file isolve.c.

829 { int i; /** Fourier-Motzkin should not spoil functions ********/
830  for (i=1 ; i<IC1 ; i++)
831  if (value_notzero_p(AK(i,j))) return(0);
832  return(1) ;
833 }

References AK, IC1, and value_notzero_p.

Referenced by iprimalplus(), and is2().

+ Here is the caller graph for this function:

◆ preparephase2()

static int preparephase2 ( Pproblem  XX,
struct rproblem RR,
int  rvar,
int  mini,
int  kost 
)
static

Definition at line 1593 of file isolve.c.

1595 { int ir;
1596  if (kost== 0) { if (rvar<=RR->n) ir= rvar; else ir=RR->n-rvar; }
1597  else ir=recherche(RR,rvar);
1598  if (ir<0) copyrline(RR,-ir,0);
1599  else { razcoutr(RR,mini); RR->a[0][ir] = -1 ; };
1600  if (mini==1) RR->e[0]=1 ;
1601  else { RR->e[0]= -1 ; if (kost== -1) rinverse(RR,0); }
1602  if (kost== -1) {
1603  if (ir<0) {
1604  RR->inf[0]=RR->inf[-ir]; *(RR->pconor)=*(RR->pconor+RR->g[-ir]);
1605  } else {
1606  RR->inf[0]=0; *(RR->pconor)=*(RR->pconor+RR->b[ir]);
1607  }}
1608  RR->cost= kost; return(ir);
1609 }
static void copyrline(struct rproblem *RR, int is, int id)
Definition: isolve.c:1571
static void rinverse(struct rproblem *RR, int ir)
Definition: isolve.c:1577

References copyrline(), rproblem::n, razcoutr(), recherche(), rinverse(), and RR.

Referenced by phase2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ presence()

static int presence ( Pproblem  XX,
int  iv 
)
static

Definition at line 533 of file isolve.c.

534 { int i,j; XX->cu=0; XX->lu=0;
535  for (i=IC1 ; i<=MX ; i++) if (G(i)==iv) {XX->lu=i; return(-i);}
536  for (j=1 ; j<=NX ; j++) if (B(j)==iv) return(XX->cu=j);
537  return(0);
538 }
int cu
Definition: iproblem.h:98
int lu
Definition: iproblem.h:98

References B, problem::cu, G, IC1, problem::lu, MX, and NX.

Referenced by eclater(), findandmod(), and voirbornes().

+ Here is the caller graph for this function:

◆ pseudocopie()

static int pseudocopie ( Pproblem  XX,
Pproblem  YY,
int  condition 
)
static

Definition at line 2012 of file isolve.c.

2013 {
2014  Pproblem pt;
2015  if (XX->state<0) XBUG(42);
2016  if (condition) {pt=XX;XX=YY;YY=pt;} else if (copystructure(XX,YY)) XBUG(47);
2017  return(0);
2018 }

References copystructure(), problem::state, and XBUG.

Referenced by iprimalplus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ razcoutr()

static void razcoutr ( struct rproblem RR,
int  mini 
)
static

Definition at line 1588 of file isolve.c.

1589 { int j;
1590  RR->d[0]=0; if (mini==1) RR->e[0]=1 ; else RR->e[0]= -1 ;
1591  for (j=1 ; j<=RR->nvar ; j++) RR->a[0][j]=0;
1592 }

References RR.

Referenced by phase1(), phase2(), and preparephase2().

+ Here is the caller graph for this function:

◆ razcut()

static void razcut ( Pproblem  XX)
static

Definition at line 820 of file isolve.c.

821 { int i;
822  for (i=MX; i>=IC1; i--)
823  if (cutline(XX,i)) retirerineq(XX,i);
824 }

References cutline(), IC1, MX, and retirerineq().

Referenced by ajout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ razfreq()

static void razfreq ( Pproblem  XX)
static

fin dualentier

=======================================================================

Definition at line 1355 of file isolve.c.

1356 { int i; for (i=1 ; i<=NUMAX ; i++) XX->frequency[i]=0;
1357 }

References problem::frequency, and NUMAX.

Referenced by iprimal().

+ Here is the caller graph for this function:

◆ recherche()

static int recherche ( struct rproblem RR,
int  varia 
)
static

line

column

Definition at line 1582 of file isolve.c.

1583 { int i;
1584  for (i=1 ; i<=RR->m ; i++) if (RR->g[i]==varia) return(-i); /* line */
1585  for (i=1 ; i<=RR->n ; i++) if (RR->b[i]==varia) return(i); /* column */
1586  return(0);
1587 }

References RR.

Referenced by majlowbounds(), and preparephase2().

+ Here is the caller graph for this function:

◆ recup()

static int recup ( Pproblem  XX,
Pproblem  VV 
)
static

MMM4.

Definition at line 1936 of file isolve.c.

1937 { if (PMET2>=4) if (VV->marque==0)
1938  { if (copystructure(XX,VV)) XBUG(43); VV->marque=1;}
1939  return(0);
1940 }

References copystructure(), problem::marque, PMET2, and XBUG.

Referenced by eclater(), and failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reducedpb()

static int reducedpb ( Pproblem  XX,
Pproblem  VV,
struct rproblem RR 
)
static

Definition at line 1892 of file isolve.c.

1893 {
1894  ++VV->repere;
1895  if (VW2) {
1896  int tete,i;
1897  if (NV>10) tete=NV-NX; else tete=10-NX;
1898  for (i=1; i<=tete; i++) fprintf(FTRACE,"---");
1899  fprintf(FTRACE,"(%d Variables) REDUCED PROBLEM %d equa ",NX,NEGAL);
1900  for (i=MX+1-NEGAL; i<=MX; i++) symbold(XX,G(i));
1901  if (VW4) fprintf(FTRACE," repere %d\\\\\n",VV->repere);
1902  else fprintf(FTRACE,"\\\\\n"); if (VW5) wvoir(XX);
1903  }
1904  ICOUT=0; VRESULT=is2(XX,VV,RR,1) ;
1905  if (VIS2) if ((VRESULT!=VRFIN) && (VRESULT!=VRVID))
1906  fprintf(FTRACE,"DEAD reduced pb NX=%d NEGAL=%d vr=%d\\\\\n",NX,NEGAL,VRESULT);
1907  return(VRESULT) ;
1908 }

References fprintf(), FTRACE, G, ICOUT, is2(), MX, NEGAL, NV, NX, problem::repere, RR, symbold(), VIS2, VRESULT, VRFIN, VRVID, VW2, VW4, VW5, and wvoir().

Referenced by failure(), and iprimalplus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reduction()

static int reduction ( Pproblem  XX,
struct rproblem RR 
)
static

Definition at line 1941 of file isolve.c.

1942 {
1943  int iv; Value k; vidr(RR);
1944  for (iv=1; iv<= XX->numax; iv++) if (dealtvariable(XX,iv))
1945  if (value_eq((value_assign(k,XX->ibound[iv])),XX->ilbound[iv]))
1946  if (findandmod(XX,iv,k,0)) XBUG(98);
1947  return(ajout(XX));
1948 }

References ajout(), dealtvariable(), findandmod(), problem::ibound, problem::ilbound, problem::numax, RR, value_assign, value_eq, vidr(), and XBUG.

Referenced by failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redundant()

static int redundant ( Pproblem  XX,
int  i1,
int  i2 
)
static

Definition at line 720 of file isolve.c.

721 { int j;
722  Value a,s;
723  value_assign(s,value_minus(DK(i1),DK(i2)));
724  for (j=1; j<=NX; j++)
725  if (value_assign(a,value_minus(AK(i2,j),AK(i1,j))))
726  { if (cutvariable(XX,B(j))) return(0);
727  if (value_notzero_p(s))
728  { if (value_pos_p(s)) { if (value_neg_p(a)) return(0); }
729  else if (value_pos_p(a)) return(0);
730  }
731  else value_assign(s,a);
732  }
733  if (value_pos_p(s)) return(i1); else return(i2);
734 }

References rproblem::a, AK, B, cutvariable(), DK, NX, value_assign, value_minus, value_neg_p, value_notzero_p, and value_pos_p.

Referenced by chernikova(), DoRedundantsStatements(), is2(), remove_redundants(), and vertex_redundant_p().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remettre()

static void remettre ( Pproblem  XX,
int  in 
)
static

Definition at line 1445 of file isolve.c.

1446 { permutel(XX,in,IC1-1); IC1--;
1447 }

References IC1, and permutel().

Referenced by fast().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remise()

static int remise ( Pproblem  XX,
int  icf 
)
static

Definition at line 1448 of file isolve.c.

1449 { IC1=icf; retirer(XX,IC1);
1450 }

References IC1, and retirer().

Referenced by fast().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ retirer()

static void retirer ( Pproblem  XX,
int  i1 
)
static

line i1 is removed (and replaced by line MX)

0

Definition at line 806 of file isolve.c.

807 { if (i1 != MX) /* line i1 is removed (and replaced by line MX) */
808  { int j ;
809  value_assign(DK(i1),DK(MX)); G(i1)=G(MX);
810  for (j=1; j<=NX; j++) value_assign(AK(i1,j),AK(MX,j)); /*j0*/
811  }
812  --MX ;
813 }

References AK, DK, G, MX, NX, and value_assign.

Referenced by cutiteration(), fourier0(), fourier1(), is2(), modifyconstr(), remise(), and retirerineq().

+ Here is the caller graph for this function:

◆ retirerineq()

static void retirerineq ( Pproblem  XX,
int  i1 
)
static

static void badretirerineq(Pproblem XX,int i1) /***********************\/

{ if (NEGAL) permutel(XX,i1,MX-NEGAL); retirer(XX,MX-NEGAL); }

Definition at line 817 of file isolve.c.

818 { permutel(XX,i1,MX-NEGAL); retirer(XX,MX-NEGAL);
819 }

References MX, NEGAL, permutel(), and retirer().

Referenced by ajout(), and razcut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rinverse()

static void rinverse ( struct rproblem RR,
int  ir 
)
static

Definition at line 1577 of file isolve.c.

1578 { int j ;
1579  RR->d[ir]= - RR->d[ir] ;
1580  for (j=1 ; j<=RR->n ; j++) RR->a[ir][j] = - RR->a[ir][j] ;
1581 }

References RR.

Referenced by preparephase2().

+ Here is the caller graph for this function:

◆ satisfait()

static int satisfait ( Pproblem  XX)
static

inequalities, does a basic solution is obvious?

Definition at line 735 of file isolve.c.

736 { int i; /* inequalities, does a basic solution is obvious? */
737  for (i=MX; i>=IC1; i--) if (value_neg_p(DK(i))) return(0);
738  return(1) ;
739 }

References DK, IC1, MX, and value_neg_p.

Referenced by dualentier(), fast(), iprimal(), is2(), and majb().

+ Here is the caller graph for this function:

◆ splitpb()

static int splitpb ( Pproblem  XX,
Pproblem  VV,
struct rproblem RR,
int  jfixe,
int  ifixe,
Value  k,
int  ineq 
)
static

Definition at line 1909 of file isolve.c.

1910 {
1911  int vhb; ++VV->repere;
1912  if (VW2) {
1913  int tete,i,va;
1914  if (NV>10) tete = NV - NX; else tete = 10 - NX;
1915  for (i=1; i<=tete; i++) fprintf(FTRACE,"---");
1916  fprintf(FTRACE,"{.} (%d Variables) SPLIT PROBLEM ",NX);
1917  if (VW4) fprintf(FTRACE," repere %d ",VV->repere);
1918  if (jfixe) va = B(jfixe) ; else va = G(ifixe); fprintf(FTRACE,"$");symbol(XX,va);
1919  if (ineq) {fprintf(FTRACE,", cost <= ");fprint_Value(FTRACE,value_uminus(k));fprintf(FTRACE,"$\\\\\n");}
1920  else fprintf(FTRACE," = ");fprint_Value(FTRACE,k);fprintf(FTRACE,"$\\\\\n");
1921  }
1922  if (ineq) {
1923  copyline(XX,1,++MX); if (modifyconstr(XX,jfixe,MX,k,ineq)) XBUG(91);
1924  } else if (modifyconstr(XX,jfixe,ifixe,k,ineq)) XBUG(92);
1925  if (VW4&&(ineq||VW6)) wvoir(XX);
1926  if (MSR>=8&&RR->state==0) {
1927  if ((vhb=hb(RR,XX->vbest))) {
1928  if (RR->vc!=hb(RR,RR->namev)) XBUG(88);if (XX->vbest!=RR->namev) XBUG(89);
1929  } else if (VW3) fprintf(FTRACE,"NON, car basic:%d\\\\\n",XX->vbest);
1930  }
1931  ICOUT=0; VRESULT=is2(XX,VV,RR,1) ;
1932  if (VIS2) if (VRESULT!=VRFIN && VRESULT!=VRVID) {
1933  fprintf(FTRACE,"DEAD split pb NX=%d vr=%d k=",NX,VRESULT);fprint_Value(FTRACE,k);fprintf(FTRACE,"\\\\\n");}
1934  return(VRESULT) ;
1935 }

References B, copyline(), fprint_Value(), fprintf(), FTRACE, G, hb(), ICOUT, is2(), modifyconstr(), MSR, MX, NV, NX, problem::repere, RR, symbol(), value_uminus, problem::vbest, VIS2, VRESULT, VRFIN, VRVID, VW2, VW3, VW4, VW6, wvoir(), and XBUG.

Referenced by eclater(), and iprimalplus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ symbol()

static void symbol ( Pproblem  XX,
int  v 
)
static

N note: if use janus.c then not static DN.

static void tableauk(Pproblem XX,int j1,int j2)
{ int i,j,i00; i00=1 ; if (j1>NX) {fprintf(FTRACE," --- pas de colonne %d ----\n",j1); return; }; if (j2>NX) {fprintf(FTRACE," --- pas de colonne %d ----\n",j2); return; }; fprintf(FTRACE,"%d %d %d %d\n",NX,MX,NX,i00); for (i=i00 ; i<=MX ; i++ ) { fprintf(FTRACE,"1 "); if (j2>0) { for (j=1 ; j <= NX ; j++) { if (j==j1) fprint_Value(FTRACE,AK(i,j2)); else if (j==j2) fprint_Value(FTRACE,AK(i,j1)); else fprint_Value(FTRACE,AK(i,j)); /*if (j==j1) fprintf(FTRACE," %2d",AK(i,j2)); else if (j==j2) fprintf(FTRACE," %2d",AK(i,j1)); else fprintf(FTRACE," %2d",AK(i,j));DN*\/ } } else { for (j=1 ; j <= NX ; j++) if (j!=j1) fprint_Value(FTRACE,AK(i,j)); if (j1>0 && (j1 <= NX)) fprint_Value(FTRACE,AK(i,j1)); /*for (j=1 ; j <= NX ; j++) if (j!=j1) fprintf(FTRACE," %2d",AK(i,j)); if (j1>0 && (j1 <= NX)) fprintf(FTRACE," %2d",AK(i,j1));DN*\/ } fprint_Value(FTRACE,DK(i)); fprintf(FTRACE," \n"); /*fprintf(FTRACE," %3d\n",DK(i));DN*\/ } }

Definition at line 113 of file isolve.c.

114 { if (v>NUMAX) fprintf(FTRACE,"w") ;
115  else if (v<0) fprintf(FTRACE,"v") ;
116  else if (freevariable(XX,v)) fprintf(FTRACE,"x") ;
117  else fprintf(FTRACE,"y") ;
118  fprintf(FTRACE,"_{%d}",abs(v));
119 }

References abs, fprintf(), freevariable(), FTRACE, and NUMAX.

Referenced by coupe(), db_get_module_list_initial_order(), gfc2pips_code2instruction_(), igvoir3(), inequaldivision(), ipivotage2(), splitpb(), symbold(), term(), ucformula(), vzcut(), vzemptycol(), and vzunimod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ symbold()

static void symbold ( Pproblem  XX,
int  v 
)
static

Definition at line 120 of file isolve.c.

121 { fprintf(FTRACE,"$");symbol(XX,v);fprintf(FTRACE,"$");
122 }

References fprintf(), FTRACE, and symbol().

Referenced by ajout(), choose(), fast(), listehb(), lowbound(), reducedpb(), upperbound(), and voirbornes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tableau_janus()

void tableau_janus ( Pinitpb  II,
Pproblem  XX 
)

printf(FTRACE,"%%%4d",E(i)); for (j=1 ; j <= NV ; j++) fprintf(FTRACE," %2d",A(i,j)); fprintf(FTRACE," %3d\n",D(i));DN

printf(FTRACE," \\\\\n");

Definition at line 69 of file isolve.c.

70 { int i,j,i00; i00=1 ;
71  if (NV>100) return;
72  fprintf(FTRACE,"%%%d %d %d %d\n",NV,MC,NP,i00);
73  /*****fprintf(FTRACE,"%%%d %d %d %d\n",XX->nvar,XX->MCONTR,XX->NVPOS,i00);**/
74  for (i=i00 ; i<=MC ; i++ )
75  {
76  fprintf(FTRACE,"%%%4d",E(i));
77  for (j=1 ; j <= NV ; j++) fprint_Value(FTRACE,A(i,j));
78  fprint_Value(FTRACE,D(i)); fprintf(FTRACE," \n");
79  /*fprintf(FTRACE,"%%%4d",E(i));
80  for (j=1 ; j <= NV ; j++) fprintf(FTRACE," %2d",A(i,j));
81  fprintf(FTRACE," %3d\n",D(i));DN*/
82  }
83  /*fprintf(FTRACE," \\\\\n");*/
84 }

References A, D, E, fprint_Value(), fprintf(), FTRACE, MC, NP, and NV.

Referenced by sc_to_iproblem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ term()

static void term ( Pproblem  XX,
int  s,
Value  k,
int  x 
)
static

Definition at line 315 of file isolve.c.

316 { fprintf(FTRACE," &") ; if value_zero_p(k) return;
317  if value_neg_p(k) fprintf(FTRACE,"-"); else if (s) fprintf(FTRACE,"+");
319 }
static char * x
Definition: split_file.c:159

References fprint_Value(), fprintf(), FTRACE, symbol(), value_abs, value_neg_p, value_notone_p, value_zero_p, and x.

Referenced by di_polynome_var_subst_null(), monome_to_expression(), old_prototype_factorize(), polynome_scalar_add(), polynome_scalar_addition(), polynome_to_vecteur(), prototype_factorize(), prototype_var_subst(), ucformula(), and vecteur_mult().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ucformula()

static void ucformula ( Pproblem  XX,
Value  u1,
Value  u2,
int  v,
int  new1,
int  new2 
)
static

Definition at line 324 of file isolve.c.

325 { symbol(XX,v); fprintf(FTRACE,"=");
326  term(XX,0,u1,new1); term(XX,1,u2,new2); fprintf(FTRACE,"\\\\\n");
327 }
static void term(Pproblem XX, int s, Value k, int x)
Definition: isolve.c:315

References fprintf(), FTRACE, symbol(), and term().

Referenced by vzunimod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ upperbound()

static int upperbound ( Pproblem  XX,
struct rproblem RR,
int  iv,
int  rvar,
float  epss 
)
static

static int cutbounds(Pproblem XX,struct rproblem *RR,int iv, int rvar,float epss)

{
float rrv; int r; if (VW6) {fprintf(FTRACE,"bornes cut "); symbold(XX,iv);} if ((r=phase2(XX,RR,rvar,1))) return(r); rrv=RR->x[0]+epss; fprintf(FTRACE,"var [%d] max=%13.6f ",iv,rrv); if (rrv<1) fprintf(FTRACE," {*}CTILT {*}\\\\\n"); if ((r=phase2(XX,RR,rvar,-1))) return(r); rrv=RR->x[0]-epss; fprintf(FTRACE," min=%13.6f\\\\\n",rrv); return(0); }

Definition at line 1685 of file isolve.c.

1686 {
1687  float rrv; int r; Value dn_tmp;
1688  if (VW6) symbold(XX,iv);
1689  if(MSR>=7) if ((r=majlowbounds(XX,RR,1))) return(r);
1690  if (MSR>=9&&XX->state>0) {
1691  if(!XX->utilb[iv])
1692  {if (VW3) fprintf(FTRACE,"upper inutile y%d\\\\\n",iv); return(0);}
1693  else
1694  { XX->utilb[iv]=0;if (VW3) fprintf(FTRACE,"upper effectif y%d\\\\\n",iv);
1695  }}
1696  if ((r=phase2(XX,RR,rvar,1))) return(r);
1697  if (VW6) messrsimplex(XX,RR,r,2);
1698  rrv=RR->x[0]+epss; XX->rbound[iv]=rrv;//float to Value.DN
1699  //r=XX->ibound[iv]; XX->ibound[iv]=dessous(rrv);
1700  // XX->decrement += (r-XX->ibound[iv]);
1701  //r is used just like a temporary variable, replaced by dn_tmp
1702  value_assign(dn_tmp,XX->ibound[iv]); value_assign(XX->ibound[iv],dessous(rrv));
1703  value_addto(XX->decrement,value_minus(dn_tmp,XX->ibound[iv]));
1704  if(VW6) {
1705  if (value_lt(XX->ibound[iv],VALUE_ONE)) fprintf(FTRACE," {*} TILT {*}\\\\\n");
1706  else {fprintf(FTRACE," bound = ");fprint_Value(FTRACE,XX->ibound[iv]);fprintf(FTRACE,"\\\\\n");}}
1707  return(0);
1708 }

References problem::decrement, dessous(), rproblem::epss, fprint_Value(), fprintf(), FTRACE, problem::ibound, majlowbounds(), messrsimplex(), MSR, phase2(), problem::rbound, RR, problem::state, symbold(), problem::utilb, value_addto, value_assign, value_lt, value_minus, VALUE_ONE, VW3, and VW6.

Referenced by computebounds(), find_motif(), and xml_tiling().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ useless()

static int useless ( Pproblem  XX,
int  i 
)
static

Definition at line 521 of file isolve.c.

522 {
523  int j,w;
524  Value a;
525  w=1;
526  if value_neg_p(DK(i)) return(0);//DN
527  for (j=1; j<=NX; j++)
528  if (value_assign(a,AK(i,j)))
529  { if value_pos_p(a>0) return(0); if (cutvariable(XX,B(j))) w=2;
530  }
531  return(w);
532 }
if(!(yy_init))
Definition: genread_lex.c:1029
return(s1)

References rproblem::a, AK, B, cutvariable(), DK, NX, value_assign, value_neg_p, and value_pos_p.

Referenced by is2(), and partition_to_unstructured().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vid()

static void vid ( Pproblem  XX)
static

Definition at line 439 of file isolve.c.

440 { XX->state= -1;
441 }

References problem::state.

Referenced by eclater(), fastplus(), iprimalplus(), and isolve().

+ Here is the caller graph for this function:

◆ vidr()

static void vidr ( struct rproblem RR)
static

Definition at line 442 of file isolve.c.

443 { RR->state= -1;
444 }

References RR.

Referenced by eclater(), iprimalplus(), isolve(), majuu(), and reduction().

+ Here is the caller graph for this function:

◆ voirbornes()

static void voirbornes ( Pproblem  XX)
static

etour

Definition at line 1776 of file isolve.c.

1777 {
1778  int iv;
1779  for (iv=1; iv<=NUMAX ; iv++)
1780  if (dealtvariable(XX,iv)) {
1781  if (presence(XX,iv)) {
1782  symbold(XX,iv); fprintf(FTRACE,"(");
1783  if (value_notzero_p(XX->ilbound[iv])) {fprint_Value(FTRACE,XX->ilbound[iv]);fprintf(FTRACE," - ");}
1784  fprint_Value(FTRACE,XX->ibound[iv]);fprintf(FTRACE,") ");
1785  } else fprintf(FTRACE," .... ");}
1786  if (REDON){
1787  fprintf(FTRACE,"redondances: ");
1788  for (iv=1; iv<=NUMAX ; iv++) if (inevariable(XX,iv)) if (presence(XX,iv))
1789  if (value_notzero_p(XX->ilbound[iv])) {
1790  symbold(XX,iv); fprintf(FTRACE,"(");fprint_Value(FTRACE,XX->ilbound[iv]);fprintf(FTRACE,") - ");
1791  }
1792  }
1793  fprintf(FTRACE,"\\\\\n"); /*retour*/
1794 }

References dealtvariable(), fprint_Value(), fprintf(), FTRACE, problem::ibound, problem::ilbound, inevariable(), NUMAX, presence(), REDON, symbold(), and value_notzero_p.

Referenced by choose(), failuresp(), and majb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzcut()

static void vzcut ( Pproblem  XX,
int  i,
int  divisor,
int  i2 
)
static

static void symboldn(Pproblem XX,int v) /***************************\/

{ symbold(XX,v);fprintf(FTRACE,"\\\\\n"); }

f (line==1) symbol(XX,G(i)); else fprintf(FTRACE," cut") ;

0

Definition at line 126 of file isolve.c.

127 {
128  int line,j ;
129  if (NX>16) fprintf(FTRACE,"{\\scriptsize\n");
130  else if (NX>13) fprintf(FTRACE,"{\\footnotesize\n");
131  fprintf(FTRACE,"\\begin{center}\n");
132  fprintf(FTRACE,"\\fbox{$\n");
133  fprintf(FTRACE," \\begin{array}{rrrrrrrrrrrrrrrrrrrrrrrrr}\n");
134  for (line=1; line<=2; line++)
135  {
136  int s,nk;//unused ab
137  Value k;//DN
138  int fleche,carre,carre2; fleche=carre=carre2=0;
139  s=0; nk=0;
140  /*if (line==1) symbol(XX,G(i)); else fprintf(FTRACE," cut") ;*/
141  if (line==1) symbol(XX,G(i)); else symbol(XX,G(i2));
142  fprintf(FTRACE,":") ;
143  for ( j=1 ; j <= NX ; j++) /*j0*/
144  { int boite; boite=0;
145  if (value_assign(k,AK(i,j))) ++nk;
146  if (nk==17)
147  { nk=0; fprintf(FTRACE," \\\\ & \n") ;
148  }
149  if (( NX <= 24) || value_notzero_p(k) ) fprintf(FTRACE," &") ;
150  if value_notzero_p(k)
151  { if ((value_neg_p(k)) && (line==1)) fprintf(FTRACE,"-"); else if (s) fprintf(FTRACE,"+");
152  if (line==1)
154  }
155  else
156  {// fprintf(FTRACE,"\\lfloor%d/%d\\rfloor ",k,divisor) ;
157  fprintf(FTRACE,"\\lfloor");fprint_Value(FTRACE,k);fprintf(FTRACE,"/%d\\rfloor ",divisor) ;//DN_? divisor??
158  }
159  symbol(XX,B(j));
160  s=1;
161  }
162  if (boite)
163  { fprintf(FTRACE,"$}"); boite=0;
164  }
165  }
166  if ((i<IC1)||janus_egalite(XX,i)) fprintf(FTRACE,"=") ;
167  else fprintf(FTRACE,"\\leq") ;
168  //DN if (line==1) fprintf(FTRACE," & %3d \\\\\n",DK(i)) ;
169  // else fprintf(FTRACE," &\\lfloor%d/%d\\rfloor ",DK(i),divisor);
170  if (line==1) {fprintf(FTRACE," & \\\\\n");fprint_Value(FTRACE,DK(i));}
171  else {fprintf(FTRACE," &\\lfloor");fprint_Value(FTRACE,DK(i));fprintf(FTRACE,"/%d\\rfloor ",divisor);}
172  }
173  fprintf(FTRACE," \\end{array} \n") ;
174  fprintf(FTRACE,"$}\n");
175  fprintf(FTRACE,"\\end{center}\n");
176  if (NX>13) fprintf(FTRACE,"}\n");
177 }
static int line
FLEX_SCANNER.
Definition: scanner.c:852

References AK, B, DK, fprint_Value(), fprintf(), FTRACE, G, IC1, janus_egalite(), line, NX, symbol(), value_abs, value_assign, value_neg_p, value_notone_p, and value_notzero_p.

Referenced by coupe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzemptycol()

static void vzemptycol ( Pproblem  XX,
int  j 
)
static

static void stepvoir(Pproblem XX) /**** acces pour mise au point janus *\/

{
if (NV>100) {
int i,j; Value cab,cmax;//DN coeef max cmax = VALUE_ZERO; for ( i=1 ; i <= MX ; i++) for ( j=1 ; j <= NX ; j++) if (value_assign(cab,value_abs(AK(i,j)))) if value_gt(cab,cmax) value_assign(cmax,cab); {fprintf(FTRACE,"COEFFICIENT MAXIMUM=");fprint_Value(FTRACE,cmax);fprintf(FTRACE," \n");} return; }
wvoir(XX); /*i0*\/ }

Definition at line 279 of file isolve.c.

280 { fprintf(FTRACE,"empty column, variable $"); symbol(XX,B(j));
281  fprintf(FTRACE,"$\\\\\n");
282 }

References B, fprintf(), FTRACE, and symbol().

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzextgcd()

static void vzextgcd ( Pproblem  XX,
int  a1,
int  a2,
int  u1,
int  u2,
int  u3,
int  zvx 
)
static

Definition at line 299 of file isolve.c.

301 { if (VISU<zvx) return;
302  fprintf(FTRACE,"Let us compute vector ($\\alpha_1, \\alpha_2, \\alpha_3$)\
303  such that $%d \\alpha_1+ %d \\alpha_2=\\alpha_3=gcd(%d,%d)$\\\\\n",
304  a1,a2,a1,a2);
305  fprintf(FTRACE,"The Extended Euclid Algorithm gives:\
306  $\\alpha_1=%d$, $\\alpha_2=%d$, $\\alpha_3=%d$\\\\\n",u1,u2,u3);
307  fprintf(FTRACE,"Using values $\\alpha_1$,\
308  $\\alpha_2$, $%d/\\alpha_3$, $%d/\\alpha_3$, \n",a2,a1);
309 }

References fprintf(), FTRACE, and VISU.

Referenced by extgcd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzgcd()

static void vzgcd ( Pproblem  XX,
int  i,
int  gcd,
int  viz 
)
static

Definition at line 294 of file isolve.c.

295 { if (VISU>=viz) fprintf(FTRACE,
296  "* Polyedron proved empty by GCD test on ligne%3d gcd=%2d\\\\\n",i,gcd);
297  if (VISU>=viz+2) wvoir(XX);
298 }

References fprintf(), FTRACE, VISU, and wvoir().

Referenced by gcdtest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzlast()

static int vzlast ( Pproblem  XX)
static

=======================================================================

RESULT PROCEDURE
=======================================================================

Definition at line 2136 of file isolve.c.

2137 {
2138  if (VISU>=ZVL2) wvoir(XX); if (VISU>=ZVL2) fprintf(FTRACE,"******** ");
2139  if (VRESULT==VRVID) fprintf(FTRACE,"empty polyhedron");
2140  else if (VRESULT==VRBUG) fprintf(FTRACE,"bug programme %3d",NUB);
2141  else if (VRESULT==VRINF) fprintf(FTRACE,"solution infinie");
2142  else if (VRESULT==VRFIN) fprintf(FTRACE,"integer solution");
2143  else
2144  if (VRESULT==VRDEB) {
2145  fprintf(FTRACE,"debordement tableaux ");
2146  if (MX >MAXMX) fprintf(FTRACE," line MX=%4d\n",MX);
2147  else fprintf(FTRACE," column NX=%4d\n",NX);
2148  } else if (VRESULT==VRINS) fprintf(FTRACE,"trop de pivotages");
2149  else if (VRESULT==VROVF) fprintf(FTRACE,"overflow");
2150  else if (VRESULT==VRCAL) fprintf(FTRACE,"appel errone **");
2151  else fprintf(FTRACE,"bug message * result=%5d",VRESULT);
2152  fprintf(FTRACE," after %d iterations\\\\\n",NITER) ;
2153  return 0;
2154 }
#define ZVL2
Definition: iabrev.h:128

References fprintf(), FTRACE, MAXMX, MX, NITER, NUB, NX, VISU, VRBUG, VRCAL, VRDEB, VRESULT, VRFIN, VRINF, VRINS, VROVF, VRVID, wvoir(), and ZVL2.

Referenced by fast(), fastplus(), and isolve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vznewstep()

static void vznewstep ( Pproblem  XX,
int  n 
)
static

Definition at line 66 of file isolve.c.

67 { NSTEP=n; MAJSTEP=0;
68 }
#define NSTEP
...............
Definition: iabrev.h:135
#define MAJSTEP
Definition: iabrev.h:136

References MAJSTEP, and NSTEP.

Referenced by is2().

+ Here is the caller graph for this function:

◆ vznowstep()

static void vznowstep ( Pproblem  XX)
static

Definition at line 62 of file isolve.c.

63 { if (MAJSTEP) return;
64  vzstep(XX,NSTEP); MAJSTEP=1;
65 }

References MAJSTEP, NSTEP, and vzstep().

Referenced by fourier0(), fourier1(), fourier22(), inequaldivision(), is2(), and vzredundant().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzphase()

static void vzphase ( Pproblem  XX,
int  n 
)
static

Definition at line 37 of file isolve.c.

38 {
39  if (VISU>=ZVS)
40  {
41  fprintf(FTRACE,"{\\bf{*} PHASE: ");
42  if (n==1) fprintf(FTRACE,"PRE-PROCESSING PHASE");
43  else if (n==2)fprintf(FTRACE,"DUAL SIMPLEX");
44  else if (n==3)fprintf(FTRACE,"PRIMAL SIMPLEX");
45  fprintf(FTRACE,"}\\\\\n");
46  }
47 }

References fprintf(), FTRACE, VISU, and ZVS.

Referenced by iprimal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzredundant()

static void vzredundant ( Pproblem  XX,
int  i,
int  i2 
)
static

Definition at line 283 of file isolve.c.

284 { if (VISU>=ZVS) vznowstep(XX);
285  if(VISU>=ZVR1)
286  {
287  if(i2<0) fprintf(FTRACE," empty inequality $y_{%d}$\\\\",G(i));
288  else if(i2==0) fprintf(FTRACE," useless inequality $y_{%d}$\\\\",G(i));
289  else fprintf(FTRACE,
290  " redundant inequality $y_{%d}$ compared with $y_{%d}$\\\\\n",G(i),G(i2));
291  if(VISU>=ZVR4) igvoir3(XX,1,MX,0,0,0,0,0,0,1,i);
292  }
293 }
#define ZVR4
Definition: iabrev.h:116

References fprintf(), FTRACE, G, igvoir3(), MX, VISU, vznowstep(), ZVR1, ZVR4, and ZVS.

Referenced by is2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzstep()

static void vzstep ( Pproblem  XX,
int  n 
)
static

Definition at line 48 of file isolve.c.

49 {
50  if (VISU>=ZVS)
51  {
52  fprintf(FTRACE,"{\\bf STEP %d: ",n);
53  if (n==1) fprintf(FTRACE,"EQUALITIES ELIMINATION");
54  else if (n==2)fprintf(FTRACE,"INEQUALITIES DIVISION");
55  else if (n==3)fprintf(FTRACE,"FOURIER-MOTZKIN");
56  else if (n==4)fprintf(FTRACE,"NON-NEGATIVE VARIABLES");
57  else if (n==5)fprintf(FTRACE,"FOURIER-MOTZKIN on CONSTRAINED VARIABLES");
58  else if (n==6) fprintf(FTRACE,"REDUNDANT INEQUALITIES");
59  fprintf(FTRACE,"}\\\\\n");
60  }
61 }

References fprintf(), FTRACE, VISU, and ZVS.

Referenced by is2(), and vznowstep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vzunimod()

static void vzunimod ( Pproblem  XX,
Value  u1,
Value  u2,
int  u3,
int  za,
int  zb,
int  old1,
int  old2,
int  new1,
int  new2 
)
static

Definition at line 330 of file isolve.c.

332 { if (VISU>=ZVU1+2)
333  { if (VISU<ZVU1+3)
334  { if (VDUM++) fprintf(FTRACE,"As in a previous step,\n");
335  else fprintf(FTRACE,"After applying the Extended Euclid Algorithm \
336 to the coefficients of both variables,\n");
337  }
338  fprintf(FTRACE," we can perform a unimodular change:\n");
339  fprintf(FTRACE,"\\[ \\left\\{ \\begin{array}{rrrr} \n");
340  ucformula(XX,u1,-zb/u3,old1,new1,new2);
341  ucformula(XX,u2,za/u3,old2,new1,new2);
342  fprintf(FTRACE,"\\end{array} \\right. \\]\n");
343  }
344  else if (VISU>=ZVU1)
345  { fprintf(FTRACE,"unimodular change $");
346  symbol(XX,old1); fprintf(FTRACE,", "); symbol(XX,old2);
347  fprintf(FTRACE," \\Rightarrow ");
348  symbol(XX,new1); fprintf(FTRACE,", ");
349  symbol(XX,new2); fprintf(FTRACE,"$\\\\\n");
350  }
351  if (VISU>=ZVU1+5) wvoir(XX);
352 }
static void ucformula(Pproblem XX, Value u1, Value u2, int v, int new1, int new2)
Definition: isolve.c:324

References fprintf(), FTRACE, symbol(), ucformula(), VDUM, VISU, wvoir(), and ZVU1.

Referenced by changing2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ w1voir()

static void w1voir ( Pproblem  XX,
int  ix 
)
static

fin igvoir

Definition at line 245 of file isolve.c.

246 { igvoir(XX,ix,ix); /******* print line ak (ix) + dk (ix) */
247 }

References igvoir().

Referenced by coupe(), inequaldivision(), and makecolumnfree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wvoir()

static void wvoir ( Pproblem  XX)
static

tatic void wvoir(Pproblem XX)

0

Definition at line 249 of file isolve.c.

250 {
251  if (NV>100) {
252  int i,j;
253  Value cab,cmax;//DN coeef max
254  cmax = VALUE_ZERO;
255  for ( i=1 ; i <= MX ; i++)
256  for ( j=1 ; j <= NX ; j++)
257  if (value_assign(cab,value_abs(AK(i,j))))
258  if value_gt(cab,cmax) value_assign(cmax,cab);
259  {fprintf(FTRACE,"COEFFICIENT MAXIMUM=");fprint_Value(FTRACE,cmax);fprintf(FTRACE," \n");}
260  return;
261  }
262  igvoir(XX,1,MX); /*i0*/
263 }

References AK, fprint_Value(), fprintf(), FTRACE, igvoir(), MX, NV, NX, value_abs, value_assign, value_gt, and VALUE_ZERO.

Referenced by ajout(), cutiteration(), dualentier(), dynam(), failuresp(), fast(), fastplus(), fourier0(), fourier1(), fourier22(), inequaldivision(), init_janus(), ipivotage2(), iprimal(), iprimalplus(), is2(), majb(), modifyconstr(), reducedpb(), splitpb(), vzgcd(), vzlast(), and vzunimod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xbug()

static int xbug ( Pproblem  XX,
int  nu 
)
static

=========================================================================

SIMPLEXE for integer variables
ALL-INTEGER METHODS
Jean Claude SOGNO
Projet CHLOE – INRIA ROCQUENCOURT
Juin 1994
========================================================================= ========================================================================= Duong NGUYEN QUE
Adaption to abstract computation: janusvalue
CRI-ENSMP
========================================================================= ============================================================== PROCEDURES for printing computation information
==============================================================

Definition at line 29 of file isolve.c.

30 { printf("DIRECT xBug=%d Pmeth=%d Pmet2=%d Pmet3=%d\\\\\n",
31  nu,PMETH,PMET2,PMET3);
32  if (VISU||VIS2) fprintf(FTRACE,"xBug=%d\\\\\n",nu); return(VRBUG);
33 }

References fprintf(), FTRACE, PMET2, PMET3, PMETH, printf(), VIS2, VISU, and VRBUG.

+ Here is the call graph for this function:

◆ xdeb()

static int xdeb ( Pproblem  XX,
int  nu 
)
static

Definition at line 34 of file isolve.c.

35 { if (VISU||VIS2) fprintf(FTRACE,"xDeb=%d\\\\\n",nu); return(VRDEB);
36 }

References fprintf(), FTRACE, VIS2, VISU, and VRDEB.

+ Here is the call graph for this function: