| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| LPConstraintSequence |
|
| 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 02.09.2005 | |
| 20 | * | |
| 21 | */ | |
| 22 | package net.sourceforge.combean.interfaces.mathprog.lp.model; | |
| 23 | ||
| 24 | import net.sourceforge.combean.interfaces.mathprog.lp.LPConstraint; | |
| 25 | ||
| 26 | /** | |
| 27 | * A contiguous sequence of LP constraints. | |
| 28 | * | |
| 29 | * This class represents a set of constraints that shall occur in contiguous | |
| 30 | * rows in the resulting LP. The location of the constraint sequence is | |
| 31 | * defined by setting an offset id. When the constraint sequence is loaded | |
| 32 | * as part of a complete LP model, this model loader will assign an offset | |
| 33 | * to this offset id, which represents the first row of the constraint sequence | |
| 34 | * in the final complete model. | |
| 35 | * | |
| 36 | * @author schickin | |
| 37 | * | |
| 38 | */ | |
| 39 | public interface LPConstraintSequence { | |
| 40 | ||
| 41 | public static final int OFFSET_UNDEFINED = -1; | |
| 42 | ||
| 43 | /** | |
| 44 | * Get the number of elements in the sequence. | |
| 45 | * | |
| 46 | * @return the number of elements in the sequence. | |
| 47 | */ | |
| 48 | public int getNumConstrs(); | |
| 49 | ||
| 50 | /** | |
| 51 | * Set the identifier which defines the offset of the condition sequence | |
| 52 | * in a global LP model. | |
| 53 | * | |
| 54 | * @param offsetId the offset identifier. | |
| 55 | */ | |
| 56 | public void setConstrOffsetId(String offsetId); | |
| 57 | ||
| 58 | /** | |
| 59 | * Return the identifier for the offset in the global LP model. | |
| 60 | * | |
| 61 | * @return the identifier for the offset in the global LP model. | |
| 62 | */ | |
| 63 | public String getConstrOffsetId(); | |
| 64 | ||
| 65 | /** | |
| 66 | * Set the offset, i.e., the index of the first row resp. column of | |
| 67 | * the sequence in the global model. | |
| 68 | * | |
| 69 | * @param globalIndex the global index of the first element of the sequence. | |
| 70 | */ | |
| 71 | public void setConstrOffset(int globalIndex); | |
| 72 | ||
| 73 | /** | |
| 74 | * Get the global index of the first element of the sequence. | |
| 75 | * | |
| 76 | * @return the global index of the first element of the sequence. | |
| 77 | */ | |
| 78 | public int getConstrOffset(); | |
| 79 | ||
| 80 | /** | |
| 81 | * Get the constraint for a given (local) row index. | |
| 82 | * | |
| 83 | * @param localRow a local row index. | |
| 84 | * @return the corresponding LP constraint. | |
| 85 | */ | |
| 86 | LPConstraint getLPConstraint(int localRow); | |
| 87 | } |