Ignore:
Timestamp:
Jan 6, 2019 2:43:06 PM (3 months ago)
Author:
unxusr
Message:

formatting

File:
1 edited

Legend:

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

    r2271 r2385  
    66#ifndef ClpDummyMatrix_H
    77#define ClpDummyMatrix_H
    8 
    98
    109#include "CoinPragma.hpp"
     
    1716*/
    1817
    19 
    2018class ClpDummyMatrix : public ClpMatrixBase {
    2119
    2220public:
    23      /**@name Useful methods */
    24      //@{
    25      /// Return a complete CoinPackedMatrix
    26      virtual CoinPackedMatrix * getPackedMatrix() const;
    27      /** Whether the packed matrix is column major ordered or not. */
    28      virtual bool isColOrdered() const {
    29           return true;
    30      }
    31      /** Number of entries in the packed matrix. */
    32      virtual  CoinBigIndex getNumElements() const {
    33           return numberElements_;
    34      }
    35      /** Number of columns. */
    36      virtual int getNumCols() const {
    37           return numberColumns_;
    38      }
    39      /** Number of rows. */
    40      virtual int getNumRows() const {
    41           return numberRows_;
    42      }
     21  /**@name Useful methods */
     22  //@{
     23  /// Return a complete CoinPackedMatrix
     24  virtual CoinPackedMatrix *getPackedMatrix() const;
     25  /** Whether the packed matrix is column major ordered or not. */
     26  virtual bool isColOrdered() const
     27  {
     28    return true;
     29  }
     30  /** Number of entries in the packed matrix. */
     31  virtual CoinBigIndex getNumElements() const
     32  {
     33    return numberElements_;
     34  }
     35  /** Number of columns. */
     36  virtual int getNumCols() const
     37  {
     38    return numberColumns_;
     39  }
     40  /** Number of rows. */
     41  virtual int getNumRows() const
     42  {
     43    return numberRows_;
     44  }
    4345
    44      /** A vector containing the elements in the packed matrix. Note that there
     46  /** A vector containing the elements in the packed matrix. Note that there
    4547      might be gaps in this list, entries that do not belong to any
    4648      major-dimension vector. To get the actual elements one should look at
    4749      this vector together with vectorStarts and vectorLengths. */
    48      virtual const double * getElements() const;
    49      /** A vector containing the minor indices of the elements in the packed
     50  virtual const double *getElements() const;
     51  /** A vector containing the minor indices of the elements in the packed
    5052          matrix. Note that there might be gaps in this list, entries that do not
    5153          belong to any major-dimension vector. To get the actual elements one
    5254          should look at this vector together with vectorStarts and
    5355          vectorLengths. */
    54      virtual const int * getIndices() const;
     56  virtual const int *getIndices() const;
    5557
    56      virtual const CoinBigIndex * getVectorStarts() const;
    57      /** The lengths of the major-dimension vectors. */
    58      virtual const int * getVectorLengths() const;
     58  virtual const CoinBigIndex *getVectorStarts() const;
     59  /** The lengths of the major-dimension vectors. */
     60  virtual const int *getVectorLengths() const;
    5961
    60      /** Delete the columns whose indices are listed in <code>indDel</code>. */
    61      virtual void deleteCols(const int numDel, const int * indDel);
    62      /** Delete the rows whose indices are listed in <code>indDel</code>. */
    63      virtual void deleteRows(const int numDel, const int * indDel);
    64      /** Returns a new matrix in reverse order without gaps */
    65      virtual ClpMatrixBase * reverseOrderedCopy() const;
    66      /// Returns number of elements in column part of basis
    67      virtual int countBasis(const int * whichColumn,
    68                                      int & numberColumnBasic);
    69      /// Fills in column part of basis
    70      virtual void fillBasis(ClpSimplex * model,
    71                             const int * whichColumn,
    72                             int & numberColumnBasic,
    73                             int * row, int * start,
    74                             int * rowCount, int * columnCount,
    75                             CoinFactorizationDouble * element);
    76      /** Unpacks a column into an CoinIndexedvector
     62  /** Delete the columns whose indices are listed in <code>indDel</code>. */
     63  virtual void deleteCols(const int numDel, const int *indDel);
     64  /** Delete the rows whose indices are listed in <code>indDel</code>. */
     65  virtual void deleteRows(const int numDel, const int *indDel);
     66  /** Returns a new matrix in reverse order without gaps */
     67  virtual ClpMatrixBase *reverseOrderedCopy() const;
     68  /// Returns number of elements in column part of basis
     69  virtual int countBasis(const int *whichColumn,
     70    int &numberColumnBasic);
     71  /// Fills in column part of basis
     72  virtual void fillBasis(ClpSimplex *model,
     73    const int *whichColumn,
     74    int &numberColumnBasic,
     75    int *row, int *start,
     76    int *rowCount, int *columnCount,
     77    CoinFactorizationDouble *element);
     78  /** Unpacks a column into an CoinIndexedvector
    7779      */
    78      virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
    79                          int column) const ;
    80      /** Unpacks a column into an CoinIndexedvector
     80  virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray,
     81    int column) const;
     82  /** Unpacks a column into an CoinIndexedvector
    8183      ** in packed foramt
    8284         Note that model is NOT const.  Bounds and objective could
    8385         be modified if doing column generation (just for this variable) */
    84      virtual void unpackPacked(ClpSimplex * model,
    85                                CoinIndexedVector * rowArray,
    86                                int column) const;
    87      /** Adds multiple of a column into an CoinIndexedvector
     86  virtual void unpackPacked(ClpSimplex *model,
     87    CoinIndexedVector *rowArray,
     88    int column) const;
     89  /** Adds multiple of a column into an CoinIndexedvector
    8890         You can use quickAdd to add to vector */
    89      virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
    90                       int column, double multiplier) const ;
    91      /** Adds multiple of a column into an array */
    92      virtual void add(const ClpSimplex * model, double * array,
    93                       int column, double multiplier) const;
    94      /// Allow any parts of a created CoinMatrix to be deleted
    95      /// Allow any parts of a created CoinPackedMatrix to be deleted
    96      virtual void releasePackedMatrix() const {}
    97      //@}
     91  virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray,
     92    int column, double multiplier) const;
     93  /** Adds multiple of a column into an array */
     94  virtual void add(const ClpSimplex *model, double *array,
     95    int column, double multiplier) const;
     96  /// Allow any parts of a created CoinMatrix to be deleted
     97  /// Allow any parts of a created CoinPackedMatrix to be deleted
     98  virtual void releasePackedMatrix() const {}
     99  //@}
    98100
    99      /**@name Matrix times vector methods */
    100      //@{
    101      /** Return <code>y + A * scalar *x</code> in <code>y</code>.
     101  /**@name Matrix times vector methods */
     102  //@{
     103  /** Return <code>y + A * scalar *x</code> in <code>y</code>.
    102104         @pre <code>x</code> must be of size <code>numColumns()</code>
    103105         @pre <code>y</code> must be of size <code>numRows()</code> */
    104      virtual void times(double scalar,
    105                         const double * x, double * y) const;
    106      /// And for scaling
    107      virtual void times(double scalar,
    108                         const double * x, double * y,
    109                         const double * rowScale,
    110                         const double * columnScale) const;
    111      /** Return <code>y + x * scalar * A</code> in <code>y</code>.
     106  virtual void times(double scalar,
     107    const double *x, double *y) const;
     108  /// And for scaling
     109  virtual void times(double scalar,
     110    const double *x, double *y,
     111    const double *rowScale,
     112    const double *columnScale) const;
     113  /** Return <code>y + x * scalar * A</code> in <code>y</code>.
    112114         @pre <code>x</code> must be of size <code>numRows()</code>
    113115         @pre <code>y</code> must be of size <code>numColumns()</code> */
    114      virtual void transposeTimes(double scalar,
    115                                  const double * x, double * y) const;
    116      /// And for scaling
    117      virtual void transposeTimes(double scalar,
    118                                  const double * x, double * y,
    119                                  const double * rowScale,
    120                                  const double * columnScale) const;
     116  virtual void transposeTimes(double scalar,
     117    const double *x, double *y) const;
     118  /// And for scaling
     119  virtual void transposeTimes(double scalar,
     120    const double *x, double *y,
     121    const double *rowScale,
     122    const double *columnScale) const;
    121123
    122      using ClpMatrixBase::transposeTimes ;
    123      /** Return <code>x * scalar * A + y</code> in <code>z</code>.
     124  using ClpMatrixBase::transposeTimes;
     125  /** Return <code>x * scalar * A + y</code> in <code>z</code>.
    124126     Can use y as temporary array (will be empty at end)
    125127     Note - If x packed mode - then z packed mode */
    126      virtual void transposeTimes(const ClpSimplex * model, double scalar,
    127                                  const CoinIndexedVector * x,
    128                                  CoinIndexedVector * y,
    129                                  CoinIndexedVector * z) const;
    130      /** Return <code>x *A</code> in <code>z</code> but
     128  virtual void transposeTimes(const ClpSimplex *model, double scalar,
     129    const CoinIndexedVector *x,
     130    CoinIndexedVector *y,
     131    CoinIndexedVector *z) const;
     132  /** Return <code>x *A</code> in <code>z</code> but
    131133     just for indices in y.
    132134     Note - If x packed mode - then z packed mode
    133135     Squashes small elements and knows about ClpSimplex */
    134      virtual void subsetTransposeTimes(const ClpSimplex * model,
    135                                        const CoinIndexedVector * x,
    136                                        const CoinIndexedVector * y,
    137                                        CoinIndexedVector * z) const;
    138      //@}
     136  virtual void subsetTransposeTimes(const ClpSimplex *model,
     137    const CoinIndexedVector *x,
     138    const CoinIndexedVector *y,
     139    CoinIndexedVector *z) const;
     140  //@}
    139141
    140      /**@name Other */
    141      //@{
    142      //@}
     142  /**@name Other */
     143  //@{
     144  //@}
    143145
     146  /**@name Constructors, destructor */
     147  //@{
     148  /** Default constructor. */
     149  ClpDummyMatrix();
     150  /// Constructor with data
     151  ClpDummyMatrix(int numberColumns, int numberRows,
     152    int numberElements);
     153  /** Destructor */
     154  virtual ~ClpDummyMatrix();
     155  //@}
    144156
    145      /**@name Constructors, destructor */
    146      //@{
    147      /** Default constructor. */
    148      ClpDummyMatrix();
    149      /// Constructor with data
    150      ClpDummyMatrix(int numberColumns, int numberRows,
    151                     int numberElements);
    152      /** Destructor */
    153      virtual ~ClpDummyMatrix();
    154      //@}
     157  /**@name Copy method */
     158  //@{
     159  /** The copy constructor. */
     160  ClpDummyMatrix(const ClpDummyMatrix &);
     161  /** The copy constructor from an CoinDummyMatrix. */
     162  ClpDummyMatrix(const CoinPackedMatrix &);
    155163
    156      /**@name Copy method */
    157      //@{
    158      /** The copy constructor. */
    159      ClpDummyMatrix(const ClpDummyMatrix&);
    160      /** The copy constructor from an CoinDummyMatrix. */
    161      ClpDummyMatrix(const CoinPackedMatrix&);
    162 
    163      ClpDummyMatrix& operator=(const ClpDummyMatrix&);
    164      /// Clone
    165      virtual ClpMatrixBase * clone() const ;
    166      //@}
    167 
     164  ClpDummyMatrix &operator=(const ClpDummyMatrix &);
     165  /// Clone
     166  virtual ClpMatrixBase *clone() const;
     167  //@}
    168168
    169169protected:
    170      /**@name Data members
     170  /**@name Data members
    171171        The data members are protected to allow access for derived classes. */
    172      //@{
    173      /// Number of rows
    174      int numberRows_;
    175      /// Number of columns
    176      int numberColumns_;
    177      /// Number of elements
    178      int numberElements_;
     172  //@{
     173  /// Number of rows
     174  int numberRows_;
     175  /// Number of columns
     176  int numberColumns_;
     177  /// Number of elements
     178  int numberElements_;
    179179
    180      //@}
     180  //@}
    181181};
    182182
    183183#endif
     184
     185/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     186*/
Note: See TracChangeset for help on using the changeset viewer.