Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractSimpleIndexLPConstrainedRows |
|
| 1.0;1 |
1 | /* | |
2 | This file is part of Combean. | |
3 | ||
4 | Combean is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published by | |
6 | the Free Software Foundation; either version 2 of the License, or | |
7 | (at your option) any later version. | |
8 | ||
9 | Combean is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
15 | along with Combean; if not, write to the Free Software | |
16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | /* | |
19 | * Created on 04.08.2006 | |
20 | * | |
21 | */ | |
22 | package net.sourceforge.combean.mathprog.lp.model; | |
23 | ||
24 | import net.sourceforge.combean.interfaces.mathprog.linalg.VectorOrientation; | |
25 | import net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence; | |
26 | import net.sourceforge.combean.interfaces.mathprog.lp.model.LPModelComponent; | |
27 | ||
28 | /** | |
29 | * Abstract base class for LP models that have a single pair of constrOffset ids | |
30 | * and come together with their constraints. | |
31 | * | |
32 | * @author schickin | |
33 | * | |
34 | */ | |
35 | public abstract class AbstractSimpleIndexLPConstrainedRows | |
36 | extends AbstractSimpleIndexLPModelComponent | |
37 | implements LPModelComponent, LPConstraintSequence { | |
38 | ||
39 | 6 | private int constrOffset = LPConstraintSequence.OFFSET_UNDEFINED; |
40 | ||
41 | /** | |
42 | * Constructor | |
43 | * | |
44 | * @param rowOffsetId | |
45 | * @param columnOffsetId | |
46 | */ | |
47 | public AbstractSimpleIndexLPConstrainedRows( | |
48 | String rowOffsetId, String columnOffsetId) { | |
49 | 6 | super(VectorOrientation.ROWWISE, rowOffsetId, columnOffsetId); |
50 | 6 | } |
51 | ||
52 | /* (non-Javadoc) | |
53 | * @see net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence#getConstrOffset() | |
54 | */ | |
55 | public int getConstrOffset() { | |
56 | 72 | return this.constrOffset; |
57 | } | |
58 | ||
59 | /* (non-Javadoc) | |
60 | * @see net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence#setConstrOffset(int) | |
61 | */ | |
62 | public void setConstrOffset(int globalIndex) { | |
63 | 6 | this.constrOffset = globalIndex; |
64 | 6 | } |
65 | ||
66 | /* (non-Javadoc) | |
67 | * @see net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence#getConstrOffsetId() | |
68 | */ | |
69 | public String getConstrOffsetId() { | |
70 | 6 | return getRowOffsetId(); |
71 | } | |
72 | ||
73 | /* (non-Javadoc) | |
74 | * @see net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence#setConstrOffsetId(java.lang.String) | |
75 | */ | |
76 | public void setConstrOffsetId(String offsetId) { | |
77 | 0 | setRowOffsetId(offsetId); |
78 | 0 | } |
79 | ||
80 | /* (non-Javadoc) | |
81 | * @see net.sourceforge.combean.interfaces.mathprog.lp.model.LPConstraintSequence#getNumConstrs() | |
82 | */ | |
83 | public int getNumConstrs() { | |
84 | 6 | return getNumRows(); |
85 | } | |
86 | } |