[Coin-lpsolver] FW: CBC constant sorted list

William H. Patton pattonwh at comcast.net
Tue Oct 23 20:20:19 EDT 2007


John,

I am willing to help with the replacements of literal constants
with named constants or parameters.
I see that the float issue in CbcFathomDynamicProgramming was
resolved by moving to doubles on 10/14/2007 in trunk.

I think the first step is named constants like the example in
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(161)
I do like the names in \CoinUtils\src\CoinIndexedVector.hpp(20):
#define COIN_INDEXED_REALLY_TINY_ELEMENT 1.0e-100

I think next Saturday I will write a small program to generate the
sorted list for the clp/ subtree of constants about 1800
occurances.

As you can see, I thought I replied last Saturday but I pulled the
wrong address to paste.

William

________________________________________
From: William H. Patton [mailto:pattonwh at comcast.net] 
Sent: Saturday, October 20, 2007 8:47 PM
To: 'coin-lpsolver-bounces at list.coin-or.org'
Subject: CBC constant sorted list

John,

Attached is the list of constants in the CBC trunk src directory
as of 10/19/2007. I think subversion showed me a last change of
10/14.

Found 824 occurrence(s) in 33 file(s)   about 35 exponents and 8
non 1 mantissas
  approximate counts of occurances after \  in the list       
  e-5 just beats e20 in popularity with about 100 each.

Due to some overlap in functional meaning on some of the
constants, I would guess you need to invent 50 names You might cut
that in half if you can pool pairs of exponents

I think the safe next step is to use #define   name   value for
some of the easy unambiguous values.
Well, my c++style book says better to use const double name for
type safety in some included class.
Then I can do global search and replace the values with these
names. 
I expect subversion can then generate patch files to send to you?

Next would be container classes with initializers in the
constructors.
This would prepare for adding the get and set API functions to
these classes.  I will look for some examples in the cion code
tree.

I just looked in Clp src  : Found 1817 occurrence(s) in 49
file(s).

It looks like CbcOrClpParam.cpp is where this is headed. I will
try to understand it.

Vol\src\VolVolume.hpp(403): double eps = 1.e-3  
Is easier to understand
   This class contains the parameters controlling the Volume
Algorithm 
*/
struct VOL_parms {
   /** initial value of
Vol\src\VolVolume.hpp(403): double eps = 1.e-3  


Clp\src\Idiot.hpp(91): default 1.0e-4 */   sample get set pairs

Otherwise I find these styles.
   
F:\COIN\CBC_Trunk\Coin-Cbc\CoinUtils\src\CoinIndexedVector.hpp(19)
: #define COIN_INDEXED_TINY_ELEMENT 1.0e-50
F:\COIN\CBC_Trunk\Coin-Cbc\CoinUtils\src\CoinIndexedVector.hpp(20)
: #define COIN_INDEXED_REALLY_TINY_ELEMENT 1.0e-100
F:\COIN\CBC_Trunk\Coin-Cbc\CoinUtils\src\CoinIndexedVector.hpp(22)
: #define COIN_INDEXED_TINY_ELEMENT 1.0e-35
F:\COIN\CBC_Trunk\Coin-Cbc\CoinUtils\src\CoinIndexedVector.hpp(23)
: #define COIN_INDEXED_REALLY_TINY_ELEMENT 1.0e-39

Cgl\src\CglRedSplit\CglRedSplitParam.hpp(161): const double
eps_relax_rel = 0.0,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(169): const double
min_reduc = 0.05,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(170): const double away =
0.05,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(175): const double lub =
1000.0,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(178): const double
eps_relax_rel = 0.0,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(186): const double
min_reduc = 0.05,
Cgl\src\CglRedSplit\CglRedSplitParam.hpp(187): const double away =
0.05,

Cgl\src\CglTwomir\CglTwomir.hpp(200): #define
DGG_DEFAULT_IMPROVEMENT_THRESH 0.001
Cgl\src\CglTwomir\CglTwomir.hpp(244): #define DGG_MIN_STEEPNESS
1.0e-4
Cgl\src\CglTwomir\CglTwomir.hpp(245): #define DGG_MAX_L2NORM 1.0e7
Cgl\src\CglTwomir\CglTwomir.hpp(256): OSI's default is 1.0e-7 */
Cgl\src\CglTwomir\CglTwomir.hpp(257): #define DGG_GOMORY_THRESH
0.005
Cgl\src\CglTwomir\CglTwomir.hpp(259): #define DGG_RHS_THRESH 0.005
Cgl\src\CglTwomir\CglTwomir.hpp(262): OSI's default is 1.0e-7.
Cgl\src\CglTwomir\CglTwomir.hpp(263): We set it to 1.0e6 because
e-7 seems too sensitive. 
Cgl\src\CglTwomir\CglTwomir.hpp(265): #define DGG_BOUND_THRESH
1.0e-6
Cgl\src\CglTwomir\CglTwomir.hpp(269): #define DGG_EQUALITY_THRESH
1.0e-5
Cgl\src\CglTwomir\CglTwomir.hpp(271): /* used for comparing a
variable's lower bound to 0.0
Cgl\src\CglTwomir\CglTwomir.hpp(273): #define DGG_SHIFT_THRESH
1.0e-6
Cgl\src\CglTwomir\CglTwomir.hpp(277): OSI's default is
1.0e-10.                               */
Cgl\src\CglTwomir\CglTwomir.hpp(278): #define
DGG_INTEGRALITY_THRESH 1.0e-10
Cgl\src\CglTwomir\CglTwomir.hpp(282): #define
DGG_MIN_TABLEAU_COEFFICIENT 1.0e-8
Cgl\src\CglTwomir\CglTwomir.hpp(286): #define DGG_MIN_RHO 1.0e-7
Cgl\src\CglTwomir\CglTwomir.hpp(287): #define DGG_MIN_ALPHA 1.0e-7
Cgl\src\CglTwomir\CglTwomir.hpp(290): #define DGG_NULL_SLACK
1.0e-5
Cgl\src\CglTwomir\CglTwomir.hpp(293): #define
DGG_NICEFY_MIN_ABSVALUE 1.0e-13
Cgl\src\CglTwomir\CglTwomir.hpp(294): #define DGG_NICEFY_MIN_FIX
1.0e-7
Cgl\src\CglTwomir\CglTwomir.hpp(295): #define
DGG_NICEFY_MAX_PADDING 1.0e-6
Cgl\src\CglTwomir\CglTwomir.hpp(296): #define DGG_NICEFY_MAX_RATIO
1.0e9

Clp\src\ClpMatrixBase.hpp(471): #define FREE_BIAS 1.0e1
Clp\src\ClpMatrixBase.hpp(473): #define FREE_ACCEPT 1.0e2

Clp\src\ClpSimplex.hpp(1414): #define DEVEX_TRY_NORM 1.0e-4
Clp\src\ClpSimplex.hpp(1415): #define DEVEX_ADD_ONE 1.0


Does replacement of these arbitrary 10 powers by the nearest 2
power have any appeal to you?
I find exactly represent able numbers appeal to me so that   eps *
(1.0)/eps) = 1.0 exactly.
The relevant c function is 

I think your estimate of a month was optimistic.

William
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srt_cbc_doubles.zip
Type: application/x-zip-compressed
Size: 11589 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20071023/9749ce4e/attachment.bin>


More information about the Clp mailing list