CoinUtils
2.11.13
Toggle main menu visibility
Loading...
Searching...
No Matches
CoinUtils
src
CoinShallowPackedVector.hpp
Go to the documentation of this file.
1
/* $Id$ */
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
:
80
81
virtual
int
getNumElements
()
const
{
return
nElements_
; }
83
virtual
const
int
*
getIndices
()
const
{
return
indices_
; }
85
virtual
const
double
*
getElements
()
const
{
return
elements_
; }
87
90
91
void
clear
();
93
CoinShallowPackedVector
&
operator=
(
const
CoinShallowPackedVector
&x);
95
CoinShallowPackedVector
&
operator=
(
const
CoinPackedVectorBase
&x);
97
void
setVector
(
int
size,
const
int
*indices,
const
double
*elements,
98
bool
testForDuplicateIndex
=
true
);
100
103
104
CoinShallowPackedVector
(
bool
testForDuplicateIndex
=
true
);
113
CoinShallowPackedVector
(
int
size,
114
const
int
*indices,
const
double
*elements,
115
bool
testForDuplicateIndex
=
true
);
117
CoinShallowPackedVector
(
const
CoinPackedVectorBase
&);
119
CoinShallowPackedVector
(
const
CoinShallowPackedVector
&);
121
virtual
~CoinShallowPackedVector
() {}
123
void
print
();
125
126
private
:
129
130
const
int
*
indices_
;
132
const
double
*
elements_
;
134
int
nElements_
;
136
};
137
138
//#############################################################################
144
void
CoinShallowPackedVectorUnitTest
();
145
146
#endif
147
148
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
149
*/
CoinError.hpp
CoinPackedVectorBase.hpp
CoinShallowPackedVectorUnitTest
void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.
CoinPackedVectorBase::testForDuplicateIndex
bool testForDuplicateIndex() const
Returns true if the vector should be tested for duplicate indices when they can occur.
Definition
CoinPackedVectorBase.hpp:63
CoinPackedVectorBase::CoinPackedVectorBase
CoinPackedVectorBase()
Default constructor.
CoinShallowPackedVector::~CoinShallowPackedVector
virtual ~CoinShallowPackedVector()
Destructor.
Definition
CoinShallowPackedVector.hpp:121
CoinShallowPackedVector::indices_
const int * indices_
Vector indices.
Definition
CoinShallowPackedVector.hpp:130
CoinShallowPackedVector::operator=
CoinShallowPackedVector & operator=(const CoinShallowPackedVector &x)
Assignment operator.
CoinShallowPackedVector::CoinShallowPackedVector
CoinShallowPackedVector(const CoinShallowPackedVector &)
Copy constructor.
CoinShallowPackedVector::CoinShallowPackedVector
CoinShallowPackedVector(bool testForDuplicateIndex=true)
Default constructor.
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:83
CoinShallowPackedVector::elements_
const double * elements_
Vector elements.
Definition
CoinShallowPackedVector.hpp:132
CoinShallowPackedVector::clear
void clear()
Reset the vector (as if were just created an empty vector).
CoinShallowPackedVector::getElements
virtual const double * getElements() const
Get element values.
Definition
CoinShallowPackedVector.hpp:85
CoinShallowPackedVector::CoinShallowPackedVector
CoinShallowPackedVector(int size, const int *indices, const double *elements, bool testForDuplicateIndex=true)
Explicit Constructor.
CoinShallowPackedVector::nElements_
int nElements_
Size of indices and elements vectors.
Definition
CoinShallowPackedVector.hpp:134
CoinShallowPackedVector::operator=
CoinShallowPackedVector & operator=(const CoinPackedVectorBase &x)
Assignment operator from a CoinPackedVectorBase.
CoinShallowPackedVector::CoinShallowPackedVector
CoinShallowPackedVector(const CoinPackedVectorBase &)
Copy constructor from the base class.
CoinShallowPackedVector::getNumElements
virtual int getNumElements() const
Get length of indices and elements vectors.
Definition
CoinShallowPackedVector.hpp:81
CoinShallowPackedVector::CoinShallowPackedVectorUnitTest
friend void CoinShallowPackedVectorUnitTest()
A function that tests the methods in the CoinShallowPackedVector class.
CoinShallowPackedVector::print
void print()
Print vector information.
Generated by
1.17.0