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

- File List
- File Members

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

Go to the documentation of this file.

    00001 /* $Id: CoinBuild.hpp 1215 2009-11-05 11:03:04Z forrest $ */
    00002 // Copyright (C) 2005, International Business Machines
    00003 // Corporation and others.  All Rights Reserved.
    00004 #ifndef CoinBuild_H
    00005 #define CoinBuild_H
    00006
    00007
    00008 #include "CoinPragma.hpp"
    00009 #include "CoinFinite.hpp"
    00010
    00011
    00024 class CoinBuild {
    00025
    00026 public:
    00029
    00030    void addRow(int numberInRow, const int * columns,
    00031                const double * elements, double rowLower=-COIN_DBL_MAX,
    00032               double rowUpper=COIN_DBL_MAX);
    00034    void addColumn(int numberInColumn, const int * rows,
    00035                   const double * elements,
    00036                   double columnLower=0.0,
    00037                   double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0);
    00039    inline void addCol(int numberInColumn, const int * rows,
    00040                   const double * elements,
    00041                   double columnLower=0.0,
    00042                   double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0)
    00043   { addColumn(numberInColumn, rows, elements, columnLower, columnUpper, objectiveValue);}
    00045   inline int numberRows() const
    00046   { return (type_==0) ? numberItems_ : numberOther_;}
    00048   inline int numberColumns() const
    00049   { return (type_==1) ? numberItems_ : numberOther_;}
    00051   inline CoinBigIndex numberElements() const
    00052   { return numberElements_;}
    00055   int row(int whichRow, double & rowLower, double & rowUpper,
    00056           const int * & indices, const double * & elements) const;
    00060   int currentRow(double & rowLower, double & rowUpper,
    00061           const int * & indices, const double * & elements) const;
    00063   void setCurrentRow(int whichRow);
    00065   int currentRow() const;
    00068   int column(int whichColumn,
    00069              double & columnLower, double & columnUpper,double & objectiveValue,
    00070              const int * & indices, const double * & elements) const;
    00074   int currentColumn( double & columnLower, double & columnUpper,double & objectiveValue,
    00075           const int * & indices, const double * & elements) const;
    00077   void setCurrentColumn(int whichColumn);
    00079   int currentColumn() const;
    00081   inline int type() const
    00082   { return type_;}
    00084
    00085
    00089    CoinBuild();
    00091    CoinBuild(int type);
    00093    ~CoinBuild();
    00095
    00099    CoinBuild(const CoinBuild&);
    00101    CoinBuild& operator=(const CoinBuild&);
    00103 private:
    00105   void setMutableCurrent(int which) const;
    00107    void addItem(int numberInItem, const int * indices,
    00108                   const double * elements,
    00109                   double itemLower,
    00110                   double itemUpper, double objectiveValue);
    00113   int item(int whichItem,
    00114              double & itemLower, double & itemUpper,double & objectiveValue,
    00115              const int * & indices, const double * & elements) const;
    00119   int currentItem( double & itemLower, double & itemUpper,double & objectiveValue,
    00120           const int * & indices, const double * & elements) const;
    00122   void setCurrentItem(int whichItem);
    00124   int currentItem() const;
    00125
    00126 private:
    00129
    00130   int numberItems_;
    00132   int numberOther_;
    00134   CoinBigIndex numberElements_;
    00136   mutable double * currentItem_;
    00138   double * firstItem_;
    00140   double * lastItem_;
    00142   int type_;
    00144 };
    00145
    00146 #endif