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

- File List
- File Members

# /home/coin/SVN-release/Cgl-0.52.0/CoinUtils/src/CoinBuild.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2005, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 #ifndef CoinBuild_H
    00004 #define CoinBuild_H
    00005
    00006
    00007 #include "CoinPragma.hpp"
    00008 #include "CoinFinite.hpp"
    00009
    00010
    00023 class CoinBuild {
    00024
    00025 public:
    00028
    00029    void addRow(int numberInRow, const int * columns,
    00030                const double * elements, double rowLower=-COIN_DBL_MAX,
    00031               double rowUpper=COIN_DBL_MAX);
    00033    void addColumn(int numberInColumn, const int * rows,
    00034                   const double * elements,
    00035                   double columnLower=0.0,
    00036                   double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0);
    00038    inline void addCol(int numberInColumn, const int * rows,
    00039                   const double * elements,
    00040                   double columnLower=0.0,
    00041                   double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0)
    00042   { addColumn(numberInColumn, rows, elements, columnLower, columnUpper, objectiveValue);}
    00044   inline int numberRows() const
    00045   { return (type_==0) ? numberItems_ : numberOther_;}
    00047   inline int numberColumns() const
    00048   { return (type_==1) ? numberItems_ : numberOther_;}
    00050   inline CoinBigIndex numberElements() const
    00051   { return numberElements_;}
    00054   int row(int whichRow, double & rowLower, double & rowUpper,
    00055           const int * & indices, const double * & elements) const;
    00059   int currentRow(double & rowLower, double & rowUpper,
    00060           const int * & indices, const double * & elements) const;
    00062   void setCurrentRow(int whichRow);
    00064   int currentRow() const;
    00067   int column(int whichColumn,
    00068              double & columnLower, double & columnUpper,double & objectiveValue,
    00069              const int * & indices, const double * & elements) const;
    00073   int currentColumn( double & columnLower, double & columnUpper,double & objectiveValue,
    00074           const int * & indices, const double * & elements) const;
    00076   void setCurrentColumn(int whichColumn);
    00078   int currentColumn() const;
    00080   inline int type() const
    00081   { return type_;}
    00083
    00084
    00088    CoinBuild();
    00090    CoinBuild(int type);
    00092    ~CoinBuild();
    00094
    00098    CoinBuild(const CoinBuild&);
    00100    CoinBuild& operator=(const CoinBuild&);
    00102 private:
    00104   void setMutableCurrent(int which) const;
    00106    void addItem(int numberInItem, const int * indices,
    00107                   const double * elements,
    00108                   double itemLower,
    00109                   double itemUpper, double objectiveValue);
    00112   int item(int whichItem,
    00113              double & itemLower, double & itemUpper,double & objectiveValue,
    00114              const int * & indices, const double * & elements) const;
    00118   int currentItem( double & itemLower, double & itemUpper,double & objectiveValue,
    00119           const int * & indices, const double * & elements) const;
    00121   void setCurrentItem(int whichItem);
    00123   int currentItem() const;
    00124
    00125 private:
    00128
    00129   int numberItems_;
    00131   int numberOther_;
    00133   CoinBigIndex numberElements_;
    00135   mutable double * currentItem_;
    00137   double * firstItem_;
    00139   double * lastItem_;
    00141   int type_;
    00143 };
    00144
    00145 #endif