Go to the documentation of this file.
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);
212 inline const char *
const *
names()
const
225 const char *
name(
int which)
const;
335 void resize(
int maxMajor,
int maxElements);
339 void create(
int maxMajor,
int maxElements,
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,
void setRowAndStringInTriple(CoinModelTriple &triple, int iRow, bool string)
void updateDeletedOne(int position, const CoinModelTriple *triples)
Update column list for one element when one element deleted from row copy.
int maximumItems_
Maximum number of items.
int * first_
First - maximumMajor+1 long (last free element chain)
~CoinModelLinkedList()
Destructor.
int maximumMajor() const
Maximum number of major items i.e. rows if just row links.
CoinModelHashLink * hash_
hash
~CoinModelHash()
Destructor.
void setStringInTriple(CoinModelTriple &triple, bool string)
int maximumItems_
Maximum number of items.
int hash(const char *name) const
Returns index or -1.
CoinModelLinkedList(const CoinModelLinkedList &)
The copy constructor.
CoinModelHashLink * hash_
hash
void setPosition(int position)
Set position.
void deleteRowOne(int position, CoinModelTriple *triples, CoinModelHash2 &hash)
Deletes one element from Row list.
bool onRow() const
Get onRow.
int numberElements() const
Number of elements.
int numberItems() const
Number of items.
CoinModelHash(const CoinModelHash &)
The copy constructor.
CoinModelHash()
Default constructor.
void addHard(int minorIndex, int numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - hard case i.e.
int numberMajor() const
Number of major items i.e. rows if just row links.
double value() const
Get value.
int maximumMajor_
Maximum number of major items i.e. rows if just row links.
void setName(int which, char *name)
Sets name at position (does not create)
CoinYacc & operator=(const CoinYacc &rhs)
int numberItems_
Number of items.
~CoinModelLink()
Destructor.
void resize(int maxItems, const CoinModelTriple *triples, bool forceReHash=false)
Resize hash (also re-hashs)
CoinYacc(const CoinYacc &rhs)
bool stringInTriple(const CoinModelTriple &triple)
CoinModelLink()
Default constructor.
CoinModelLinkedList & operator=(const CoinModelLinkedList &)
=
void setOnRow(bool onRow)
Set onRow.
void setRowInTriple(CoinModelTriple &triple, int iRow)
const char * name(int which) const
Returns name at position (or NULL)
int hashValue(const char *name) const
Returns a hash value.
void setNumberItems(int number)
Set number of items.
int * next_
Next - maximumElements long.
This is for various structures/classes needed by CoinModel.
CoinModelLink & operator=(const CoinModelLink &)
=
double value_
Value as double.
int maximumItems() const
Maximum number of items.
const char *const * names() const
Names.
void setColumn(int column)
Set column.
const int * next() const
Next array.
int maximumElements() const
Maximum number of elements.
void addHard(int first, const CoinModelTriple *triples, int firstFree, int lastFree, const int *nextOther)
Adds to list - hard case i.e.
int maximumElements_
Maximum number of elements.
~CoinModelHash2()
Destructor.
int * previous_
Previous - maximumElements long.
int column() const
Get column.
void validateHash() const
Validates.
void setValue(double value)
Set value.
char * getName(int which) const
Returns non const name at position (or NULL)
void resize(int maxItems, bool forceReHash=false)
Resize hash (also re-hashs)
void setNumberItems(int number)
Set number of items.
int numberMajor_
Number of major items i.e. rows if just row links.
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.
const int * previous() const
Previous array.
void deleteHash(int index, int row, int column)
Deletes from hash.
CoinModelLinkedList()
Default constructor.
void addHash(int index, int row, int column, const CoinModelTriple *triples)
Adds to hash.
void fill(int first, int last)
Fills first,last with -1.
CoinModelHash2()
Default constructor.
int lastSlot_
Last slot looked at.
CoinModelHash & operator=(const CoinModelHash &)
=
CoinModelLink(const CoinModelLink &)
The copy constructor.
void setRow(int row)
Set row.
int last(int which) const
Last on chain.
int lastFree() const
Last on free chain.
void deleteHash(int index)
Deletes from hash.
int first(int which) const
First on chain.
int numberItems_
Number of items.
int numberElements_
Number of elements.
double element() const
Get value.
int position() const
Get position.
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.
int firstFree() const
First on free chain.
int maximumItems() const
Maximum number of items.
void synchronize(CoinModelLinkedList &other)
Puts in free list from other list.
int position_
Position in data.
bool onRow_
If on row chain.
int rowInTriple(const CoinModelTriple &triple)
int lastSlot_
Last slot looked at.
void resize(int maxMajor, int maxElements)
Resize list - for row list maxMajor is maximum rows.
int hash(int row, int column, const CoinModelTriple *triples) const
Returns index or -1.
CoinModelHash2(const CoinModelHash2 &)
The copy constructor.
int * last_
Last - maximumMajor+1 long (last free element chain)
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 &)
=
int type_
0 row list, 1 column list
int addEasy(int majorIndex, int numberOfElements, const int *indices, const double *elements, CoinModelTriple *triples, CoinModelHash2 &hash)
Adds to list - easy case i.e.
int hashValue(int row, int column) const
Returns a hash value.