Go to the documentation of this file.
6 #ifndef CoinModelUseful_H
7 #define CoinModelUseful_H
50 inline int row()
const
140 return triple.
row & 0x7fffffff;
144 triple.
row = iRow | (triple.
row & 0x80000000);
148 return (triple.
row & 0x80000000) != 0;
152 triple.
row = (
string ? 0x80000000 : 0) | (triple.
row & 0x7fffffff);
155 int iRow,
bool string)
157 triple.
row = (
string ? 0x80000000 : 0) | iRow;
241 void resize(
int maxItems,
bool forceReHash =
false);
253 return maximumItems_;
256 inline const char *
const *
names()
const
271 const char *
name(
int which)
const;
273 char *
getName(
int which)
const;
281 int hashValue(
const char *
name)
const;
334 return maximumItems_;
405 return maximumMajor_;
410 return numberElements_;
415 return maximumElements_;
420 return first_[maximumMajor_];
425 return last_[maximumMajor_];
430 return first_[which];
void setRowAndStringInTriple(CoinModelTriple &triple, int iRow, bool string)
CoinBigIndex maximumElements() const
Maximum number of elements.
~CoinModelLinkedList()
Destructor.
int maximumMajor() const
Maximum number of major items i.e. rows if just row links.
~CoinModelHash()
Destructor.
void setStringInTriple(CoinModelTriple &triple, bool string)
CoinBigIndex lastFree() const
Last on free chain.
int hash(const char *name) const
Returns index or -1.
const CoinBigIndex * previous() const
Previous array.
bool onRow() const
Get onRow.
void deleteRowOne(CoinBigIndex position, CoinModelTriple *triples, CoinModelHash2 &hash)
Deletes one element from Row list.
CoinModelHash()
Default constructor.
int numberMajor() const
Number of major items i.e. rows if just row links.
CoinBigIndex position() const
Get position.
double value() const
Get value.
void updateDeletedOne(CoinBigIndex position, const CoinModelTriple *triples)
Update column list for one element when one element deleted from row copy.
const char *const * names() const
Names.
void setName(int which, char *name)
Sets name at position (does not create)
void addHash(CoinBigIndex index, int row, int column, const CoinModelTriple *triples)
Adds to hash.
~CoinModelLink()
Destructor.
bool stringInTriple(const CoinModelTriple &triple)
CoinModelLink()
Default constructor.
CoinModelLinkedList & operator=(const CoinModelLinkedList &)
=
void setOnRow(bool onRow)
Set onRow.
void setRowInTriple(CoinModelTriple &triple, int iRow)
CoinBigIndex numberItems() const
Number of items.
const char * name(int which) const
Returns name at position (or NULL)
void setNumberItems(int number)
Set number of items.
void setNumberItems(CoinBigIndex number)
Set number of items.
This is for various structures/classes needed by CoinModel.
CoinModelLink & operator=(const CoinModelLink &)
=
void setColumn(int column)
Set column.
CoinBigIndex firstFree() const
First on free chain.
CoinBigIndex last(int which) const
Last on chain.
~CoinModelHash2()
Destructor.
int column() const
Get column.
void validateHash() const
Validates.
const CoinBigIndex * next() const
Next array.
void setValue(double value)
Set value.
CoinBigIndex addEasy(int majorIndex, CoinBigIndex numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - easy case i.e.
char * getName(int which) const
Returns non const name at position (or NULL)
void resize(CoinBigIndex maxItems, const CoinModelTriple *triples, bool forceReHash=false)
Resize hash (also re-hashs)
void resize(int maxItems, bool forceReHash=false)
Resize hash (also re-hashs)
void updateDeleted(int which, CoinModelTriple *triples, CoinModelLinkedList &otherList)
Deletes from list - other case i.e.
void validateLinks(const CoinModelTriple *triples) const
Checks that links are consistent.
void addHash(int index, const char *name)
Adds to hash.
CoinModelLinkedList()
Default constructor.
void resize(int maxMajor, CoinBigIndex maxElements)
Resize list - for row list maxMajor is maximum rows.
void fill(int first, int last)
Fills first,last with -1.
CoinModelHash2()
Default constructor.
void create(int maxMajor, CoinBigIndex maxElements, int numberMajor, int numberMinor, int type, CoinBigIndex numberElements, const CoinModelTriple *triples)
Create list - for row list maxMajor is maximum rows.
void addHard(int minorIndex, CoinBigIndex numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - hard case i.e.
CoinBigIndex first(int which) const
First on chain.
CoinBigIndex numberElements() const
Number of elements.
void deleteHash(CoinBigIndex index, int row, int column)
Deletes from hash.
CoinModelHash & operator=(const CoinModelHash &)
=
void setRow(int row)
Set row.
CoinBigIndex maximumItems() const
Maximum number of items.
void deleteHash(int index)
Deletes from hash.
void setPosition(CoinBigIndex position)
Set position.
double element() const
Get value.
int maximumItems() const
Maximum number of items.
void synchronize(CoinModelLinkedList &other)
Puts in free list from other list.
CoinBigIndex hash(int row, int column, const CoinModelTriple *triples) const
Returns index or -1.
int rowInTriple(const CoinModelTriple &triple)
void setElement(double value)
Set value.
int numberItems() const
Number of items i.e. rows if just row names.
void deleteSame(int which, CoinModelTriple *triples, CoinModelHash2 &hash, bool zapTriples)
Deletes from list - same case i.e.
CoinModelHash2 & operator=(const CoinModelHash2 &)
=