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