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

- File List
- File Members

# /home/coin/SVN-release/Osi-0.98.1/CoinUtils/src/CoinShallowPackedVector.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2000, International Business Machines
    00002 // Corporation and others.  All Rights Reserved.
    00003 #ifndef CoinShallowPackedVector_H
    00004 #define CoinShallowPackedVector_H
    00005
    00006 #if defined(_MSC_VER)
    00007 // Turn off compiler warning about long names
    00008 #  pragma warning(disable:4786)
    00009 #endif
    00010
    00011 #include "CoinError.hpp"
    00012 #include "CoinPackedVectorBase.hpp"
    00013
    00071 class CoinShallowPackedVector : public CoinPackedVectorBase {
    00072    friend void CoinShallowPackedVectorUnitTest();
    00073
    00074 public:
    00075
    00078
    00079    virtual int getNumElements() const { return nElements_; }
    00081    virtual const int * getIndices() const { return indices_; }
    00083    virtual const double * getElements() const { return elements_; }
    00085
    00088
    00089    void clear();
    00091    CoinShallowPackedVector& operator=(const CoinShallowPackedVector & x);
    00093    CoinShallowPackedVector& operator=(const CoinPackedVectorBase & x);
    00095    void setVector(int size, const int * indices, const double * elements,
    00096                   bool testForDuplicateIndex = true);
    00098
    00102    CoinShallowPackedVector(bool testForDuplicateIndex = true);
    00111    CoinShallowPackedVector(int size,
    00112                           const int * indices, const double * elements,
    00113                           bool testForDuplicateIndex = true);
    00115    CoinShallowPackedVector(const CoinPackedVectorBase &);
    00117    CoinShallowPackedVector(const CoinShallowPackedVector &);
    00119    ~CoinShallowPackedVector() {}
    00121    void print();
    00123
    00124 private:
    00127
    00128    const int * indices_;
    00130    const double * elements_;
    00132    int nElements_;
    00134 };
    00135
    00136 //#############################################################################
    00142 void
    00143 CoinShallowPackedVectorUnitTest();
    00144
    00145 #endif