6 #ifndef CoinModelUseful_H 7 #define CoinModelUseful_H 51 inline int row()
const 116 {
return triple.
row&0x7fffffff;}
118 { triple.
row = iRow|(triple.
row&0x80000000);}
120 {
return (triple.
row&0x80000000)!=0;}
122 { triple.
row = (
string ? 0x80000000 : 0)|(triple.
row&0x7fffffff);}
124 int iRow,
bool string)
125 { triple.
row = (
string ? 0x80000000 : 0)|iRow;}
201 void resize(
int maxItems,
bool forceReHash=
false);
205 {
return numberItems_;}
210 {
return maximumItems_;}
212 inline const char *
const *
names()
const 225 const char *
name(
int which)
const;
227 char *
getName(
int which)
const;
234 int hashValue(
const char *
name)
const;
278 {
return numberItems_;}
283 {
return maximumItems_;}
293 void deleteHash(
int index,
int row,
int column);
296 int hashValue(
int row,
int column)
const;
335 void resize(
int maxMajor,
int maxElements);
339 void create(
int maxMajor,
int maxElements,
345 {
return numberMajor_;}
348 {
return maximumMajor_;}
351 {
return numberElements_;}
354 {
return maximumElements_;}
357 {
return first_[maximumMajor_];}
360 {
return last_[maximumMajor_];}
363 {
return first_[which];}
365 inline int last(
int which)
const 366 {
return last_[which];}
368 inline const int *
next()
const 380 int addEasy(
int majorIndex,
int numberOfElements,
const int * indices,
385 void addHard(
int minorIndex,
int numberOfElements,
const int * indices,
435 int maximumElements_;
CoinModelLink & operator=(const CoinModelLink &)
=
void setValue(double value)
Set value.
void setNumberItems(int number)
Set number of items.
CoinModelHash & operator=(const CoinModelHash &)
=
int rowInTriple(const CoinModelTriple &triple)
~CoinModelLink()
Destructor.
void setOnRow(bool onRow)
Set onRow.
void resize(int maxItems, bool forceReHash=false)
Resize hash (also re-hashs)
void setRowAndStringInTriple(CoinModelTriple &triple, int iRow, bool string)
This is for various structures/classes needed by CoinModel.
void resize(int maxItems, const CoinModelTriple *triples, bool forceReHash=false)
Resize hash (also re-hashs)
const int * next() const
Next array.
int column() const
Get column.
void deleteHash(int index)
Deletes from hash.
void updateDeleted(int which, CoinModelTriple *triples, CoinModelLinkedList &otherList)
Deletes from list - other case i.e.
void fill(int first, int last)
Fills first,last with -1.
void synchronize(CoinModelLinkedList &other)
Puts in free list from other list.
double value() const
Get value.
int maximumItems() const
Maximum number of items.
int addEasy(int majorIndex, int numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - easy case i.e.
bool onRow() const
Get onRow.
void deleteRowOne(int position, CoinModelTriple *triples, CoinModelHash2 &hash)
Deletes one element from Row list.
void addHash(int index, int row, int column, const CoinModelTriple *triples)
Adds to hash.
~CoinModelLinkedList()
Destructor.
CoinModelLink()
Default constructor.
void setStringInTriple(CoinModelTriple &triple, bool string)
CoinModelLinkedList()
Default constructor.
int hash(int row, int column, const CoinModelTriple *triples) const
Returns index or -1.
void updateDeletedOne(int position, const CoinModelTriple *triples)
Update column list for one element when one element deleted from row copy.
void create(int maxMajor, int maxElements, int numberMajor, int numberMinor, int type, int numberElements, const CoinModelTriple *triples)
Create list - for row list maxMajor is maximum rows.
void setNumberItems(int number)
Set number of items.
int hash(const char *name) const
Returns index or -1.
int lastFree() const
Last on free chain.
CoinModelHash()
Default constructor.
void setPosition(int position)
Set position.
~CoinModelHash()
Destructor.
void setColumn(int column)
Set column.
bool stringInTriple(const CoinModelTriple &triple)
void setElement(double value)
Set value.
int first(int which) const
First on chain.
const char * name(int which) const
Returns name at position (or NULL)
int maximumElements() const
Maximum number of elements.
int maximumItems() const
Maximum number of items.
void setName(int which, char *name)
Sets name at position (does not create)
int numberItems() const
Number of items i.e. rows if just row names.
void setRowInTriple(CoinModelTriple &triple, int iRow)
const char *const * names() const
Names.
void addHard(int minorIndex, int numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - hard case i.e.
int firstFree() const
First on free chain.
void deleteSame(int which, CoinModelTriple *triples, CoinModelHash2 &hash, bool zapTriples)
Deletes from list - same case i.e.
void setRow(int row)
Set row.
int numberMajor() const
Number of major items i.e. rows if just row links.
int numberElements() const
Number of elements.
CoinModelHash2 & operator=(const CoinModelHash2 &)
=
int last(int which) const
Last on chain.
void validateHash() const
Validates.
CoinModelHash2()
Default constructor.
CoinModelLinkedList & operator=(const CoinModelLinkedList &)
=
double element() const
Get value.
int position() const
Get position.
const int * previous() const
Previous array.
int numberItems() const
Number of items.
int maximumMajor() const
Maximum number of major items i.e. rows if just row links.
void addHash(int index, const char *name)
Adds to hash.
char * getName(int which) const
Returns non const name at position (or NULL)
void validateLinks(const CoinModelTriple *triples) const
Checks that links are consistent.
void deleteHash(int index, int row, int column)
Deletes from hash.
~CoinModelHash2()
Destructor.
void resize(int maxMajor, int maxElements)
Resize list - for row list maxMajor is maximum rows.