Scippy

UG

Ubiquity Generator framework

scipParaSolutionTh.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-2024 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 scipParaSolutionTh.h
27 * @brief ScipParaSolution extension for threads communication.
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_SOLUTION_TH_H__
38#define __SCIP_PARA_SOLUTION_TH_H__
39
40#include "ug/paraTagDef.h"
41#include "ug_bb/bbParaComm.h"
42#include "scipParaSolution.h"
43#include "scipParaSolver.h"
44#include "scip/scip.h"
45
46namespace ParaSCIP
47{
48
49/** ScipSolution class */
51{
52 /** create scipSolutionDatatype */
54
55public:
56
57 /** default constructor */
59 )
60 {
61 }
62
63 /** constructor */
65 ScipParaSolver *solver,
66 SCIP_Real objval,
67 int inNvars,
68 SCIP_VAR ** vars,
69 SCIP_Real * vals
70 )
71 : ScipParaSolution(solver, objval, inNvars, vars, vals){}
72
73 /** constructor */
75 double inObjectiveFunctionValue, /**< objective function value */
76 int inNVars, /**< number of variables */
77 int *inIndicesAmongSolvers, /**< array of variable indices ( probindex ) */
78 SCIP_Real *inValues /**< array of bounds which the branchings */
79 ): ScipParaSolution(inObjectiveFunctionValue, inNVars, inIndicesAmongSolvers, inValues) {}
80
81 /** destructor */
83 )
84 {
85 }
86
87 /** create clone of this object */
89
90 /** broadcast solution data to from the root rank */
91 void bcast(UG::ParaComm *comm, int root);
92
93 /** send solution data to the rank */
94 void send(UG::ParaComm *comm, int destination);
95
96 /** receive solution data from the source rank */
97 void receive(UG::ParaComm *comm, int source);
98
99};
100
102
103}
104
105#endif // __SCIP_PARA_SOLUTION_TH_H__
106
Base class of communicator for UG Framework.
ScipParaSolutionTh * clone(UG::ParaComm *comm)
ScipParaSolutionTh * createDatatype(UG::ParaComm *comm)
void send(UG::ParaComm *comm, int destination)
void bcast(UG::ParaComm *comm, int root)
ScipParaSolutionTh(double inObjectiveFunctionValue, int inNVars, int *inIndicesAmongSolvers, SCIP_Real *inValues)
void receive(UG::ParaComm *comm, int source)
ScipParaSolutionTh(ScipParaSolver *solver, SCIP_Real objval, int inNvars, SCIP_VAR **vars, SCIP_Real *vals)
Base class of communicator object.
Definition: paraComm.h:102
static ScipParaCommTh * comm
Definition: fscip.cpp:73
ScipParaSolutionTh * ScipParaSolutionThPtr
Fundamental Tag definitions.
ParaSolution extension for SCIP solver.
ParaSolver extension for SCIP: Parallelized solver implementation for SCIP.