Ignore:
Timestamp:
Jan 29, 2010 9:25:07 AM (9 years ago)
Author:
forrest
Message:

moving sandbox stuff to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpDummyMatrix.hpp

    r1402 r1502  
    1717
    1818class ClpDummyMatrix : public ClpMatrixBase {
    19  
     19
    2020public:
    21   /**@name Useful methods */
    22    //@{
    23    /// Return a complete CoinPackedMatrix
    24    virtual CoinPackedMatrix * getPackedMatrix() const;
     21    /**@name Useful methods */
     22    //@{
     23    /// Return a complete CoinPackedMatrix
     24    virtual CoinPackedMatrix * getPackedMatrix() const;
    2525    /** Whether the packed matrix is column major ordered or not. */
    26    virtual bool isColOrdered() const { return true; }
    27    /** Number of entries in the packed matrix. */
    28   virtual  CoinBigIndex getNumElements() const
    29   { return numberElements_; }
    30    /** Number of columns. */
    31    virtual int getNumCols() const { return numberColumns_; }
    32    /** Number of rows. */
    33   virtual int getNumRows() const { return numberRows_; }
     26    virtual bool isColOrdered() const {
     27        return true;
     28    }
     29    /** Number of entries in the packed matrix. */
     30    virtual  CoinBigIndex getNumElements() const {
     31        return numberElements_;
     32    }
     33    /** Number of columns. */
     34    virtual int getNumCols() const {
     35        return numberColumns_;
     36    }
     37    /** Number of rows. */
     38    virtual int getNumRows() const {
     39        return numberRows_;
     40    }
    3441
    35    /** A vector containing the elements in the packed matrix. Note that there
    36         might be gaps in this list, entries that do not belong to any
    37         major-dimension vector. To get the actual elements one should look at
    38         this vector together with vectorStarts and vectorLengths. */
    39   virtual const double * getElements() const;
    40    /** A vector containing the minor indices of the elements in the packed
    41         matrix. Note that there might be gaps in this list, entries that do not
    42         belong to any major-dimension vector. To get the actual elements one
    43         should look at this vector together with vectorStarts and
    44         vectorLengths. */
    45   virtual const int * getIndices() const;
     42    /** A vector containing the elements in the packed matrix. Note that there
     43     might be gaps in this list, entries that do not belong to any
     44     major-dimension vector. To get the actual elements one should look at
     45     this vector together with vectorStarts and vectorLengths. */
     46    virtual const double * getElements() const;
     47    /** A vector containing the minor indices of the elements in the packed
     48         matrix. Note that there might be gaps in this list, entries that do not
     49         belong to any major-dimension vector. To get the actual elements one
     50         should look at this vector together with vectorStarts and
     51         vectorLengths. */
     52    virtual const int * getIndices() const;
    4653
    47   virtual const CoinBigIndex * getVectorStarts() const;
    48    /** The lengths of the major-dimension vectors. */
    49   virtual const int * getVectorLengths() const;
     54    virtual const CoinBigIndex * getVectorStarts() const;
     55    /** The lengths of the major-dimension vectors. */
     56    virtual const int * getVectorLengths() const;
    5057
    5158    /** Delete the columns whose indices are listed in <code>indDel</code>. */
    52   virtual void deleteCols(const int numDel, const int * indDel);
     59    virtual void deleteCols(const int numDel, const int * indDel);
    5360    /** Delete the rows whose indices are listed in <code>indDel</code>. */
    54   virtual void deleteRows(const int numDel, const int * indDel);
    55   /** Returns a new matrix in reverse order without gaps */
    56   virtual ClpMatrixBase * reverseOrderedCopy() const;
    57   /// Returns number of elements in column part of basis
    58   virtual CoinBigIndex countBasis(const int * whichColumn,
    59                                   int & numberColumnBasic);
    60   /// Fills in column part of basis
    61   virtual void fillBasis(ClpSimplex * model,
    62                                  const int * whichColumn,
    63                                 int & numberColumnBasic,
    64                                 int * row, int * start,
    65                                 int * rowCount, int * columnCount,
    66                                 CoinFactorizationDouble * element);
    67   /** Unpacks a column into an CoinIndexedvector
    68    */
    69   virtual void unpack(const ClpSimplex * model,CoinIndexedVector * rowArray,
    70                    int column) const ;
    71   /** Unpacks a column into an CoinIndexedvector
    72    ** in packed foramt
    73       Note that model is NOT const.  Bounds and objective could
    74       be modified if doing column generation (just for this variable) */
    75   virtual void unpackPacked(ClpSimplex * model,
    76                             CoinIndexedVector * rowArray,
    77                             int column) const;
    78   /** Adds multiple of a column into an CoinIndexedvector
    79       You can use quickAdd to add to vector */
    80   virtual void add(const ClpSimplex * model,CoinIndexedVector * rowArray,
    81                    int column, double multiplier) const ;
    82   /** Adds multiple of a column into an array */
    83   virtual void add(const ClpSimplex * model,double * array,
    84                    int column, double multiplier) const;
    85    /// Allow any parts of a created CoinMatrix to be deleted
    86   /// Allow any parts of a created CoinPackedMatrix to be deleted
    87    virtual void releasePackedMatrix() const {}
    88    //@}
     61    virtual void deleteRows(const int numDel, const int * indDel);
     62    /** Returns a new matrix in reverse order without gaps */
     63    virtual ClpMatrixBase * reverseOrderedCopy() const;
     64    /// Returns number of elements in column part of basis
     65    virtual CoinBigIndex countBasis(const int * whichColumn,
     66                                    int & numberColumnBasic);
     67    /// Fills in column part of basis
     68    virtual void fillBasis(ClpSimplex * model,
     69                           const int * whichColumn,
     70                          int & numberColumnBasic,
     71                          int * row, int * start,
     72                          int * rowCount, int * columnCount,
     73                          CoinFactorizationDouble * element);
     74    /** Unpacks a column into an CoinIndexedvector
     75     */
     76    virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
     77                        int column) const ;
     78    /** Unpacks a column into an CoinIndexedvector
     79     ** in packed foramt
     80        Note that model is NOT const.  Bounds and objective could
     81        be modified if doing column generation (just for this variable) */
     82    virtual void unpackPacked(ClpSimplex * model,
     83                              CoinIndexedVector * rowArray,
     84                              int column) const;
     85    /** Adds multiple of a column into an CoinIndexedvector
     86        You can use quickAdd to add to vector */
     87    virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
     88                     int column, double multiplier) const ;
     89    /** Adds multiple of a column into an array */
     90    virtual void add(const ClpSimplex * model, double * array,
     91                     int column, double multiplier) const;
     92    /// Allow any parts of a created CoinMatrix to be deleted
     93    /// Allow any parts of a created CoinPackedMatrix to be deleted
     94    virtual void releasePackedMatrix() const {}
     95    //@}
    8996
    90   /**@name Matrix times vector methods */
    91   //@{
     97    /**@name Matrix times vector methods */
     98    //@{
    9299    /** Return <code>y + A * scalar *x</code> in <code>y</code>.
    93100        @pre <code>x</code> must be of size <code>numColumns()</code>
    94101        @pre <code>y</code> must be of size <code>numRows()</code> */
    95   virtual void times(double scalar,
    96                        const double * x, double * y) const;
    97   /// And for scaling
    98   virtual void times(double scalar,
    99                      const double * x, double * y,
    100                      const double * rowScale,
    101                      const double * columnScale) const;
     102    virtual void times(double scalar,
     103                       const double * x, double * y) const;
     104    /// And for scaling
     105    virtual void times(double scalar,
     106                       const double * x, double * y,
     107                       const double * rowScale,
     108                       const double * columnScale) const;
    102109    /** Return <code>y + x * scalar * A</code> in <code>y</code>.
    103110        @pre <code>x</code> must be of size <code>numRows()</code>
    104111        @pre <code>y</code> must be of size <code>numColumns()</code> */
    105112    virtual void transposeTimes(double scalar,
    106                                 const double * x, double * y) const;
    107   /// And for scaling
     113                                const double * x, double * y) const;
     114    /// And for scaling
    108115    virtual void transposeTimes(double scalar,
    109                                 const double * x, double * y,
    110                                 const double * rowScale,
    111                                 const double * columnScale) const;
     116                                const double * x, double * y,
     117                                const double * rowScale,
     118                                const double * columnScale) const;
    112119
    113   using ClpMatrixBase::transposeTimes ;
    114     /** Return <code>x * scalar * A + y</code> in <code>z</code>. 
    115         Can use y as temporary array (will be empty at end)
    116         Note - If x packed mode - then z packed mode */
    117   virtual void transposeTimes(const ClpSimplex * model, double scalar,
    118                               const CoinIndexedVector * x,
    119                               CoinIndexedVector * y,
    120                               CoinIndexedVector * z) const;
     120    using ClpMatrixBase::transposeTimes ;
     121    /** Return <code>x * scalar * A + y</code> in <code>z</code>.
     122    Can use y as temporary array (will be empty at end)
     123    Note - If x packed mode - then z packed mode */
     124    virtual void transposeTimes(const ClpSimplex * model, double scalar,
     125                                const CoinIndexedVector * x,
     126                                CoinIndexedVector * y,
     127                                CoinIndexedVector * z) const;
    121128    /** Return <code>x *A</code> in <code>z</code> but
    122         just for indices in y.
    123         Note - If x packed mode - then z packed mode
    124         Squashes small elements and knows about ClpSimplex */
    125   virtual void subsetTransposeTimes(const ClpSimplex * model,
    126                                     const CoinIndexedVector * x,
    127                                     const CoinIndexedVector * y,
    128                                     CoinIndexedVector * z) const;
    129   //@}
     129    just for indices in y.
     130    Note - If x packed mode - then z packed mode
     131    Squashes small elements and knows about ClpSimplex */
     132    virtual void subsetTransposeTimes(const ClpSimplex * model,
     133                                      const CoinIndexedVector * x,
     134                                      const CoinIndexedVector * y,
     135                                      CoinIndexedVector * z) const;
     136    //@}
    130137
    131   /**@name Other */
    132    //@{
    133    //@}
     138    /**@name Other */
     139    //@{
     140    //@}
    134141
    135142
    136   /**@name Constructors, destructor */
    137    //@{
    138    /** Default constructor. */
    139    ClpDummyMatrix();
    140   /// Constructor with data
    141   ClpDummyMatrix(int numberColumns, int numberRows,
    142                    int numberElements);
    143    /** Destructor */
    144    virtual ~ClpDummyMatrix();
    145    //@}
     143    /**@name Constructors, destructor */
     144    //@{
     145    /** Default constructor. */
     146    ClpDummyMatrix();
     147    /// Constructor with data
     148    ClpDummyMatrix(int numberColumns, int numberRows,
     149                   int numberElements);
     150    /** Destructor */
     151    virtual ~ClpDummyMatrix();
     152    //@}
    146153
    147    /**@name Copy method */
    148    //@{
    149    /** The copy constructor. */
    150    ClpDummyMatrix(const ClpDummyMatrix&);
    151    /** The copy constructor from an CoinDummyMatrix. */
    152    ClpDummyMatrix(const CoinPackedMatrix&);
     154    /**@name Copy method */
     155    //@{
     156    /** The copy constructor. */
     157    ClpDummyMatrix(const ClpDummyMatrix&);
     158    /** The copy constructor from an CoinDummyMatrix. */
     159    ClpDummyMatrix(const CoinPackedMatrix&);
    153160
    154    ClpDummyMatrix& operator=(const ClpDummyMatrix&);
    155   /// Clone
    156   virtual ClpMatrixBase * clone() const ;
    157    //@}
    158    
    159    
     161    ClpDummyMatrix& operator=(const ClpDummyMatrix&);
     162    /// Clone
     163    virtual ClpMatrixBase * clone() const ;
     164    //@}
     165
     166
    160167protected:
    161    /**@name Data members
    162       The data members are protected to allow access for derived classes. */
    163    //@{
    164   /// Number of rows
    165   int numberRows_;
    166   /// Number of columns
    167   int numberColumns_;
    168   /// Number of elements
    169   int numberElements_;
    170  
    171    //@}
     168    /**@name Data members
     169       The data members are protected to allow access for derived classes. */
     170    //@{
     171    /// Number of rows
     172    int numberRows_;
     173    /// Number of columns
     174    int numberColumns_;
     175    /// Number of elements
     176    int numberElements_;
     177
     178    //@}
    172179};
    173180
Note: See TracChangeset for help on using the changeset viewer.