Scippy

UG

Ubiquity Generator framework

scipParaInitialStat.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and software framework */
4 /* UG --- Ubquity Generator Framework */
5 /* */
6 /* Copyright Written by Yuji Shinano <shinano@zib.de>, */
7 /* Copyright (C) 2021 by Zuse Institute Berlin, */
8 /* licensed under LGPL version 3 or later. */
9 /* Commercial licenses are available through <licenses@zib.de> */
10 /* */
11 /* This code is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public License */
13 /* as published by the Free Software Foundation; either version 3 */
14 /* of the License, or (at your option) any later version. */
15 /* */
16 /* This program is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
19 /* GNU Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* */
24 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25 
26 /**@file scipParaInitialStat.h
27  * @brief ParaInitialStat extension for SCIP solver.
28  * @author Yuji Shinano
29  *
30  *
31  *
32  */
33 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 
37 #ifndef __SCIP_PARA_INITIAL_STAT_H__
38 #define __SCIP_PARA_INITIAL_STAT_H__
39 
40 #include <iostream>
41 #include "ug_bb/bbParaComm.h"
42 #include "scip/scip.h"
43 #include "ug/paraInitialStat.h"
44 
45 namespace ParaSCIP
46 {
47 
48 /** The initial statistic collecting data class: this is base class */
50 {
51 protected:
52  int maxDepth; /**< maximal depth of all processed nodes in current branch and bound run (excluding probing nodes) */
53  int maxTotalDepth; /**< maximal depth of all processed nodes over all branch and bound runs */
54  /********************************
55  * for var brnach stats *
56  * *****************************/
57  int nVarBranchStatsDown; /**< number of branch stats downward */
58  int nVarBranchStatsUp; /**< number of branch stats upward */
59  int *idxLBranchStatsVarsDown; /**< indices of branch stats vars downward */
60  int *nVarBranchingDown; /**< number of branchings of this var to downward */
61  int *idxLBranchStatsVarsUp; /**< indices of branch stats vars upward */
62  int *nVarBranchingUp; /**< number of branchings of this var to upward */
63  SCIP_Real *downpscost; /**< values to which pseudocosts for downwards branching */
64  SCIP_Real *downvsids; /**< values to which VSIDS score for downwards branching */
65  SCIP_Real *downconflen; /**< values to which conflict length score for downwards branching */
66  SCIP_Real *downinfer; /**< values to which inference counter for downwards branching */
67  SCIP_Real *downcutoff; /**< values to which cutoff counter for downwards branching */
68  SCIP_Real *uppscost; /**< values to which pseudocosts for upwards branching */
69  SCIP_Real *upvsids; /**< values to which VSIDS score for upwards branching */
70  SCIP_Real *upconflen; /**< values to which conflict length score for upwards branching */
71  SCIP_Real *upinfer; /**< values to which inference counter for upwards branching */
72  SCIP_Real *upcutoff; /**< values to which cutoff counter for upwards branching */
73 public:
74  /** default constructor */
76  ) :
77  maxDepth(0),
78  maxTotalDepth(0),
79  nVarBranchStatsDown(0),
80  nVarBranchStatsUp(0),
81  idxLBranchStatsVarsDown(0),
82  nVarBranchingDown(0),
83  idxLBranchStatsVarsUp(0),
84  nVarBranchingUp(0),
85  downpscost(0),
86  downvsids(0),
87  downconflen(0),
88  downinfer(0),
89  downcutoff(0),
90  uppscost(0),
91  upvsids(0),
92  upconflen(0),
93  upinfer(0),
94  upcutoff(0)
95  {
96  }
97 
98  /** constructor to create this object */
99  ScipParaInitialStat(SCIP *scip);
100 
101  /** destractor */
103  {
104  if( idxLBranchStatsVarsDown ) delete[] idxLBranchStatsVarsDown;
105  if( nVarBranchingDown ) delete[] nVarBranchingDown;
106  if( idxLBranchStatsVarsUp ) delete[] idxLBranchStatsVarsUp;
107  if( nVarBranchingUp ) delete[] nVarBranchingUp;
108  if( downpscost ) delete[] downpscost;
109  if( downvsids ) delete[] downvsids;
110  if( downconflen ) delete[] downconflen;
111  if( downinfer ) delete[] downinfer;
112  if( downcutoff ) delete[] downcutoff;
113  if( uppscost ) delete[] uppscost;
114  if( upvsids ) delete[] upvsids;
115  if( upconflen ) delete[] upconflen;
116  if( upinfer ) delete[] upinfer;
117  if( upcutoff ) delete[] upcutoff;
118  }
119 
120  /** create clone of this object */
122 
123  /** accumulate initial statistics into target scip environment */
124  void accumulateOn(SCIP *scip);
125 
126  /** get maximum depth */
127  int getMaxDepth(){ return maxDepth; }
128 
129  /** stringfy subproblem ( for debugging ) */
130  const std::string toString(){ return std::string(); }
131 };
132 
133 }
134 
135 #endif // __SCIP_PARA_INITIAL_STAT_H__
136 
static ScipParaCommTh * comm
Definition: fscip.cpp:73
Base class for initial statistics collecting class.
ParaInitialStat()
DO NOT HAVE DATA MEMBER!!
ParaInitialStat * clone(UG::ParaComm *comm)
class for initial statistics collecting after racing
Base class of communicator object.
Definition: paraComm.h:101