| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| LPModel |
|
| 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 java.util.Iterator; | |
| 25 | ||
| 26 | /** | |
| 27 | * A linear programming model consisting of variables, constraints and | |
| 28 | * components of the constraint matrix. | |
| 29 | * | |
| 30 | * A model shall provide the possibility to define a linear model in | |
| 31 | * a problem oriented way, i.e., more comfortably than through the low | |
| 32 | * level interface of an LPSolver. The components of the model are composed | |
| 33 | * into one global model by using strings as symbolic offset for the position | |
| 34 | * within the global model. | |
| 35 | * | |
| 36 | * Constraints and variables are grouped in sequences which are positioned | |
| 37 | * in consecutive rows resp. columns in the global model. Every such sequence | |
| 38 | * has an offset identifer. By querying for that identifer, the sequence | |
| 39 | * and its position in the global model can be retrieved. | |
| 40 | * | |
| 41 | * @author schickin | |
| 42 | * | |
| 43 | */ | |
| 44 | public interface LPModel { | |
| 45 | ||
| 46 | /** | |
| 47 | * The number of rows in the model. | |
| 48 | * | |
| 49 | * @return the number of rows. | |
| 50 | */ | |
| 51 | public int getNumRows(); | |
| 52 | ||
| 53 | /** | |
| 54 | * The number of columns in the model. | |
| 55 | * | |
| 56 | * @return the number of columns. | |
| 57 | */ | |
| 58 | public int getNumColumns(); | |
| 59 | ||
| 60 | /** | |
| 61 | * Get an iterator through sequences of constraints. | |
| 62 | * | |
| 63 | * @return an iterator through sequences of constraints. | |
| 64 | */ | |
| 65 | public Iterator getConstraintSequences(); | |
| 66 | ||
| 67 | /** | |
| 68 | * Get the constraint sequence for a given offset identifier. | |
| 69 | * | |
| 70 | * @param rowOffsetId the offset identifier for the row. | |
| 71 | * @return the corresponding constraint sequence | |
| 72 | * (or null if no matching sequence exists). | |
| 73 | */ | |
| 74 | public LPConstraintSequence getConstraintSequence(String rowOffsetId); | |
| 75 | ||
| 76 | /** | |
| 77 | * Get an iterator through sequences of variables. | |
| 78 | * | |
| 79 | * @return an iterator through sequences of variables. | |
| 80 | */ | |
| 81 | public Iterator getVariableSequences(); | |
| 82 | ||
| 83 | /** | |
| 84 | * Get the variable sequence for a given offset identifier. | |
| 85 | * | |
| 86 | * @param columnOffsetId the offset identfier for the column. | |
| 87 | * @return the correponding variable sequence. | |
| 88 | * (or null if no matching sequence exists). | |
| 89 | */ | |
| 90 | public LPVariableSequence getVariableSequence(String columnOffsetId); | |
| 91 | ||
| 92 | /** | |
| 93 | * Get an iterator through all components of the model. | |
| 94 | * | |
| 95 | * @return an iterator through all components of the model. | |
| 96 | */ | |
| 97 | public Iterator getModelComponents(); | |
| 98 | } |