CoinShallowPackedVector.hpp
Go to the documentation of this file.
1 /* $Id: CoinShallowPackedVector.hpp 1215 2009-11-05 11:03:04Z forrest $ */
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef CoinShallowPackedVector_H
5 #define CoinShallowPackedVector_H
6 
7 #if defined(_MSC_VER)
8 // Turn off compiler warning about long names
9 # pragma warning(disable:4786)
10 #endif
11 
12 #include "CoinError.hpp"
13 #include "CoinPackedVectorBase.hpp"
14 
73  friend void CoinShallowPackedVectorUnitTest();
74 
75 public:
76 
79  virtual int getNumElements() const { return nElements_; }
82  virtual const int * getIndices() const { return indices_; }
84  virtual const double * getElements() const { return elements_; }
86 
89  void clear();
96  void setVector(int size, const int * indices, const double * elements,
97  bool testForDuplicateIndex = true);
99 
112  CoinShallowPackedVector(int size,
113  const int * indices, const double * elements,
114  bool testForDuplicateIndex = true);
122  void print();
124 
125 private:
128  const int * indices_;
131  const double * elements_;
135 };
136 
137 //#############################################################################
143 void
145 
146 #endif