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/ClpConstraintQuadratic.hpp

    r1665 r2385  
    1818
    1919public:
     20  ///@name Stuff
     21  //@{
    2022
    21      ///@name Stuff
    22      //@{
    23 
    24 
    25      /** Fills gradient.  If Quadratic then solution may be NULL,
     23  /** Fills gradient.  If Quadratic then solution may be NULL,
    2624         also returns true value of function and offset so we can use x not deltaX in constraint
    2725         If refresh is false then uses last solution
     
    2927         Returns non-zero if gradient udefined at current solution
    3028     */
    31      virtual int gradient(const ClpSimplex * model,
    32                           const double * solution,
    33                           double * gradient,
    34                           double & functionValue ,
    35                           double & offset,
    36                           bool useScaling = false,
    37                           bool refresh = true) const ;
    38      /// Resize constraint
    39      virtual void resize(int newNumberColumns) ;
    40      /// Delete columns in  constraint
    41      virtual void deleteSome(int numberToDelete, const int * which) ;
    42      /// Scale constraint
    43      virtual void reallyScale(const double * columnScale) ;
    44      /** Given a zeroed array sets nonquadratic columns to 1.
     29  virtual int gradient(const ClpSimplex *model,
     30    const double *solution,
     31    double *gradient,
     32    double &functionValue,
     33    double &offset,
     34    bool useScaling = false,
     35    bool refresh = true) const;
     36  /// Resize constraint
     37  virtual void resize(int newNumberColumns);
     38  /// Delete columns in  constraint
     39  virtual void deleteSome(int numberToDelete, const int *which);
     40  /// Scale constraint
     41  virtual void reallyScale(const double *columnScale);
     42  /** Given a zeroed array sets nonquadratic columns to 1.
    4543         Returns number of nonquadratic columns
    4644      */
    47      virtual int markNonlinear(char * which) const ;
    48      /** Given a zeroed array sets possible nonzero coefficients to 1.
     45  virtual int markNonlinear(char *which) const;
     46  /** Given a zeroed array sets possible nonzero coefficients to 1.
    4947         Returns number of nonzeros
    5048      */
    51      virtual int markNonzero(char * which) const;
    52      //@}
     49  virtual int markNonzero(char *which) const;
     50  //@}
    5351
     52  ///@name Constructors and destructors
     53  //@{
     54  /// Default Constructor
     55  ClpConstraintQuadratic();
    5456
    55      ///@name Constructors and destructors
    56      //@{
    57      /// Default Constructor
    58      ClpConstraintQuadratic();
     57  /// Constructor from quadratic
     58  ClpConstraintQuadratic(int row, int numberQuadraticColumns, int numberColumns,
     59    const CoinBigIndex *start,
     60    const int *column, const double *element);
    5961
    60      /// Constructor from quadratic
    61      ClpConstraintQuadratic(int row, int numberQuadraticColumns, int numberColumns,
    62                             const CoinBigIndex * start,
    63                             const int * column, const double * element);
     62  /** Copy constructor .
     63     */
     64  ClpConstraintQuadratic(const ClpConstraintQuadratic &rhs);
    6465
    65      /** Copy constructor .
    66      */
    67      ClpConstraintQuadratic(const ClpConstraintQuadratic & rhs);
     66  /// Assignment operator
     67  ClpConstraintQuadratic &operator=(const ClpConstraintQuadratic &rhs);
    6868
    69      /// Assignment operator
    70      ClpConstraintQuadratic & operator=(const ClpConstraintQuadratic& rhs);
     69  /// Destructor
     70  virtual ~ClpConstraintQuadratic();
    7171
    72      /// Destructor
    73      virtual ~ClpConstraintQuadratic ();
     72  /// Clone
     73  virtual ClpConstraint *clone() const;
     74  //@}
     75  ///@name Gets and sets
     76  //@{
     77  /// Number of coefficients
     78  virtual int numberCoefficients() const;
     79  /// Number of columns in constraint
     80  inline int numberColumns() const
     81  {
     82    return numberColumns_;
     83  }
     84  /// Column starts
     85  inline CoinBigIndex *start() const
     86  {
     87    return start_;
     88  }
     89  /// Columns
     90  inline const int *column() const
     91  {
     92    return column_;
     93  }
     94  /// Coefficients
     95  inline const double *coefficient() const
     96  {
     97    return coefficient_;
     98  }
     99  //@}
    74100
    75      /// Clone
    76      virtual ClpConstraint * clone() const;
    77      //@}
    78      ///@name Gets and sets
    79      //@{
    80      /// Number of coefficients
    81      virtual int numberCoefficients() const;
    82      /// Number of columns in constraint
    83      inline int numberColumns() const {
    84           return numberColumns_;
    85      }
    86      /// Column starts
    87      inline CoinBigIndex * start() const {
    88           return start_;
    89      }
    90      /// Columns
    91      inline const int * column() const {
    92           return column_;
    93      }
    94      /// Coefficients
    95      inline const double * coefficient() const {
    96           return coefficient_;
    97      }
    98      //@}
    99 
    100      //---------------------------------------------------------------------------
     101  //---------------------------------------------------------------------------
    101102
    102103private:
    103      ///@name Private member data
    104      /// Column starts
    105      CoinBigIndex * start_;
    106      /// Column (if -1 then linear coefficient)
    107      int * column_;
    108      /// Coefficients
    109      double * coefficient_;
    110      /// Useful to have number of columns about
    111      int numberColumns_;
    112      /// Number of coefficients in gradient
    113      int numberCoefficients_;
    114      /// Number of quadratic columns
    115      int numberQuadraticColumns_;
    116      //@}
     104  ///@name Private member data
     105  /// Column starts
     106  CoinBigIndex *start_;
     107  /// Column (if -1 then linear coefficient)
     108  int *column_;
     109  /// Coefficients
     110  double *coefficient_;
     111  /// Useful to have number of columns about
     112  int numberColumns_;
     113  /// Number of coefficients in gradient
     114  int numberCoefficients_;
     115  /// Number of quadratic columns
     116  int numberQuadraticColumns_;
     117  //@}
    117118};
    118119
    119120#endif
     121
     122/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     123*/
Note: See TracChangeset for help on using the changeset viewer.