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
didxset.cpp
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
#include "
didxset.h
"
17
#include "
spxalloc.h
"
18
19
namespace
soplex
20
{
21
22
void
DIdxSet::setMax
(
int
newmax)
23
{
24
assert(
idx
!= 0);
25
assert(
max
() > 0);
26
27
len
= (newmax <
size
()) ?
size
() : newmax;
28
len
= (
len
< 1) ? 1 :
len
;
29
30
assert(
len
> 0);
31
32
spx_realloc
(
idx
,
len
);
33
}
34
35
DIdxSet::DIdxSet
(
const
IdxSet
& old)
36
:
IdxSet
()
37
{
38
len
= old.
size
();
39
len
= (
len
< 1) ? 1 :
len
;
40
spx_alloc
(
idx
,
len
);
41
42
IdxSet::operator=
( old );
43
}
44
45
DIdxSet::DIdxSet
(
const
DIdxSet
& old)
46
:
IdxSet
()
47
{
48
len
= old.
size
();
49
len
= (
len
< 1) ? 1 :
len
;
50
spx_alloc
(
idx
,
len
);
51
52
IdxSet::operator=
( old );
53
}
54
55
DIdxSet::DIdxSet
(
int
n)
56
:
IdxSet
()
57
{
58
len
= (n < 1) ? 1 : n;
59
spx_alloc
(
idx
,
len
);
60
}
61
62
DIdxSet::~DIdxSet
()
63
{
64
if
(
idx
)
65
spx_free
(
idx
);
66
}
67
}
// namespace soplex