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;}
157 CoinYacc() : symtable(NULL), symbuf(NULL), length(0), unsetValue(0) {}
201 void resize(
int maxItems,
bool forceReHash=
false);
205 {
return numberItems_;}
207 void setNumberItems(
int number);
210 {
return maximumItems_;}
212 inline const char *
const *
names()
const 218 int hash(
const char * name)
const;
221 void addHash(
int index,
const char * name);
223 void deleteHash(
int index);
225 const char * name(
int which)
const;
227 char * getName(
int which)
const;
229 void setName(
int which,
char * name ) ;
231 void validateHash()
const;
234 int hashValue(
const char * name)
const;
274 void resize(
int maxItems,
const CoinModelTriple * triples,
bool forceReHash=
false);
278 {
return numberItems_;}
280 void setNumberItems(
int number);
283 {
return maximumItems_;}
291 void addHash(
int index,
int row,
int column,
const CoinModelTriple * triples);
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,
340 int numberMajor,
int numberMinor,
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,
392 int firstFree,
int lastFree,
const int * nextOther);
411 void fill(
int first,
int last);
435 int maximumElements_;
CoinModelLink & operator=(const CoinModelLink &)
=
double value() const
Get value.
void setValue(double value)
Set value.
int rowInTriple(const CoinModelTriple &triple)
~CoinModelLink()
Destructor.
void setOnRow(bool onRow)
Set onRow.
void setRowAndStringInTriple(CoinModelTriple &triple, int iRow, bool string)
int numberItems() const
Number of items.
This is for various structures/classes needed by CoinModel.
int maximumItems() const
Maximum number of items.
int numberMajor() const
Number of major items i.e. rows if just row links.
CoinModelLink()
Default constructor.
void setStringInTriple(CoinModelTriple &triple, bool string)
int maximumElements() const
Maximum number of elements.
int first(int which) const
First on chain.
const char *const * names() const
Names.
int last(int which) const
Last on chain.
int lastFree() const
Last on free chain.
void setPosition(int position)
Set position.
const int * next() const
Next array.
void setColumn(int column)
Set column.
int numberElements() const
Number of elements.
bool stringInTriple(const CoinModelTriple &triple)
void setElement(double value)
Set value.
int maximumMajor() const
Maximum number of major items i.e. rows if just row links.
int position() const
Get position.
bool onRow() const
Get onRow.
int numberItems() const
Number of items i.e. rows if just row names.
const int * previous() const
Previous array.
int column() const
Get column.
void setRowInTriple(CoinModelTriple &triple, int iRow)
void setRow(int row)
Set row.
double element() const
Get value.
int maximumItems() const
Maximum number of items.
int firstFree() const
First on free chain.