[CHiPPS] Is This A Bug?

Yan Xu Yan.Xu at sas.com
Wed Feb 29 14:07:02 EST 2012


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] On Behalf Of ???
Sent: Saturday, February 25, 2012 8:30 AM
To: chipps at list.coin-or.org
Cc: 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/chipps/attachments/20120229/f58190ec/attachment.html>


More information about the CHiPPS mailing list