[CHiPPS] Is This A Bug?

Yan Xu Yan.Xu at sas.com
Fri Mar 2 13:02:43 EST 2012


The comment is wrong. Should be " /** This returns true if the quality of the subtree x is better  (the less the better) than that the subtree y. */"

Thanks for point it out.
-Yan

From: Ted Ralphs [mailto:ted at Lehigh.EDU]
Sent: Friday, March 02, 2012 12:48 PM
To: Yan Xu
Subject: Re: [CHiPPS] Is This A Bug?

I assume that this is not actually a bug, right? It's just that the comment is wrong? It says that the function returns whether y is better than x, but it actually returns whether x is better than y, right? That was why they were confused...

Ted

On Wed, Feb 29, 2012 at 2:07 PM, Yan Xu <Yan.Xu at sas.com<mailto:Yan.Xu at sas.com>> wrote:
It is used in AlpsPriorityQueue.h

   /** Set comparison function and resort heap. */
    void setComparison(AlpsSearchStrategy<T>& c) {
        comparison_.strategy_ = &c;
        std::make_heap(vec_.begin(), vec_.end(), comparison_);
    }




From: chipps-bounces at list.coin-or.org<mailto:chipps-bounces at list.coin-or.org> [mailto:chipps-bounces at list.coin-or.org<mailto:chipps-bounces at list.coin-or.org>] On Behalf Of ???
Sent: Saturday, February 25, 2012 8:30 AM
To: chipps at list.coin-or.org<mailto:chipps at list.coin-or.org>
Cc: geogrid at gmail.com<mailto:geogrid at gmail.com>
Subject: [CHiPPS] Is This A Bug?

Your Honor Processors,
        I am puzzled by some code I found in Alps/src/AlpsSearchStrategy.h   line 82-84 and in Alps/src/AlpsSearchStrategy.cpp line 55-58

         There are comment in AlpsSearchStrategy.h
         /** This returns true if the quality of the subtree y is better  (the less the better) than that the subtree x. */
        virtual bool compare(AlpsSubTree * x, AlpsSubTree * y);

        While in AlpsSearchStrategy.cpp
        bool
        AlpsTreeSelectionBest::compare(AlpsSubTree * x, AlpsSubTree * y)
        {
                 return (x->getQuality() < y->getQuality());
        }

        obviously it will return true if x is better than y, is this conflicted to AlpsSearchStrategy.h?

        Because I can`t find where the compare() is called, so I can`t make sure if it is a bug.
        Could explain it to me? Thank you very much!

        Best Wishes.

_______________________________________________
CHiPPS mailing list
CHiPPS at list.coin-or.org<mailto:CHiPPS at list.coin-or.org>
http://list.coin-or.org/mailman/listinfo/chipps



--
Dr. Ted Ralphs
Associate Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted<http://coral.ie.lehigh.edu/~ted>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/chipps/attachments/20120302/e18e84f6/attachment.html>


More information about the CHiPPS mailing list