<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.E-MailFormatvorlage23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:526718368;
        mso-list-type:hybrid;
        mso-list-template-ids:-1899196850 -1767894978 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">John,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">yes, the bug goes away. Valgrind keeps quiet, too. Except that I used „= {}“ instead of „= {0}“. I changed that in my copy of Cbc as a workaround until a fixed version is released.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">In case the real bug is hiding in the following if-else  statements it may not be sufficient and someone else may trigger it again.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Tobias<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:DE">Von:</span></b><span style="color:windowtext;mso-fareast-language:DE"> John Forrest [mailto:john.forrest@fastercoin.com]
<br>
<b>Gesendet:</b> Mittwoch, 18. Mai 2016 17:54<br>
<b>An:</b> Tobias Stengel <Tobias.Stengel@locom.de><br>
<b>Betreff:</b> Re: [Cbc] defining a custom cut generator<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Tobias,<br>
<br>
If you set switches and accuracyFlag to 0, does the bug go away?  Anyway it would obviously be more elegant to have<br>
<br>
               int switches[30]={0};<br>
               int accuracyFlag[30]={0};<br>
               char doAtEnd[30]={0};<br>
<br>
John Forrest<br>
On 17/05/16 09:19, Tobias Stengel wrote:<span style="font-size:12.0pt;mso-fareast-language:DE"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">Hello John,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">I did some printf+valgrind debugging and found the following (for gcc+linux):</span><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]><span style="color:#1F497D">If (and only if) the custom cut generator is added, an uninitialised value is passed to the „TwoMirCuts“ CbcCutGenerator::</span><span style="font-size:9.5pt;font-family:Consolas;background:white;mso-highlight:white;mso-fareast-language:DE">setInaccuracy</span><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE">This value originates from CbcSolver.cpp, line 4880. I have no idea whether just a „= {}“ is missing or if something goes wrong in the following if-else statements.</span><o:p></o:p></p>
<p class="MsoListParagraph"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">For Visual C++, with the „</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:DE">int</span><span style="font-size:9.5pt;font-family:Consolas;background:white;mso-highlight:white;mso-fareast-language:DE">
 accuracyFlag[30] = {};</span><span style="color:#1F497D">“ the assert is still triggered with TwoMirCuts.</span><span style="font-size:9.5pt;font-family:Consolas;background:white;mso-highlight:white;mso-fareast-language:DE">switchOffIfLessThan</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE">()
 == 858993460. If the the switches array in CbcSolver, line 4879 is also initialised with „ = {}“, everything works fine.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE">As the arrays live on the stack, this could explain why
<span style="background:white;mso-highlight:white">switchOffIfLessThan</span>() is reproducible 858993460 and why the behaviour depends on the compiler/compilerflags.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE">Nevertheless looks very strange to me that adding a custom cut generator changes the values passed to the TwoMirCuts generator.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:DE">Tobias</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:DE">Von:</span></b><span style="color:windowtext;mso-fareast-language:DE"> Cbc [<a href="mailto:cbc-bounces@coin-or.org">mailto:cbc-bounces@coin-or.org</a>]
<b>Im Auftrag von </b>John Forrest<br>
<b>Gesendet:</b> Dienstag, 10. Mai 2016 14:57<br>
<b>An:</b> <a href="mailto:cbc@list.coin-or.org">cbc@list.coin-or.org</a><br>
<b>Betreff:</b> Re: [Cbc] defining a custom cut generator</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Tobias,<br>
<br>
Odd.  By default the variable  switchOffIfLessThan_ in a CbcCutGenerator is zero.  This means that you would not get to 9401 as it would fail test -<br>
<br>
 if (generator_[i]->switchOffIfLessThan() < 0) {<br>
<br>
at line 9398.<br>
<br>
What value is switchOffIfLessThan_ when assert happens?  You do not reference CbcCutGenerator so how is the generator being added to CbcModel?<br>
<br>
John Forrest<br>
<br>
On 10/05/16 13:02, Tobias Stengel wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am trying to define my on cut generator. My test problem is noswot problem from miplib 3. When I add the following generator (reduced from my generator) to my model, the assert „<span style="font-size:9.5pt;font-family:Consolas;color:#6F008A;background:white;mso-highlight:white">assert</span><span style="font-size:9.5pt;font-family:Consolas;background:white;mso-highlight:white">
 (iSwitch >= 0 && iSwitch < 2);</span><span style="font-size:9.5pt;font-family:Consolas">“ in CbcModel.cpp, line 9401 fails. If compiled in release mode (turning asserts off), the correct solution is found.</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">I am using Cbc 2.9.8 and Microsoft visual C++ 2013.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"> </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white"> </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Thanks</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Tobias</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Cbc mailing list<o:p></o:p></pre>
<pre><a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><o:p></o:p></pre>
<pre><a href="http://list.coin-or.org/mailman/listinfo/cbc">http://list.coin-or.org/mailman/listinfo/cbc</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Cbc mailing list<o:p></o:p></pre>
<pre><a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><o:p></o:p></pre>
<pre><a href="http://list.coin-or.org/mailman/listinfo/cbc">http://list.coin-or.org/mailman/listinfo/cbc</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p> </o:p></span></p>
</div>
</body>
</html>