- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/svn-release/Smi-0.93.1/Smi/src/SmiLinearData.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 //
    00004 // SmiLinear.hpp: interface for the SmiLinearData classes.
    00005 //
    00006 //
    00007 // Alan King
    00008 // 9 March 2004
    00010
    00011 #ifndef SmiLinearData_HPP
    00012 #define SmiLinearData_HPP
    00013
    00014 #if defined(_MSC_VER)
    00015 // Turn off compiler warning about long names
    00016 #  pragma warning(disable:4786)
    00017 #endif
    00018
    00019 #include "CoinPackedVector.hpp"
    00020 #include "CoinPackedMatrix.hpp"
    00021 #include "OsiSolverInterface.hpp"
    00022
    00023 class SmiLinearData
    00024 {
    00025 public:
    00026         inline const CoinPackedMatrix &getMatrix()   {return matrix_; }
    00027         inline const CoinPackedVector &getColLower() {return dclo_;}
    00028         inline const CoinPackedVector &getColUpper() {return dcup_;}
    00029         inline const CoinPackedVector &getObjective(){return dobj_;}
    00030         inline const CoinPackedVector &getRowLower() {return drlo_;}
    00031         inline const CoinPackedVector &getRowUpper() {return drup_;}
    00032
    00033         inline   CoinPackedMatrix &getMutableMatrix()   {return matrix_; }
    00034         inline   CoinPackedVector &getMutableColLower() {return dclo_;}
    00035         inline   CoinPackedVector &getMutableColUpper() {return dcup_;}
    00036         inline   CoinPackedVector &getMutableObjective(){return dobj_;}
    00037         inline   CoinPackedVector &getMutableRowLower() {return drlo_;}
    00038         inline   CoinPackedVector &getMutableRowUpper() {return drup_;}
    00039
    00040
    00041         SmiLinearData():matrix_(),
    00042                                                    dclo_(),
    00043                                                    dcup_(),
    00044                                                    dobj_(),
    00045                                                    drlo_(),
    00046                                                    drup_()
    00047         {}
    00048
    00049         SmiLinearData(SmiLinearData &d):
    00050                                                                 matrix_(d.getMatrix()),
    00051                                                                 dclo_(d.getColLower()),
    00052                                                                 dcup_(d.getColUpper()),
    00053                                                                 dobj_(d.getObjective()),
    00054                                                                 drlo_(d.getRowLower()),
    00055                                                                 drup_(d.getRowUpper())
    00056         {}
    00057
    00058         SmiLinearData(CoinPackedMatrix &matrix,
    00059                                 CoinPackedVector &dclo, CoinPackedVector &dcup,
    00060                                 CoinPackedVector &dobj,
    00061                                 CoinPackedVector &drlo, CoinPackedVector &drup): matrix_(matrix),
    00062                                                    dclo_(dclo),
    00063                                                    dcup_(dcup),
    00064                                                    dobj_(dobj),
    00065                                                    drlo_(drlo),
    00066                                                    drup_(drup)
    00067         {}
    00068         SmiLinearData(OsiSolverInterface &osi):matrix_((*osi.getMatrixByCol()))
    00069         {
    00070                 dclo_=CoinPackedVector(matrix_.getNumCols(),osi.getColLower());
    00071                 dcup_=CoinPackedVector(matrix_.getNumCols(),osi.getColUpper());
    00072                 dobj_=CoinPackedVector(matrix_.getNumCols(),osi.getObjCoefficients());
    00073                 drlo_=CoinPackedVector(matrix_.getNumRows(),osi.getRowLower());
    00074                 drup_=CoinPackedVector(matrix_.getNumRows(),osi.getRowUpper());
    00075         }
    00076
    00077         ~SmiLinearData(){}
    00078 private:
    00079         CoinPackedMatrix matrix_;
    00080         CoinPackedVector dclo_;
    00081         CoinPackedVector dcup_;
    00082         CoinPackedVector dobj_;
    00083         CoinPackedVector drlo_;
    00084         CoinPackedVector drup_;
    00085 };
    00086
    00087 #endif //SmiLinearData_HPP
    00088