Scippy

SoPlex

Sequential object-oriented simPlex

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 
33 }
34 
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 
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 
56  : IdxSet()
57 {
58  len = (n < 1) ? 1 : n;
59  spx_alloc(idx, len);
60 }
61 
63 {
64  if(idx)
65  spx_free(idx);
66 }
67 } // namespace soplex