Cgl 0.59.7

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinShallowPackedVector.hpp
Go to the documentation of this file.
1 /* $Id: CoinShallowPackedVector.hpp 1498 2011-11-02 15:25:35Z mjs $ */
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef CoinShallowPackedVector_H
7 #define CoinShallowPackedVector_H
8
9 #if defined(_MSC_VER)
10 // Turn off compiler warning about long names
11 # pragma warning(disable:4786)
12 #endif
13
14 #include "CoinError.hpp"
15 #include "CoinPackedVectorBase.hpp"
16
74 class CoinShallowPackedVector : public CoinPackedVectorBase {
75 friend void CoinShallowPackedVectorUnitTest();
76
77 public:
78
81 virtual int getNumElements() const { return nElements_; }
84 virtual const int * getIndices() const { return indices_; }
86 virtual const double * getElements() const { return elements_; }
88
91 void clear();
94 CoinShallowPackedVector& operator=(const CoinShallowPackedVector & x);
96 CoinShallowPackedVector& operator=(const CoinPackedVectorBase & x);
98 void setVector(int size, const int * indices, const double * elements,
99 bool testForDuplicateIndex = true);
101
105 CoinShallowPackedVector(bool testForDuplicateIndex = true);
114 CoinShallowPackedVector(int size,
115 const int * indices, const double * elements,
116 bool testForDuplicateIndex = true);
118 CoinShallowPackedVector(const CoinPackedVectorBase &);
120 CoinShallowPackedVector(const CoinShallowPackedVector &);
122 virtual ~CoinShallowPackedVector() {}
124 void print();
126
127 private:
130 const int * indices_;
133 const double * elements_;
135 int nElements_;
137 };
138
139 //#############################################################################
145 void
146 CoinShallowPackedVectorUnitTest();
147
148 #endif
CoinShallowPackedVector::print
void print()
Print vector information.
CoinShallowPackedVector::setVector
void setVector(int size, const int *indices, const double *elements, bool testForDuplicateIndex=true)
just like the explicit constructor
CoinShallowPackedVector::getIndices
virtual const int * getIndices() const
Get indices of elements.
Definition: CoinShallowPackedVector.hpp:84
CoinShallowPackedVector::CoinShallowPackedVector
CoinShallowPackedVector(bool testForDuplicateIndex=true)
Default constructor.
CoinShallowPackedVector
Shallow Sparse Vector.
Definition: CoinShallowPackedVector.hpp:74
CoinShallowPackedVector::getElements
virtual const double * getElements() const
Get element values.
Definition: CoinShallowPackedVector.hpp:86
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
CoinError.hpp
CoinPackedVectorBase.hpp
CoinPackedVectorBase::testForDuplicateIndex
bool testForDuplicateIndex() const
Returns true if the vector should be tested for duplicate indices when they can occur.
Definition: CoinPackedVectorBase.hpp:63
CoinShallowPackedVector::CoinShallowPackedVectorUnitTest
friend void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.
CoinShallowPackedVector::indices_
const int * indices_
Vector indices.
Definition: CoinShallowPackedVector.hpp:131
CoinShallowPackedVector::operator=
CoinShallowPackedVector & operator=(const CoinShallowPackedVector &x)
Assignment operator.
CoinShallowPackedVector::elements_
const double * elements_
Vector elements.
Definition: CoinShallowPackedVector.hpp:133
CoinShallowPackedVector::getNumElements
virtual int getNumElements() const
Get length of indices and elements vectors.
Definition: CoinShallowPackedVector.hpp:82
CoinShallowPackedVector::~CoinShallowPackedVector
virtual ~CoinShallowPackedVector()
Destructor.
Definition: CoinShallowPackedVector.hpp:122
CoinShallowPackedVector::clear
void clear()
Reset the vector (as if were just created an empty vector)
CoinShallowPackedVector::nElements_
int nElements_
Size of indices and elements vectors.
Definition: CoinShallowPackedVector.hpp:135
CoinShallowPackedVectorUnitTest
void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.