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

- File List
- File Members

# /home/coin/SVN-release/Bcps-0.91.0/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 Common 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-2005, International Business Machines                  *
    00021  * Corporation, Lehigh University, Yan Xu, Ted Ralphs, Matthew Salzman and   *
    00022  * others. All Rights Reserved.                                              *
    00023  *===========================================================================*/
    00024
    00025 #ifndef BlisConstraint_h_
    00026 #define BlisConstraint_h_
    00027
    00028 #include "BcpsObject.h"
    00029
    00030 //#############################################################################
    00031
    00032 class BlisConstraint : public BcpsConstraint {
    00033
    00034  private:
    00035
    00036     int size_;
    00037     int *indices_;
    00038     double *values_;
    00039
    00040  public:
    00041
    00043     BlisConstraint();
    00044
    00046     BlisConstraint(int s, const int *ind, const double *val);
    00047
    00049     BlisConstraint(double lbh, double ubh, double lbs, double ubs);
    00050
    00052     BlisConstraint(double lbh, double ubh, double lbs, double ubs,
    00053                    int s, const int *ind, const double *val);
    00055     virtual ~BlisConstraint();
    00056
    00058     BlisConstraint(const BlisConstraint & rhs);
    00059
    00062     int getSize() const       { return size_; }
    00063     int* getIndices() const   { return indices_; }
    00064     double* getValues() const { return values_; }
    00069     void setData(int s, const int *ind, const double *val) {
    00070         if (size_ < s) {
    00071             delete [] indices_;
    00072             delete [] values_;
    00073             indices_ = new int [s];
    00074             values_ = new double [s];
    00075         }
    00076         size_ = s;
    00077         memcpy(indices_, ind, sizeof(int) * s);
    00078         memcpy(values_, val, sizeof(double) * s);
    00079     }
    00082  protected:
    00083
    00085     AlpsReturnStatus encodeBlis(AlpsEncoded *encoded);
    00086
    00088     AlpsReturnStatus decodeBlis(AlpsEncoded &encoded);
    00089
    00090  public:
    00091
    00093     virtual AlpsReturnStatus encode(AlpsEncoded *encoded);
    00094
    00096     virtual AlpsKnowledge* decode(AlpsEncoded& encoded) const;
    00097
    00099     virtual void hashing(BcpsModel *model=NULL);
    00100 };
    00101
    00102 //#############################################################################
    00103
    00104 #endif