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

- File List
- File Members

# /home/coin/svn-release/Bcps-0.93.10/Bcps/examples/Blis/BlisConstraint.h

Go to the documentation of this file.

    00001 /*===========================================================================*
    00002  * This file is part of the Bcps Linear Solver (BLIS).                       *
    00003  *                                                                           *
    00004  * BLIS is distributed under the Eclipse Public License as part of the       *
    00005  * COIN-OR repository (http://www.coin-or.org).                              *
    00006  *                                                                           *
    00007  * Authors:                                                                  *
    00008  *                                                                           *
    00009  *          Yan Xu, Lehigh University                                        *
    00010  *          Ted Ralphs, Lehigh University                                    *
    00011  *                                                                           *
    00012  * Conceptual Design:                                                        *
    00013  *                                                                           *
    00014  *          Yan Xu, Lehigh University                                        *
    00015  *          Ted Ralphs, Lehigh University                                    *
    00016  *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
    00017  *          Matthew Saltzman, Clemson University                             *
    00018  *                                                                           *
    00019  *                                                                           *
    00020  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs.       *
    00021  * All Rights Reserved.                                                      *
    00022  *===========================================================================*/
    00023
    00024 #ifndef BlisConstraint_h_
    00025 #define BlisConstraint_h_
    00026
    00027 #include "BcpsObject.h"
    00028
    00029 //#############################################################################
    00030
    00031 class BlisConstraint : public BcpsConstraint {
    00032
    00033  private:
    00034
    00035     int size_;
    00036     int *indices_;
    00037     double *values_;
    00038
    00039  public:
    00040
    00042     BlisConstraint();
    00043
    00045     BlisConstraint(int s, const int *ind, const double *val);
    00046
    00048     BlisConstraint(double lbh, double ubh, double lbs, double ubs);
    00049
    00051     BlisConstraint(double lbh, double ubh, double lbs, double ubs,
    00052                    int s, const int *ind, const double *val);
    00054     virtual ~BlisConstraint();
    00055
    00057     BlisConstraint(const BlisConstraint & rhs);
    00058
    00061     int getSize() const       { return size_; }
    00062     int* getIndices() const   { return indices_; }
    00063     double* getValues() const { return values_; }
    00068     void setData(int s, const int *ind, const double *val) {
    00069         if (size_ < s) {
    00070             delete [] indices_;
    00071             delete [] values_;
    00072             indices_ = new int [s];
    00073             values_ = new double [s];
    00074         }
    00075         size_ = s;
    00076         memcpy(indices_, ind, sizeof(int) * s);
    00077         memcpy(values_, val, sizeof(double) * s);
    00078     }
    00081  protected:
    00082
    00084     AlpsReturnStatus encodeBlis(AlpsEncoded *encoded);
    00085
    00087     AlpsReturnStatus decodeBlis(AlpsEncoded &encoded);
    00088
    00089  public:
    00090
    00092     virtual AlpsReturnStatus encode(AlpsEncoded *encoded);
    00093
    00095     virtual AlpsKnowledge* decode(AlpsEncoded& encoded) const;
    00096
    00098     virtual void hashing(BcpsModel *model=NULL);
    00099 };
    00100
    00101 //#############################################################################
    00102
    00103 #endif