Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SoPlex 6.0.3
SoPlex 5.0.2
SoPlex 4.0.2
SoPlex 3.1.0
SoPlex 3.0.1
SoPlex 2.2.1
SoPlex
Sequential object-oriented simPlex
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
soplex-repo
src
spxvectorst.h
Go to the documentation of this file.
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2
/* */
3
/* This file is part of the class library */
4
/* SoPlex --- the Sequential object-oriented simPlex. */
5
/* */
6
/* Copyright (C) 1996-2015 Konrad-Zuse-Zentrum */
7
/* fuer Informationstechnik Berlin */
8
/* */
9
/* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10
/* */
11
/* You should have received a copy of the ZIB Academic License */
12
/* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13
/* */
14
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15
16
/**@file spxvectorst.h
17
* @brief Solution vector based start basis.
18
*/
19
#ifndef _SPXVECTORST_H_
20
#define _SPXVECTORST_H_
21
22
#include <assert.h>
23
24
#include "
spxweightst.h
"
25
#include "
vector.h
"
26
27
namespace
soplex
28
{
29
30
/**@brief Solution vector based start basis.
31
@ingroup Algo
32
33
This version of SPxWeightST can be used to construct a starting basis for
34
an LP to be solved with SoPlex if an approximate solution vector or dual
35
vector (possibly optained by a heuristic) is available. This is done by
36
setting up weights for the SPxWeightST it is derived from.
37
38
The primal vector to be used is loaded by calling method #primal() while
39
#dual() setups for the dual vector. Methods #primal() or #dual() must be
40
called \em before #generate() is called by SoPlex to set up a
41
starting basis. If more than one call of method #primal() or #dual()
42
occurred only the most recent one is valid for generating the starting base.
43
*/
44
class
SPxVectorST
:
public
SPxWeightST
45
{
46
private
:
47
48
//-------------------------------------
49
/**@name Types */
50
//@{
51
/// specifies whether to work on the primal, the dual, or not at all.
52
enum
{
NONE
,
PVEC
,
DVEC
}
state
;
53
//@}
54
55
//-------------------------------------
56
/**@name Data */
57
//@{
58
/// the current (approximate) primal or dual vector
59
DVector
vec
;
60
//@}
61
62
protected
:
63
64
//-------------------------------------
65
/**@name Protected helpers */
66
//@{
67
/// sets up variable weights.
68
void
setupWeights
(
SPxSolver
& base);
69
//@}
70
71
public
:
72
73
//-------------------------------------
74
/**@name Construction / destruction */
75
//@{
76
/// default constructor.
77
SPxVectorST
()
78
:
state
(
NONE
)
79
{
80
m_name
=
"Vector"
;
81
}
82
/// copy constructor
83
SPxVectorST
(
const
SPxVectorST
& old)
84
:
SPxWeightST
(old)
85
,
state
(old.
state
)
86
,
vec
(old.
vec
)
87
{
88
assert(
isConsistent
());
89
}
90
/// assignment operator
91
SPxVectorST
&
operator=
(
const
SPxVectorST
& rhs)
92
{
93
if
(
this
!= &rhs)
94
{
95
SPxWeightST::operator=
(rhs);
96
state
= rhs.
state
;
97
vec
= rhs.
vec
;
98
99
assert(
isConsistent
());
100
}
101
102
return
*
this
;
103
}
104
/// destructor.
105
virtual
~SPxVectorST
()
106
{}
107
/// clone function for polymorphism
108
inline
virtual
SPxStarter
*
clone
()
const
109
{
110
return
new
SPxVectorST
(*
this
);
111
}
112
//@}
113
114
//-------------------------------------
115
/**@name Modification */
116
//@{
117
/// sets up primal solution vector.
118
void
primal
(
const
Vector
& v)
119
{
120
vec
= v;
121
state
=
PVEC
;
122
}
123
/// sets up primal solution vector.
124
void
dual
(
const
Vector
& v)
125
{
126
vec
= v;
127
state
=
DVEC
;
128
}
129
//@}
130
131
};
132
133
}
// namespace soplex
134
#endif // _SPXVECTORST_H_