Changeset 881 for trunk


Ignore:
Timestamp:
Feb 26, 2008 6:56:08 AM (12 years ago)
Author:
forrest
Message:

try and get statistics working with osi objects

Location:
trunk/Cbc/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcModel.cpp

    r871 r881  
    17461746        }
    17471747        assert (!statistics_[numberNodes2_]);
    1748         statistics_[numberNodes2_]=new CbcStatistics(newNode);
     1748        statistics_[numberNodes2_]=new CbcStatistics(newNode,this);
    17491749      }
    17501750      numberNodes2_++;
     
    1184411844            }
    1184511845            assert (!statistics_[numberNodes2_]);
    11846             statistics_[numberNodes2_]=new CbcStatistics(newNode);
     11846            statistics_[numberNodes2_]=new CbcStatistics(newNode,this);
    1184711847          }
    1184811848          numberNodes2_++;
     
    1190811908          }
    1190911909          assert (!statistics_[numberNodes2_]);
    11910           statistics_[numberNodes2_]=new CbcStatistics(node);
     11910          statistics_[numberNodes2_]=new CbcStatistics(node,this);
    1191111911        }
    1191211912        numberNodes2_++;
  • trunk/Cbc/src/CbcNode.cpp

    r854 r881  
    46494649    CbcBranchingObject * obj =
    46504650      dynamic_cast <CbcBranchingObject *>(branch_) ;
    4651     assert (obj);
    4652     return obj->way();
     4651    if (obj) {
     4652      return obj->way();
     4653    } else {
     4654      OsiTwoWayBranchingObject * obj2 =
     4655      dynamic_cast <OsiTwoWayBranchingObject *>(branch_) ;
     4656      assert (obj2);
     4657      return obj2->way();
     4658    }
    46534659  } else {
    46544660    return 0;
  • trunk/Cbc/src/CbcStatistics.cpp

    r640 r881  
    4444}
    4545// First or second branch
    46 CbcStatistics::CbcStatistics(CbcNode * node)
     46CbcStatistics::CbcStatistics(CbcNode * node, CbcModel * model)
    4747  :  endingObjective_(COIN_DBL_MAX),
    4848     endingInfeasibility_(0),
     
    5353  int numberBranches = nodeInfo->numberBranchesLeft();
    5454  const CbcBranchingObject * branch = dynamic_cast <const CbcBranchingObject *>(node->branchingObject());
     55  const OsiTwoWayBranchingObject * branch2 = dynamic_cast <const OsiTwoWayBranchingObject *>(node->branchingObject());
    5556  startingObjective_=node->objectiveValue();
    5657  way_=node->way();
     
    6162    value_ = branch->value();
    6263  } else {
    63     sequence_=-1;
    64     value_=0.0;
     64    const OsiSimpleInteger * obj = dynamic_cast<const OsiSimpleInteger *>(branch2->originalObject());
     65    assert (obj);
     66    sequence_=obj->columnNumber();
     67    value_=branch2->value();
    6568  }
    6669  if (parent)
     
    7275  } else {
    7376    way_ *= 10;
    74     assert (branch);
    75     CbcModel * model = branch->model();
    7677    id_=model->getNodeCount2();
    7778  }
  • trunk/Cbc/src/CbcStatistics.hpp

    r706 r881  
    1313  CbcStatistics ();
    1414  // Branch
    15   CbcStatistics(CbcNode * node);
     15  CbcStatistics(CbcNode * node, CbcModel * model);
    1616
    1717  ~CbcStatistics();
Note: See TracChangeset for help on using the changeset viewer.