6#ifndef CoinShallowPackedVector_H
7#define CoinShallowPackedVector_H
11#pragma warning(disable : 4786)
97 void setVector(
int size,
const int *indices,
const double *elements,
114 const int *indices,
const double *elements,
void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.
Abstract base class for various sparse vectors.
bool testForDuplicateIndex() const
Returns true if the vector should be tested for duplicate indices when they can occur.
virtual ~CoinShallowPackedVector()
Destructor.
const int * indices_
Vector indices.
CoinShallowPackedVector & operator=(const CoinShallowPackedVector &x)
Assignment operator.
CoinShallowPackedVector(const CoinShallowPackedVector &)
Copy constructor.
CoinShallowPackedVector(bool testForDuplicateIndex=true)
Default constructor.
void setVector(int size, const int *indices, const double *elements, bool testForDuplicateIndex=true)
just like the explicit constructor
virtual const int * getIndices() const
Get indices of elements.
const double * elements_
Vector elements.
void clear()
Reset the vector (as if were just created an empty vector)
virtual const double * getElements() const
Get element values.
CoinShallowPackedVector(int size, const int *indices, const double *elements, bool testForDuplicateIndex=true)
Explicit Constructor.
int nElements_
Size of indices and elements vectors.
CoinShallowPackedVector & operator=(const CoinPackedVectorBase &x)
Assignment operator from a CoinPackedVectorBase.
CoinShallowPackedVector(const CoinPackedVectorBase &)
Copy constructor from the base class.
virtual int getNumElements() const
Get length of indices and elements vectors.
friend void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.
void print()
Print vector information.