# 1 "spxtcl.cc" # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 50 "spxtcl.cc" 2 # 1 "/home2/paubert/logiciels/egcs/include/g++/iostream.h" 1 3 #pragma interface # 1 "/home2/paubert/logiciels/egcs/include/g++/streambuf.h" 1 3 #pragma interface extern "C" { # 1 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 1 3 # 1 "/home2/paubert/logiciels/egcs/hppa1.1-hp-hpux10.20/include/_G_config.h" 1 3 typedef int _G_int8_t __attribute__((__mode__(__QI__))); typedef unsigned int _G_uint8_t __attribute__((__mode__(__QI__))); typedef int _G_int16_t __attribute__((__mode__(__HI__))); typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__))); typedef int _G_int32_t __attribute__((__mode__(__SI__))); typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__))); typedef int _G_int64_t __attribute__((__mode__(__DI__))); typedef unsigned int _G_uint64_t __attribute__((__mode__(__DI__))); __extension__ typedef long long _G_llong; __extension__ typedef unsigned long long _G_ullong; typedef unsigned int _G_clock_t; typedef int _G_dev_t; typedef int _G_fpos_t; typedef int _G_gid_t; typedef unsigned int _G_ino_t; typedef unsigned short _G_mode_t; typedef unsigned short _G_nlink_t; typedef int _G_off_t; typedef int _G_pid_t; typedef int _G_ptrdiff_t; typedef int _G_sigset_t; typedef unsigned int _G_size_t; typedef int _G_time_t; typedef int _G_uid_t; typedef unsigned int _G_wchar_t; typedef int _G_ssize_t; typedef unsigned int _G_wint_t; typedef void * _G_va_list; # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 1 3 # 19 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 61 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 131 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 184 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 258 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 270 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 302 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stddef.h" 3 # 84 "/home2/paubert/logiciels/egcs/hppa1.1-hp-hpux10.20/include/_G_config.h" 2 3 # 30 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 2 3 # 51 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 3 # 92 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 3 struct _IO_jump_t; struct _IO_FILE; # 162 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 3 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 195 "/home2/paubert/logiciels/egcs/include/g++/libio.h" 3 }; struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _blksize; _G_off_t _offset; unsigned short _cur_column; char _unused; char _shortbuf[1]; }; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_; typedef struct { _G_ssize_t (*read) (struct _IO_FILE *, void *, _G_ssize_t ) ; _G_ssize_t (*write) (struct _IO_FILE *, const void *, _G_ssize_t ) ; _G_fpos_t (*seek) (struct _IO_FILE *, _G_off_t , int) ; int (*close) (struct _IO_FILE *) ; } _IO_cookie_io_functions_t; struct _IO_cookie_file { struct _IO_FILE file; const void *vtable; void *cookie; _IO_cookie_io_functions_t io_functions; }; extern "C" { extern int __underflow (_IO_FILE *) ; extern int __uflow (_IO_FILE *) ; extern int __overflow (_IO_FILE *, int) ; extern int _IO_getc (_IO_FILE *__fp) ; extern int _IO_putc (int __c, _IO_FILE *__fp) ; extern int _IO_feof (_IO_FILE *__fp) ; extern int _IO_ferror (_IO_FILE *__fp) ; extern int _IO_peekc_locked (_IO_FILE *__fp) ; extern void _IO_flockfile (_IO_FILE *) ; extern void _IO_funlockfile (_IO_FILE *) ; extern int _IO_ftrylockfile (_IO_FILE *) ; extern int _IO_vfscanf (_IO_FILE *, const char *, _G_va_list , int *) ; extern int _IO_vfprintf (_IO_FILE *, const char *, _G_va_list ) ; extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ; extern _G_size_t _IO_sgetn (_IO_FILE *, void *, _G_size_t ) ; extern _G_fpos_t _IO_seekoff (_IO_FILE *, _G_off_t , int, int) ; extern _G_fpos_t _IO_seekpos (_IO_FILE *, _G_fpos_t , int) ; extern void _IO_free_backup_area (_IO_FILE *) ; } # 36 "/home2/paubert/logiciels/egcs/include/g++/streambuf.h" 2 3 } extern "C++" { class istream; class ostream; class streambuf; typedef _G_off_t streamoff; typedef _G_fpos_t streampos; typedef _G_ssize_t streamsize; typedef unsigned long __fmtflags; typedef unsigned char __iostate; struct _ios_fields { streambuf *_strbuf; ostream* _tie; int _width; __fmtflags _flags; short _fill; __iostate _state; __iostate _exceptions; int _precision; void *_arrays; }; # 115 "/home2/paubert/logiciels/egcs/include/g++/streambuf.h" 3 class ios : public _ios_fields { ios& operator=(ios&); ios (const ios&); public: typedef __fmtflags fmtflags; typedef int iostate; typedef int openmode; typedef int streamsize; enum io_state { goodbit = 0 , eofbit = 1 , failbit = 2 , badbit = 4 }; enum open_mode { in = 1 , out = 2 , ate = 4 , app = 8 , trunc = 16 , nocreate = 32 , noreplace = 64 , bin = 128 , binary = 128 }; enum seek_dir { beg, cur, end}; typedef enum seek_dir seekdir; enum { skipws= 01 , left= 02 , right= 04 , internal= 010 , dec= 020 , oct= 040 , hex= 0100 , showbase= 0200 , showpoint= 0400 , uppercase= 01000 , showpos= 02000 , scientific= 04000 , fixed= 010000 , unitbuf= 020000 , stdio= 040000 }; enum { basefield=dec+oct+hex, floatfield = scientific+fixed, adjustfield = left+right+internal }; # 168 "/home2/paubert/logiciels/egcs/include/g++/streambuf.h" 3 ostream* tie() const { return _tie; } ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; } short fill() const { return (short )_fill; } short fill(short newf) {short oldf = (short )_fill; _fill = (char)newf; return oldf;} fmtflags flags() const { return _flags; } fmtflags flags(fmtflags new_val) { fmtflags old_val = _flags; _flags = new_val; return old_val; } int precision() const { return _precision; } int precision(int newp) { unsigned short oldp = _precision; _precision = (unsigned short)newp; return oldp; } fmtflags setf(fmtflags val) { fmtflags oldbits = _flags; _flags |= val; return oldbits; } fmtflags setf(fmtflags val, fmtflags mask) { fmtflags oldbits = _flags; _flags = (_flags & ~mask) | (val & mask); return oldbits; } fmtflags unsetf(fmtflags mask) { fmtflags oldbits = _flags; _flags &= ~mask; return oldbits; } int width() const { return _width; } int width(int val) { int save = _width; _width = val; return save; } void _throw_failure() const { } void clear(iostate state = 0) { _state = _strbuf ? state : state|badbit; if (_state & _exceptions) _throw_failure(); } void set(iostate flag) { _state |= flag; if (_state & _exceptions) _throw_failure(); } void setstate(iostate flag) { _state |= flag; if (_state & _exceptions) _throw_failure(); } int good() const { return _state == 0; } int eof() const { return _state & ios::eofbit; } int fail() const { return _state & (ios::badbit|ios::failbit); } int bad() const { return _state & ios::badbit; } iostate rdstate() const { return _state; } operator void*() const { return fail() ? (void*)0 : (void*)(-1); } int operator!() const { return fail(); } iostate exceptions() const { return _exceptions; } void exceptions(iostate enable) { _exceptions = enable; if (_state & _exceptions) _throw_failure(); } streambuf* rdbuf() const { return _strbuf; } streambuf* rdbuf(streambuf *_s) { streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; } static int sync_with_stdio(int on); static void sync_with_stdio() { sync_with_stdio(1); } static fmtflags bitalloc(); static int xalloc(); void*& pword(int); void* pword(int) const; long& iword(int); long iword(int) const; class Init { public: Init () { } }; protected: inline ios(streambuf* sb = 0, ostream* tie_to = 0); inline virtual ~ios(); inline void init(streambuf* sb, ostream* tie = 0); }; typedef ios::seek_dir _seek_dir; class streammarker : private _IO_marker { friend class streambuf; void set_offset(int offset) { _pos = offset; } public: streammarker(streambuf *sb); ~streammarker(); int saving() { return 1; } int delta(streammarker&); int delta(); }; struct streambuf : public _IO_FILE { friend class ios; friend class istream; friend class ostream; friend class streammarker; const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); } protected: static streambuf* _list_all; _IO_FILE*& xchain() { return _chain; } void _un_link(); void _link_in(); char* gptr() const { return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; } char* pptr() const { return _IO_write_ptr; } char* egptr() const { return _flags & 0x100 ? _IO_save_end : _IO_read_end; } char* epptr() const { return _IO_write_end; } char* pbase() const { return _IO_write_base; } char* eback() const { return _flags & 0x100 ? _IO_save_base : _IO_read_base;} char* base() const { return _IO_buf_base; } char* ebuf() const { return _IO_buf_end; } int blen() const { return _IO_buf_end - _IO_buf_base; } void xput_char(char c) { *_IO_write_ptr++ = c; } int xflags() { return _flags ; } int xflags(int f) {int fl = _flags ; _flags = f; return fl;} void xsetflags(int f) { _flags |= f; } void xsetflags(int f, int mask) { _flags = (_flags & ~mask) | (f & mask); } void gbump(int n) { _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);} void pbump(int n) { _IO_write_ptr += n; } void setb(char* b, char* eb, int a=0); void setp(char* p, char* ep) { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; } void setg(char* eb, char* g, char *eg) { if (_flags & 0x100 ) _IO_free_backup_area(this); _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; } char *shortbuf() { return _shortbuf; } int in_backup() { return _flags & 0x100 ; } char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; } char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; } char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; } char *Bptr() { return _IO_backup_base; } char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; } char *Nbase() { return _IO_save_base; } char *eNptr() { return _IO_save_end; } int have_backup() { return _IO_save_base != __null ; } int have_markers() { return _markers != __null ; } void free_backup_area(); void unsave_markers(); int put_mode() { return _flags & 0x800 ; } int switch_to_get_mode(); streambuf(int flags=0); public: static int flush_all(); static void flush_all_linebuffered(); virtual ~streambuf(); virtual int overflow(int c = (-1) ); virtual int underflow(); virtual int uflow(); virtual int pbackfail(int c); virtual streamsize xsputn(const char* s, streamsize n); virtual streamsize xsgetn(char* s, streamsize n); virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out); streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out) { return _IO_seekoff (this, o, d, mode); } streampos pubseekpos(streampos pos, int mode = ios::in|ios::out) { return _IO_seekpos (this, pos, mode); } streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); streampos sseekpos(streampos pos, int mode = ios::in|ios::out); virtual streambuf* setbuf(char* p, int len); virtual int sync(); virtual int doallocate(); int seekmark(streammarker& mark, int delta = 0); int sputbackc(char c); int sungetc(); int unbuffered() { return _flags & 2 ? 1 : 0; } int linebuffered() { return _flags & 0x200 ? 1 : 0; } void unbuffered(int i) { if (i) _flags |= 2 ; else _flags &= ~2 ; } void linebuffered(int i) { if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; } int allocate() { if (base() || unbuffered()) return 0; else return doallocate(); } void allocbuf() { if (base() == __null ) doallocbuf(); } void doallocbuf(); int in_avail() { return _IO_read_end - _IO_read_ptr; } int out_waiting() { return _IO_write_ptr - _IO_write_base; } streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); } streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); } streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); } int ignore(int); int get_column(); int set_column(int); long sgetline(char* buf, _G_size_t n, char delim, int putback_delim); int sputc(int c) { return _IO_putc(c, this); } int sbumpc() { return _IO_getc(this); } int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow ( this ) == (-1) ? (-1) : *(unsigned char *) ( this )->_IO_read_ptr) ; } int snextc() { if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) ) return (-1) ; else return _IO_read_ptr++, sgetc(); } void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; } int vscan(char const *fmt0, _G_va_list ap, ios* stream = __null ); int scan(char const *fmt0 ...); int vform(char const *fmt0, _G_va_list ap); int form(char const *fmt0 ...); virtual streamsize sys_read(char* buf, streamsize size); virtual streamsize sys_write(const char*, streamsize); virtual streampos sys_seek(streamoff, _seek_dir); virtual int sys_close(); virtual int sys_stat(void*); }; class filebuf : public streambuf { protected: void init(); public: static const int openprot; filebuf(); filebuf(int fd); filebuf(int fd, char* p, int len); ~filebuf(); filebuf* attach(int fd); filebuf* open(const char *filename, const char *mode); filebuf* open(const char *filename, ios::openmode mode, int prot = 0664); virtual int underflow(); virtual int overflow(int c = (-1) ); int is_open() const { return _fileno >= 0; } int fd() const { return is_open() ? _fileno : (-1) ; } filebuf* close(); virtual int doallocate(); virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out); virtual streambuf* setbuf(char* p, int len); streamsize xsputn(const char* s, streamsize n); streamsize xsgetn(char* s, streamsize n); virtual int sync(); protected: int is_reading() { return eback() != egptr(); } char* cur_ptr() { return is_reading() ? gptr() : pptr(); } char* file_ptr() { return eGptr(); } virtual streamsize sys_read(char* buf, streamsize size); virtual streampos sys_seek(streamoff, _seek_dir); virtual streamsize sys_write(const char*, streamsize); virtual int sys_stat(void*); virtual int sys_close(); }; inline void ios::init(streambuf* sb, ostream* tie_to) { _state = sb ? ios::goodbit : ios::badbit; _exceptions=0; _strbuf=sb; _tie = tie_to; _width=0; _fill=' '; _flags=ios::skipws|ios::dec; _precision=6; _arrays = 0; } inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); } inline ios::~ios() { if (_arrays) delete [] _arrays; } } # 31 "/home2/paubert/logiciels/egcs/include/g++/iostream.h" 2 3 extern "C++" { class istream; class ostream; typedef ios& (*__manip)(ios&); typedef istream& (*__imanip)(istream&); typedef ostream& (*__omanip)(ostream&); extern istream& ws(istream& ins); extern ostream& flush(ostream& outs); extern ostream& endl(ostream& outs); extern ostream& ends(ostream& outs); class ostream : virtual public ios { void do_osfx(); public: ostream() { } ostream(streambuf* sb, ostream* tied= __null ); int opfx() { if (!good()) return 0; else { if (_tie) _tie->flush(); ; return 1;} } void osfx() { ; if (flags() & (ios::unitbuf|ios::stdio)) do_osfx(); } ostream& flush(); ostream& put(char c) { _strbuf->sputc(c); return *this; } ostream& write(const char *s, streamsize n); ostream& write(const unsigned char *s, streamsize n) { return write((const char*)s, n);} ostream& write(const signed char *s, streamsize n) { return write((const char*)s, n);} ostream& write(const void *s, streamsize n) { return write((const char*)s, n);} ostream& seekp(streampos); ostream& seekp(streamoff, _seek_dir); streampos tellp(); ostream& form(const char *format ...); ostream& vform(const char *format, _G_va_list args); ostream& operator<<(char c); ostream& operator<<(unsigned char c) { return (*this) << (char)c; } ostream& operator<<(signed char c) { return (*this) << (char)c; } ostream& operator<<(const char *s); ostream& operator<<(const unsigned char *s) { return (*this) << (const char*)s; } ostream& operator<<(const signed char *s) { return (*this) << (const char*)s; } ostream& operator<<(const void *p); ostream& operator<<(int n); ostream& operator<<(unsigned int n); ostream& operator<<(long n); ostream& operator<<(unsigned long n); __extension__ ostream& operator<<(long long n); __extension__ ostream& operator<<(unsigned long long n); ostream& operator<<(short n) {return operator<<((int)n);} ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);} ostream& operator<<(bool b) { return operator<<((int)b); } ostream& operator<<(double n); ostream& operator<<(float n) { return operator<<((double)n); } ostream& operator<<(long double n) { return operator<<((double)n); } ostream& operator<<(__omanip func) { return (*func)(*this); } ostream& operator<<(__manip func) {(*func)(*this); return *this;} ostream& operator<<(streambuf*); }; class istream : virtual public ios { protected: _G_size_t _gcount; int _skip_ws(); public: istream(): _gcount (0) { } istream(streambuf* sb, ostream*tied= __null ); istream& get(char* ptr, int len, char delim = '\n'); istream& get(unsigned char* ptr, int len, char delim = '\n') { return get((char*)ptr, len, delim); } istream& get(char& c); istream& get(unsigned char& c) { return get((char&)c); } istream& getline(char* ptr, int len, char delim = '\n'); istream& getline(unsigned char* ptr, int len, char delim = '\n') { return getline((char*)ptr, len, delim); } istream& get(signed char& c) { return get((char&)c); } istream& get(signed char* ptr, int len, char delim = '\n') { return get((char*)ptr, len, delim); } istream& getline(signed char* ptr, int len, char delim = '\n') { return getline((char*)ptr, len, delim); } istream& read(char *ptr, streamsize n); istream& read(unsigned char *ptr, streamsize n) { return read((char*)ptr, n); } istream& read(signed char *ptr, streamsize n) { return read((char*)ptr, n); } istream& read(void *ptr, streamsize n) { return read((char*)ptr, n); } istream& get(streambuf& sb, char delim = '\n'); istream& gets(char **s, char delim = '\n'); int ipfx(int need = 0) { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush(); if (!need && (flags() & ios::skipws)) return _skip_ws(); else return 1; } } int ipfx0() { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie) _tie->flush(); if (flags() & ios::skipws) return _skip_ws(); else return 1; } } int ipfx1() { if (!good()) { set(ios::failbit); return 0; } else { ; if (_tie && rdbuf()->in_avail() == 0) _tie->flush(); return 1; } } void isfx() { ; } int get() { if (!ipfx1()) return (-1) ; else { int ch = _strbuf->sbumpc(); if (ch == (-1) ) set(ios::eofbit); return ch; } } int peek(); _G_size_t gcount() { return _gcount; } istream& ignore(int n=1, int delim = (-1) ); int sync (); istream& seekg(streampos); istream& seekg(streamoff, _seek_dir); streampos tellg(); istream& putback(char ch) { if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit); return *this;} istream& unget() { if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit); return *this;} istream& scan(const char *format ...); istream& vscan(const char *format, _G_va_list args); istream& operator>>(char*); istream& operator>>(unsigned char* p) { return operator>>((char*)p); } istream& operator>>(signed char*p) { return operator>>((char*)p); } istream& operator>>(char& c); istream& operator>>(unsigned char& c) {return operator>>((char&)c);} istream& operator>>(signed char& c) {return operator>>((char&)c);} istream& operator>>(int&); istream& operator>>(long&); __extension__ istream& operator>>(long long&); __extension__ istream& operator>>(unsigned long long&); istream& operator>>(short&); istream& operator>>(unsigned int&); istream& operator>>(unsigned long&); istream& operator>>(unsigned short&); istream& operator>>(bool&); istream& operator>>(float&); istream& operator>>(double&); istream& operator>>(long double&); istream& operator>>( __manip func) {(*func)(*this); return *this;} istream& operator>>(__imanip func) { return (*func)(*this); } istream& operator>>(streambuf*); }; class iostream : public istream, public ostream { public: iostream() { } iostream(streambuf* sb, ostream*tied= __null ); }; class _IO_istream_withassign : public istream { public: _IO_istream_withassign& operator=(istream&); _IO_istream_withassign& operator=(_IO_istream_withassign& rhs) { return operator= (static_cast (rhs)); } }; class _IO_ostream_withassign : public ostream { public: _IO_ostream_withassign& operator=(ostream&); _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs) { return operator= (static_cast (rhs)); } }; extern _IO_istream_withassign cin; extern _IO_ostream_withassign cout, cerr; extern _IO_ostream_withassign clog ; extern istream& lock(istream& ins); extern istream& unlock(istream& ins); extern ostream& lock(ostream& outs); extern ostream& unlock(ostream& outs); struct Iostream_init { } ; inline ios& dec(ios& i) { i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } inline ios& hex(ios& i) { i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; } inline ios& oct(ios& i) { i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; } } # 51 "spxtcl.cc" 2 # 1 "/home2/paubert/logiciels/egcs/include/g++/fstream.h" 1 3 #pragma interface extern "C++" { class fstreambase : virtual public ios { mutable filebuf __my_fb; void __fb_init (); public: fstreambase(); fstreambase(int fd); fstreambase(int fd, char *p, int l); fstreambase(const char *name, int mode, int prot=0664); void close(); filebuf* rdbuf() const { return &__my_fb; } void open(const char *name, int mode, int prot=0664); int is_open() const { return rdbuf()->is_open(); } void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); } void attach(int fd); }; class ifstream : public fstreambase, public istream { public: ifstream() : fstreambase() { } ifstream(int fd) : fstreambase(fd) { } ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } ifstream(const char *name, int mode=ios::in, int prot=0664) : fstreambase(name, mode, prot) { } void open(const char *name, int mode=ios::in, int prot=0664) { fstreambase::open(name, mode, prot); } }; class ofstream : public fstreambase, public ostream { public: ofstream() : fstreambase() { } ofstream(int fd) : fstreambase(fd) { } ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } ofstream(const char *name, int mode=ios::out, int prot=0664) : fstreambase(name, mode, prot) { } void open(const char *name, int mode=ios::out, int prot=0664) { fstreambase::open(name, mode, prot); } }; class fstream : public fstreambase, public iostream { public: fstream() : fstreambase() { } fstream(int fd) : fstreambase(fd) { } fstream(const char *name, int mode, int prot=0664) : fstreambase(name, mode, prot) { } fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { } void open(const char *name, int mode, int prot=0664) { fstreambase::open(name, mode, prot); } }; } # 52 "spxtcl.cc" 2 extern "C" { # 1 "/usr/local/include/tcl.h" 1 3 # 77 "/usr/local/include/tcl.h" 3 # 94 "/usr/local/include/tcl.h" 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 1 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 1 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/va-pa.h" 1 3 typedef void *__gnuc_va_list; # 52 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/va-pa.h" 3 # 24 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 2 3 # 130 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 3 # 202 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 3 # 2 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 2 3 # 1 "/usr/include/sys/stdsyms.h" 1 3 # 61 "/usr/include/sys/stdsyms.h" 3 # 83 "/usr/include/sys/stdsyms.h" 3 # 240 "/usr/include/sys/stdsyms.h" 3 # 8 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 2 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/types.h" 1 3 # 1 "/usr/include/sys/_inttypes.h" 1 3 # 45 "/usr/include/sys/_inttypes.h" 3 typedef char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef int intfast_t; typedef unsigned int uintfast_t; # 71 "/usr/include/sys/_inttypes.h" 3 typedef int32_t intmax_t; typedef uint32_t uintmax_t; typedef long intptr_t; typedef unsigned long uintptr_t; typedef char int_least8_t; typedef unsigned char uint_least8_t; typedef int int_fast8_t; typedef unsigned int uint_fast8_t; typedef short int_least16_t; typedef unsigned short uint_least16_t; typedef int int_fast16_t; typedef unsigned int uint_fast16_t; typedef int int_least32_t; typedef unsigned int uint_least32_t; typedef int int_fast32_t; typedef unsigned int uint_fast32_t; # 139 "/usr/include/sys/_inttypes.h" 3 typedef uint32_t ptr32_t; # 10 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/types.h" 2 3 typedef int32_t dev_t; typedef uint32_t ino_t; typedef uint16_t mode_t; typedef uint16_t nlink_t; typedef int32_t fpos32_t; typedef int32_t fpos_t; typedef uint32_t fsblkcnt32_t; typedef uint32_t fsblkcnt_t; typedef int32_t off32_t; typedef int32_t off_t; typedef uint32_t fsfilcnt32_t; typedef uint32_t fsfilcnt_t; typedef int32_t blkcnt32_t; typedef int32_t blkcnt_t; typedef int32_t pid_t; typedef int32_t lwpid_t; typedef int32_t gid_t; typedef int32_t uid_t; typedef int32_t tid_t; typedef int32_t ssize_t; typedef uint16_t __site_t; typedef uint16_t __cnode_t; typedef int32_t time_t; typedef uint32_t size_t; typedef uint32_t clock_t; typedef int32_t key_t; typedef unsigned short __ushort; typedef int32_t __daddr_t; typedef char *__caddr_t; typedef int32_t __swblk_t; typedef __caddr_t caddr_t; typedef int32_t id_t; typedef uint32_t useconds_t; typedef uint32_t rlim32_t; typedef uint32_t rlim_t; typedef __site_t site_t; typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned int uint; typedef unsigned short ushort; typedef unsigned char ubit8; typedef unsigned short ubit16; typedef uint32_t ubit32; typedef char sbit8; typedef short sbit16; typedef int32_t sbit32; typedef __swblk_t swblk_t; typedef __daddr_t daddr_t; typedef __cnode_t cnode_t; typedef uintptr_t physaddr_t; typedef unsigned long paddr_t; typedef intptr_t page_t; typedef unsigned long ulong_t; typedef int16_t cnt_t; typedef uint32_t space_t; typedef uint32_t prot_t; typedef uint32_t cdno_t; typedef uint16_t use_t; typedef struct _physadr { intptr_t r[1]; } *physadr; typedef struct _quad { long val[2]; } quad; typedef int spu_t; typedef short cpu_t; typedef struct label_t { int32_t lbl_rp; int32_t lbl_sp; int32_t lbl_s[17]; int32_t lbl_ss[1]; double lbl_sf[4]; } label_t; typedef char *dm_message; typedef int32_t aid_t; typedef pid_t sid_t; typedef int32_t fd_mask; typedef struct fd_set { fd_mask fds_bits[((( 2048 )+(( (sizeof(fd_mask) * 8) )-1))/( (sizeof(fd_mask) * 8) )) ]; } fd_set; extern "C" { } # 530 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/types.h" 3 # 548 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/types.h" 3 # 11 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 2 3 extern "C" { typedef struct { int __cnt; unsigned char *__ptr; unsigned char *__base; unsigned short __flag; unsigned char __fileL; unsigned char __fileH; } FILE; typedef struct { int __cnt; unsigned char *__ptr; unsigned char *__base; unsigned short __flag; unsigned char __fileL; unsigned char __fileH; unsigned char *__bufendp; unsigned char *__newbase; unsigned char __smbuf[8 +2*4]; void *__unused; } _FILEX; typedef double *__va_list; extern FILE __iob[]; extern int remove(const char *); extern int rename(const char *, const char *); extern char *tmpnam(char *); extern int fclose(FILE *); extern int fflush(FILE *); extern void setbuf(FILE *, char *); extern int setvbuf(FILE *, char *, int, size_t); extern int fprintf(FILE *, const char *, ...); extern int fscanf(FILE *, const char *,...); extern int printf(const char *,...); extern int scanf(const char *,...); extern int sprintf(char *, const char *,...); extern int sscanf(const char *, const char *,...); extern int fgetc(FILE *); extern char *fgets(char *, int, FILE *); extern int fputc(int, FILE *); extern int fputs(const char *, FILE *); extern int getc(FILE *); extern int getchar(void); extern char *gets(char *); extern int putc(int, FILE *); extern int putchar(int); extern int puts(const char *); extern int ungetc(int, FILE *); extern FILE *tmpfile(void); extern int fgetpos(FILE *, fpos_t *); extern int fsetpos(FILE *, const fpos_t *); extern FILE *fopen(const char *, const char *); extern FILE *freopen(const char *, const char *, FILE *); extern int fseek(FILE *, long int, int); extern long int ftell(FILE *); extern void rewind(FILE *); extern void clearerr(FILE *); extern int feof(FILE *); extern int ferror(FILE *); extern void perror(const char *); # 187 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 # 248 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 extern size_t fread(void *, size_t, size_t, FILE *); extern size_t fwrite(const void *, size_t, size_t, FILE *); extern int __flsbuf(unsigned char, FILE *); extern int __filbuf(FILE *); # 316 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 extern char *ctermid(char *); extern int fileno(FILE *); extern FILE *fdopen(int, const char *); typedef double *__va_list__; extern char *optarg; extern int opterr; extern int optind; extern int optopt; extern int getopt(int, char * const [], const char *); extern char *cuserid(char *); extern int getw(FILE *); extern int putw(int, FILE *); extern int pclose(FILE *); extern FILE *popen(const char *, const char *); extern char *tempnam(const char *, const char *); extern int vprintf(const char *, __gnuc_va_list); extern int vfprintf(FILE *, const char *, __gnuc_va_list); extern int vsprintf(char *, const char *, __gnuc_va_list); extern int vscanf(const char *, __gnuc_va_list); extern int vfscanf(FILE *, const char *, __gnuc_va_list); extern int vsscanf(char *, const char *, __gnuc_va_list); extern int fclose_unlocked(FILE *); extern int fflush_unlocked(FILE *); extern char *fgets_unlocked(char *, int, FILE *); extern int fputs_unlocked(const char *, FILE *); extern int setvbuf_unlocked(FILE *, char *, int, size_t); extern int puts_unlocked(const char *); extern int ungetc_unlocked(int, FILE *); extern int fseek_unlocked(FILE *, long int, int); extern long int ftell_unlocked(FILE *); extern void rewind_unlocked(FILE *); extern size_t fread_unlocked(void *, size_t, size_t, FILE *); extern size_t fwrite_unlocked(const void *, size_t, size_t, FILE *); extern void flockfile(FILE *); extern void funlockfile(FILE *); extern int fileno_unlocked(FILE *); extern int getw_unlocked(FILE *); extern int putw_unlocked(int, FILE *); # 472 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 extern unsigned char *__bufendtab[]; # 511 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 # 547 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 # 556 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 } extern "C" { } # 106 "/usr/local/include/tcl.h" 2 3 # 133 "/usr/local/include/tcl.h" 3 # 181 "/usr/local/include/tcl.h" 3 typedef void *ClientData; typedef struct Tcl_Interp{ char *result; void (*freeProc) (char *blockPtr) ; int errorLine; } Tcl_Interp; typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler; typedef struct Tcl_Command_ *Tcl_Command; typedef struct Tcl_Event Tcl_Event; typedef struct Tcl_File_ *Tcl_File; typedef struct Tcl_Channel_ *Tcl_Channel; typedef struct Tcl_RegExp_ *Tcl_RegExp; typedef struct Tcl_TimerToken_ *Tcl_TimerToken; typedef struct Tcl_Trace_ *Tcl_Trace; typedef enum {TCL_INT, TCL_DOUBLE, TCL_EITHER} Tcl_ValueType; typedef struct Tcl_Value { Tcl_ValueType type; long intValue; double doubleValue; } Tcl_Value; typedef int (Tcl_AppInitProc) (Tcl_Interp *interp) ; typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp, int code) ; typedef void (Tcl_ChannelProc) (ClientData clientData, int mask) ; typedef void (Tcl_CloseProc) (ClientData data) ; typedef void (Tcl_CmdDeleteProc) (ClientData clientData) ; typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) ; typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, ClientData cmdClientData, int argc, char *argv[]) ; typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags) ; typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags) ; typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData) ; typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags) ; typedef void (Tcl_ExitProc) (ClientData clientData) ; typedef void (Tcl_FileProc) (ClientData clientData, int mask) ; typedef void (Tcl_FileFreeProc) (ClientData clientData) ; typedef void (Tcl_FreeProc) (char *blockPtr) ; typedef void (Tcl_IdleProc) (ClientData clientData) ; typedef void (Tcl_InterpDeleteProc) (ClientData clientData, Tcl_Interp *interp) ; typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr) ; typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp) ; typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan, char *address, int port) ; typedef void (Tcl_TimerProc) (ClientData clientData) ; typedef char *(Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp, char *part1, char *part2, int flags) ; typedef struct Tcl_CmdInfo { Tcl_CmdProc *proc; ClientData clientData; Tcl_CmdDeleteProc *deleteProc; ClientData deleteData; } Tcl_CmdInfo; typedef struct Tcl_DString { char *string; int length; int spaceAvl; char staticSpace[200 ]; } Tcl_DString; extern "C" char * Tcl_Alloc (unsigned int size) ; extern "C" void Tcl_Free (char *ptr) ; extern "C" char * Tcl_Realloc (char *ptr, unsigned int size) ; # 430 "/usr/local/include/tcl.h" 3 # 460 "/usr/local/include/tcl.h" 3 struct Tcl_HashTable; typedef struct Tcl_HashEntry { struct Tcl_HashEntry *nextPtr; struct Tcl_HashTable *tablePtr; struct Tcl_HashEntry **bucketPtr; ClientData clientData; union { char *oneWordValue; int words[1]; char string[4]; } key; } Tcl_HashEntry; typedef struct Tcl_HashTable { Tcl_HashEntry **buckets; Tcl_HashEntry *staticBuckets[4 ]; int numBuckets; int numEntries; int rebuildSize; int downShift; int mask; int keyType; Tcl_HashEntry *(*findProc) (struct Tcl_HashTable *tablePtr, char *key) ; Tcl_HashEntry *(*createProc) (struct Tcl_HashTable *tablePtr, char *key, int *newPtr) ; } Tcl_HashTable; typedef struct Tcl_HashSearch { Tcl_HashTable *tablePtr; int nextIndex; Tcl_HashEntry *nextEntryPtr; } Tcl_HashSearch; struct Tcl_Event { Tcl_EventProc *proc; struct Tcl_Event *nextPtr; }; typedef enum { TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, TCL_QUEUE_MARK } Tcl_QueuePosition; typedef struct Tcl_Time { long sec; long usec; } Tcl_Time; typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode) ; typedef int (Tcl_DriverCloseProc) (ClientData instanceData, Tcl_Interp *interp) ; typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf, int toRead, int *errorCodePtr) ; typedef int (Tcl_DriverOutputProc) (ClientData instanceData, char *buf, int toWrite, int *errorCodePtr) ; typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset, int mode, int *errorCodePtr) ; typedef int (Tcl_DriverSetOptionProc) ( ClientData instanceData, Tcl_Interp *interp, char *optionName, char *value) ; typedef int (Tcl_DriverGetOptionProc) ( ClientData instanceData, char *optionName, Tcl_DString *dsPtr) ; typedef void (Tcl_DriverWatchChannelProc) ( ClientData instanceData, int mask) ; typedef int (Tcl_DriverChannelReadyProc) ( ClientData instanceData, int mask) ; typedef Tcl_File (Tcl_DriverGetFileProc) (ClientData instanceData, int mask) ; typedef enum Tcl_EolTranslation { TCL_TRANSLATE_AUTO, TCL_TRANSLATE_CR, TCL_TRANSLATE_LF, TCL_TRANSLATE_CRLF } Tcl_EolTranslation; typedef struct Tcl_ChannelType { char *typeName; Tcl_DriverBlockModeProc *blockModeProc; Tcl_DriverCloseProc *closeProc; Tcl_DriverInputProc *inputProc; Tcl_DriverOutputProc *outputProc; Tcl_DriverSeekProc *seekProc; Tcl_DriverSetOptionProc *setOptionProc; Tcl_DriverGetOptionProc *getOptionProc; Tcl_DriverWatchChannelProc *watchChannelProc; Tcl_DriverChannelReadyProc *channelReadyProc; Tcl_DriverGetFileProc *getFileProc; } Tcl_ChannelType; typedef enum Tcl_PathType { TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, TCL_PATH_VOLUME_RELATIVE } Tcl_PathType; extern "C" int Tcl_CreatePipeline (Tcl_Interp *interp, int argc, char **argv, int **pidArrayPtr, int *inPipePtr, int *outPipePtr, int *errFilePtr) ; extern "C" void Tcl_AddErrorInfo (Tcl_Interp *interp, char *message) ; extern "C" void Tcl_AllowExceptions (Tcl_Interp *interp) ; extern "C" void Tcl_AppendElement (Tcl_Interp *interp, char *string) ; extern "C" void Tcl_AppendResult ( Tcl_Interp * interp , ...) ; extern "C" int Tcl_AppInit (Tcl_Interp *interp) ; extern "C" Tcl_AsyncHandler Tcl_AsyncCreate (Tcl_AsyncProc *proc, ClientData clientData) ; extern "C" void Tcl_AsyncDelete (Tcl_AsyncHandler async) ; extern "C" int Tcl_AsyncInvoke (Tcl_Interp *interp, int code) ; extern "C" void Tcl_AsyncMark (Tcl_AsyncHandler async) ; extern "C" int Tcl_AsyncReady (void) ; extern "C" void Tcl_BackgroundError (Tcl_Interp *interp) ; extern "C" char Tcl_Backslash (char *src, int *readPtr) ; extern "C" void Tcl_CallWhenDeleted (Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData) ; extern "C" void Tcl_CancelIdleCall (Tcl_IdleProc *idleProc, ClientData clientData) ; extern "C" int Tcl_Close (Tcl_Interp *interp, Tcl_Channel chan) ; extern "C" int Tcl_CommandComplete (char *cmd) ; extern "C" char * Tcl_Concat (int argc, char **argv) ; extern "C" int Tcl_ConvertElement (char *src, char *dst, int flags) ; extern "C" int Tcl_CreateAlias (Tcl_Interp *slave, char *slaveCmd, Tcl_Interp *target, char *targetCmd, int argc, char **argv) ; extern "C" Tcl_Channel Tcl_CreateChannel ( Tcl_ChannelType *typePtr, char *chanName, ClientData instanceData, int mask) ; extern "C" void Tcl_CreateChannelHandler ( Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData) ; extern "C" void Tcl_CreateCloseHandler ( Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData) ; extern "C" Tcl_Command Tcl_CreateCommand (Tcl_Interp *interp, char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc) ; extern "C" void Tcl_CreateEventSource ( Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData) ; extern "C" void Tcl_CreateExitHandler (Tcl_ExitProc *proc, ClientData clientData) ; extern "C" void Tcl_CreateFileHandler ( Tcl_File file, int mask, Tcl_FileProc *proc, ClientData clientData) ; extern "C" Tcl_Interp * Tcl_CreateInterp (void) ; extern "C" void Tcl_CreateMathFunc (Tcl_Interp *interp, char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData) ; extern "C" void Tcl_CreateModalTimeout (int milliseconds, Tcl_TimerProc *proc, ClientData clientData) ; extern "C" Tcl_Interp *Tcl_CreateSlave (Tcl_Interp *interp, char *slaveName, int isSafe) ; extern "C" Tcl_TimerToken Tcl_CreateTimerHandler (int milliseconds, Tcl_TimerProc *proc, ClientData clientData) ; extern "C" Tcl_Trace Tcl_CreateTrace (Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, ClientData clientData) ; extern "C" char * Tcl_DbCkalloc (unsigned int size, char *file, int line) ; extern "C" int Tcl_DbCkfree (char *ptr, char *file, int line) ; extern "C" char * Tcl_DbCkrealloc (char *ptr, unsigned int size, char *file, int line) ; extern "C" void Tcl_DeleteAssocData (Tcl_Interp *interp, char *name) ; extern "C" int Tcl_DeleteCommand (Tcl_Interp *interp, char *cmdName) ; extern "C" void Tcl_DeleteChannelHandler ( Tcl_Channel chan, Tcl_ChannelProc *proc, ClientData clientData) ; extern "C" void Tcl_DeleteCloseHandler ( Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData) ; extern "C" void Tcl_DeleteEventSource ( Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData) ; extern "C" void Tcl_DeleteEvents ( Tcl_EventDeleteProc *proc, ClientData clientData) ; extern "C" void Tcl_DeleteExitHandler (Tcl_ExitProc *proc, ClientData clientData) ; extern "C" void Tcl_DeleteFileHandler ( Tcl_File file) ; extern "C" void Tcl_DeleteHashEntry ( Tcl_HashEntry *entryPtr) ; extern "C" void Tcl_DeleteHashTable ( Tcl_HashTable *tablePtr) ; extern "C" void Tcl_DeleteInterp (Tcl_Interp *interp) ; extern "C" void Tcl_DeleteModalTimeout ( Tcl_TimerProc *proc, ClientData clientData) ; extern "C" void Tcl_DeleteTimerHandler ( Tcl_TimerToken token) ; extern "C" void Tcl_DeleteTrace (Tcl_Interp *interp, Tcl_Trace trace) ; extern "C" void Tcl_DetachPids (int numPids, int *pidPtr) ; extern "C" void Tcl_DontCallWhenDeleted ( Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData) ; extern "C" int Tcl_DoOneEvent (int flags) ; extern "C" void Tcl_DoWhenIdle (Tcl_IdleProc *proc, ClientData clientData) ; extern "C" char * Tcl_DStringAppend (Tcl_DString *dsPtr, char *string, int length) ; extern "C" char * Tcl_DStringAppendElement ( Tcl_DString *dsPtr, char *string) ; extern "C" void Tcl_DStringEndSublist (Tcl_DString *dsPtr) ; extern "C" void Tcl_DStringFree (Tcl_DString *dsPtr) ; extern "C" void Tcl_DStringGetResult (Tcl_Interp *interp, Tcl_DString *dsPtr) ; extern "C" void Tcl_DStringInit (Tcl_DString *dsPtr) ; extern "C" void Tcl_DStringResult (Tcl_Interp *interp, Tcl_DString *dsPtr) ; extern "C" void Tcl_DStringSetLength (Tcl_DString *dsPtr, int length) ; extern "C" void Tcl_DStringStartSublist ( Tcl_DString *dsPtr) ; extern "C" int Tcl_Eof (Tcl_Channel chan) ; extern "C" char * Tcl_ErrnoId (void) ; extern "C" char * Tcl_ErrnoMsg (int err) ; extern "C" int Tcl_Eval (Tcl_Interp *interp, char *cmd) ; extern "C" int Tcl_EvalFile (Tcl_Interp *interp, char *fileName) ; extern "C" void Tcl_EventuallyFree (ClientData clientData, Tcl_FreeProc *freeProc) ; extern "C" void Tcl_Exit (int status) ; extern "C" int Tcl_ExprBoolean (Tcl_Interp *interp, char *string, int *ptr) ; extern "C" int Tcl_ExprDouble (Tcl_Interp *interp, char *string, double *ptr) ; extern "C" int Tcl_ExprLong (Tcl_Interp *interp, char *string, long *ptr) ; extern "C" int Tcl_ExprString (Tcl_Interp *interp, char *string) ; extern "C" int Tcl_FileReady (Tcl_File file, int mask) ; extern "C" void Tcl_FindExecutable (char *argv0) ; extern "C" Tcl_HashEntry * Tcl_FirstHashEntry ( Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr) ; extern "C" int Tcl_Flush (Tcl_Channel chan) ; extern "C" void Tcl_FreeFile ( Tcl_File file) ; extern "C" int Tcl_GetAlias (Tcl_Interp *interp, char *slaveCmd, Tcl_Interp **targetInterpPtr, char **targetCmdPtr, int *argcPtr, char ***argvPtr) ; extern "C" ClientData Tcl_GetAssocData (Tcl_Interp *interp, char *name, Tcl_InterpDeleteProc **procPtr) ; extern "C" int Tcl_GetBoolean (Tcl_Interp *interp, char *string, int *boolPtr) ; extern "C" Tcl_Channel Tcl_GetChannel (Tcl_Interp *interp, char *chanName, int *modePtr) ; extern "C" int Tcl_GetChannelBufferSize ( Tcl_Channel chan) ; extern "C" Tcl_File Tcl_GetChannelFile (Tcl_Channel chan, int direction) ; extern "C" ClientData Tcl_GetChannelInstanceData ( Tcl_Channel chan) ; extern "C" int Tcl_GetChannelMode (Tcl_Channel chan) ; extern "C" char * Tcl_GetChannelName (Tcl_Channel chan) ; extern "C" int Tcl_GetChannelOption (Tcl_Channel chan, char *optionName, Tcl_DString *dsPtr) ; extern "C" Tcl_ChannelType * Tcl_GetChannelType (Tcl_Channel chan) ; extern "C" int Tcl_GetCommandInfo (Tcl_Interp *interp, char *cmdName, Tcl_CmdInfo *infoPtr) ; extern "C" char * Tcl_GetCommandName (Tcl_Interp *interp, Tcl_Command command) ; extern "C" char * Tcl_GetCwd (char *buf, int len) ; extern "C" int Tcl_GetDouble (Tcl_Interp *interp, char *string, double *doublePtr) ; extern "C" int Tcl_GetErrno (void) ; extern "C" Tcl_File Tcl_GetFile (ClientData fileData, int type) ; extern "C" ClientData Tcl_GetFileInfo (Tcl_File file, int *typePtr) ; extern "C" char * Tcl_GetHostName (void) ; extern "C" int Tcl_GetInt (Tcl_Interp *interp, char *string, int *intPtr) ; extern "C" int Tcl_GetInterpPath (Tcl_Interp *askInterp, Tcl_Interp *slaveInterp) ; extern "C" Tcl_Interp *Tcl_GetMaster (Tcl_Interp *interp) ; extern "C" ClientData Tcl_GetNotifierData (Tcl_File file, Tcl_FileFreeProc **freeProcPtr) ; extern "C" int Tcl_GetOpenFile (Tcl_Interp *interp, char *string, int write, int checkUsage, ClientData *filePtr) ; extern "C" Tcl_PathType Tcl_GetPathType (char *path) ; extern "C" int Tcl_Gets (Tcl_Channel chan, Tcl_DString *dsPtr) ; extern "C" Tcl_Interp *Tcl_GetSlave (Tcl_Interp *interp, char *slaveName) ; extern "C" Tcl_Channel Tcl_GetStdChannel (int type) ; extern "C" char * Tcl_GetVar (Tcl_Interp *interp, char *varName, int flags) ; extern "C" char * Tcl_GetVar2 (Tcl_Interp *interp, char *part1, char *part2, int flags) ; extern "C" int Tcl_GlobalEval (Tcl_Interp *interp, char *command) ; extern "C" char * Tcl_HashStats (Tcl_HashTable *tablePtr) ; extern "C" int Tcl_Init (Tcl_Interp *interp) ; extern "C" void Tcl_InitHashTable (Tcl_HashTable *tablePtr, int keyType) ; extern "C" void Tcl_InitMemory (Tcl_Interp *interp) ; extern "C" int Tcl_InputBlocked (Tcl_Channel chan) ; extern "C" int Tcl_InputBuffered (Tcl_Channel chan) ; extern "C" int Tcl_InterpDeleted (Tcl_Interp *interp) ; extern "C" int Tcl_IsSafe (Tcl_Interp *interp) ; extern "C" char * Tcl_JoinPath (int argc, char **argv, Tcl_DString *resultPtr) ; extern "C" int Tcl_LinkVar (Tcl_Interp *interp, char *varName, char *addr, int type) ; extern "C" void Tcl_Main (int argc, char **argv, Tcl_AppInitProc *appInitProc) ; extern "C" Tcl_Channel Tcl_MakeFileChannel (ClientData inFile, ClientData outFile, int mode) ; extern "C" int Tcl_MakeSafe (Tcl_Interp *interp) ; extern "C" Tcl_Channel Tcl_MakeTcpClientChannel ( ClientData tcpSocket) ; extern "C" char * Tcl_Merge (int argc, char **argv) ; extern "C" Tcl_HashEntry * Tcl_NextHashEntry ( Tcl_HashSearch *searchPtr) ; extern "C" Tcl_Channel Tcl_OpenCommandChannel ( Tcl_Interp *interp, int argc, char **argv, int flags) ; extern "C" Tcl_Channel Tcl_OpenFileChannel (Tcl_Interp *interp, char *fileName, char *modeString, int permissions) ; extern "C" Tcl_Channel Tcl_OpenTcpClient (Tcl_Interp *interp, int port, char *address, char *myaddr, int myport, int async) ; extern "C" Tcl_Channel Tcl_OpenTcpServer (Tcl_Interp *interp, int port, char *host, Tcl_TcpAcceptProc *acceptProc, ClientData callbackData) ; extern "C" char * Tcl_ParseVar (Tcl_Interp *interp, char *string, char **termPtr) ; extern "C" int Tcl_PkgProvide (Tcl_Interp *interp, char *name, char *version) ; extern "C" char * Tcl_PkgRequire (Tcl_Interp *interp, char *name, char *version, int exact) ; extern "C" char * Tcl_PosixError (Tcl_Interp *interp) ; extern "C" void Tcl_Preserve (ClientData data) ; extern "C" void Tcl_PrintDouble (Tcl_Interp *interp, double value, char *dst) ; extern "C" int Tcl_PutEnv (const char *string) ; extern "C" void Tcl_QueueEvent (Tcl_Event *evPtr, Tcl_QueuePosition position) ; extern "C" int Tcl_Read (Tcl_Channel chan, char *bufPtr, int toRead) ; extern "C" void Tcl_ReapDetachedProcs (void) ; extern "C" int Tcl_RecordAndEval (Tcl_Interp *interp, char *cmd, int flags) ; extern "C" Tcl_RegExp Tcl_RegExpCompile (Tcl_Interp *interp, char *string) ; extern "C" int Tcl_RegExpExec (Tcl_Interp *interp, Tcl_RegExp regexp, char *string, char *start) ; extern "C" int Tcl_RegExpMatch (Tcl_Interp *interp, char *string, char *pattern) ; extern "C" void Tcl_RegExpRange (Tcl_RegExp regexp, int index, char **startPtr, char **endPtr) ; extern "C" void Tcl_RegisterChannel (Tcl_Interp *interp, Tcl_Channel chan) ; extern "C" void Tcl_Release (ClientData clientData) ; extern "C" void Tcl_ResetResult (Tcl_Interp *interp) ; extern "C" int Tcl_ScanElement (char *string, int *flagPtr) ; extern "C" int Tcl_Seek (Tcl_Channel chan, int offset, int mode) ; extern "C" void Tcl_SetAssocData (Tcl_Interp *interp, char *name, Tcl_InterpDeleteProc *proc, ClientData clientData) ; extern "C" void Tcl_SetChannelBufferSize ( Tcl_Channel chan, int sz) ; extern "C" int Tcl_SetChannelOption ( Tcl_Interp *interp, Tcl_Channel chan, char *optionName, char *newValue) ; extern "C" int Tcl_SetCommandInfo (Tcl_Interp *interp, char *cmdName, Tcl_CmdInfo *infoPtr) ; extern "C" void Tcl_SetErrno (int err) ; extern "C" void Tcl_SetErrorCode ( Tcl_Interp * interp , ...) ; extern "C" void Tcl_SetMaxBlockTime (Tcl_Time *timePtr) ; extern "C" void Tcl_SetNotifierData (Tcl_File file, Tcl_FileFreeProc *freeProcPtr, ClientData data) ; extern "C" void Tcl_SetPanicProc (void (*proc) ( char * format , ...) ) ; extern "C" int Tcl_SetRecursionLimit (Tcl_Interp *interp, int depth) ; extern "C" void Tcl_SetResult (Tcl_Interp *interp, char *string, Tcl_FreeProc *freeProc) ; extern "C" void Tcl_SetStdChannel (Tcl_Channel channel, int type) ; extern "C" char * Tcl_SetVar (Tcl_Interp *interp, char *varName, char *newValue, int flags) ; extern "C" char * Tcl_SetVar2 (Tcl_Interp *interp, char *part1, char *part2, char *newValue, int flags) ; extern "C" char * Tcl_SignalId (int sig) ; extern "C" char * Tcl_SignalMsg (int sig) ; extern "C" void Tcl_Sleep (int ms) ; extern "C" void Tcl_SourceRCFile (Tcl_Interp *interp) ; extern "C" int Tcl_SplitList (Tcl_Interp *interp, char *list, int *argcPtr, char ***argvPtr) ; extern "C" void Tcl_SplitPath (char *path, int *argcPtr, char ***argvPtr) ; extern "C" void Tcl_StaticPackage (Tcl_Interp *interp, char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc) ; extern "C" int Tcl_StringMatch (char *string, char *pattern) ; extern "C" int Tcl_Tell (Tcl_Channel chan) ; extern "C" int Tcl_TraceVar (Tcl_Interp *interp, char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) ; extern "C" int Tcl_TraceVar2 (Tcl_Interp *interp, char *part1, char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData) ; extern "C" char * Tcl_TranslateFileName (Tcl_Interp *interp, char *name, Tcl_DString *bufferPtr) ; extern "C" void Tcl_UnlinkVar (Tcl_Interp *interp, char *varName) ; extern "C" int Tcl_UnregisterChannel (Tcl_Interp *interp, Tcl_Channel chan) ; extern "C" int Tcl_UnsetVar (Tcl_Interp *interp, char *varName, int flags) ; extern "C" int Tcl_UnsetVar2 (Tcl_Interp *interp, char *part1, char *part2, int flags) ; extern "C" void Tcl_UntraceVar (Tcl_Interp *interp, char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) ; extern "C" void Tcl_UntraceVar2 (Tcl_Interp *interp, char *part1, char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData) ; extern "C" void Tcl_UpdateLinkedVar (Tcl_Interp *interp, char *varName) ; extern "C" int Tcl_UpVar (Tcl_Interp *interp, char *frameName, char *varName, char *localName, int flags) ; extern "C" int Tcl_UpVar2 (Tcl_Interp *interp, char *frameName, char *part1, char *part2, char *localName, int flags) ; extern "C" int Tcl_VarEval ( Tcl_Interp * interp , ...) ; extern "C" ClientData Tcl_VarTraceInfo (Tcl_Interp *interp, char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) ; extern "C" ClientData Tcl_VarTraceInfo2 (Tcl_Interp *interp, char *part1, char *part2, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) ; extern "C" int Tcl_WaitForEvent (Tcl_Time *timePtr) ; extern "C" int Tcl_WaitPid (int pid, int *statPtr, int options) ; extern "C" void Tcl_WatchFile (Tcl_File file, int mask) ; extern "C" int Tcl_Write (Tcl_Channel chan, char *s, int slen) ; # 55 "spxtcl.cc" 2 } # 1 "spxtcl.hh" 1 extern "C" { # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 55 "spxtcl.hh" 2 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 1 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 1 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/va-pa.h" 1 3 # 52 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/va-pa.h" 3 # 24 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 2 3 # 130 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 3 # 202 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdarg.h" 3 # 2 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 2 3 # 566 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdio.h" 3 extern "C" { } # 56 "spxtcl.hh" 2 # 1 "/usr/include/signal.h" 1 3 # 1 "/usr/include/sys/signal.h" 1 3 # 1 "/usr/include/sys/sigevent.h" 1 3 typedef union sigval { int __sival_int; void * __sival_ptr; } sigval_t; typedef struct sigevent { int __sigev_notify; int __sigev_signo; sigval_t __sigev_value; } sigevent_t; enum __sigev_types { SIGEV_NONE = 1, SIGEV_SIGNAL }; # 15 "/usr/include/sys/signal.h" 2 3 # 1 "/usr/include/sys/siginfo.h" 1 3 enum __si_codes { SI_QUEUE = -2, SI_USER = -1, SI_TIMER = 1, SI_ASYNCIO= 2, SI_MESGQ = 3 }; typedef struct __siginfo { int si_signo; int si_code; int si_errno; sigval_t si_value; union { struct { pid_t __pid; union { struct { uid_t __uid; } __kill; struct { int __status; } __SIGCLD; } __pdata; } __proc; struct { void *__addr; } __fault; struct { int __fd; long __band; } __file; } __data; int __pad[10 ]; } siginfo_t; typedef struct { int si_code; int si_errno; union { struct { pid_t __pid; union { struct { uid_t __uid; } __kill; struct { int __status; } __SIGCLD; } __pdata; } __proc; struct { caddr_t *__addr; } __fault; struct { int __fd; long __band; } __file; } __data; } k_siginfo_t; # 16 "/usr/include/sys/signal.h" 2 3 # 1 "/usr/include/sys/newsig.h" 1 3 typedef struct __sigset_t { long sigset[8]; } sigset_t; # 1 "/usr/include/machine/save_state.h" 1 3 typedef struct __fp_dbl_block { double ss_fp0; double ss_fp1; double ss_fp2; double ss_fp3; double ss_fp4; double ss_fp5; double ss_fp6; double ss_fp7; double ss_fp8; double ss_fp9; double ss_fp10; double ss_fp11; double ss_fp12; double ss_fp13; double ss_fp14; double ss_fp15; double ss_fp16; double ss_fp17; double ss_fp18; double ss_fp19; double ss_fp20; double ss_fp21; double ss_fp22; double ss_fp23; double ss_fp24; double ss_fp25; double ss_fp26; double ss_fp27; double ss_fp28; double ss_fp29; double ss_fp30; double ss_fp31; } fp_dbl_block_t; typedef struct __fp_int_block { int ss_fpstat; int ss_fpexcept1; int ss_fpexcept2; int ss_fpexcept3; int ss_fpexcept4; int ss_fpexcept5; int ss_fpexcept6; int ss_fpexcept7; int ss_fp4_hi; int ss_fp4_lo; int ss_fp5_hi; int ss_fp5_lo; int ss_fp6_hi; int ss_fp6_lo; int ss_fp7_hi; int ss_fp7_lo; int ss_fp8_hi; int ss_fp8_lo; int ss_fp9_hi; int ss_fp9_lo; int ss_fp10_hi; int ss_fp10_lo; int ss_fp11_hi; int ss_fp11_lo; int ss_fp12_hi; int ss_fp12_lo; int ss_fp13_hi; int ss_fp13_lo; int ss_fp14_hi; int ss_fp14_lo; int ss_fp15_hi; int ss_fp15_lo; int ss_fp16_hi; int ss_fp16_lo; int ss_fp17_hi; int ss_fp17_lo; int ss_fp18_hi; int ss_fp18_lo; int ss_fp19_hi; int ss_fp19_lo; int ss_fp20_hi; int ss_fp20_lo; int ss_fp21_hi; int ss_fp21_lo; int ss_fp22_hi; int ss_fp22_lo; int ss_fp23_hi; int ss_fp23_lo; int ss_fp24_hi; int ss_fp24_lo; int ss_fp25_hi; int ss_fp25_lo; int ss_fp26_hi; int ss_fp26_lo; int ss_fp27_hi; int ss_fp27_lo; int ss_fp28_hi; int ss_fp28_lo; int ss_fp29_hi; int ss_fp29_lo; int ss_fp30_hi; int ss_fp30_lo; int ss_fp31_hi; int ss_fp31_lo; } fp_int_block_t; # 345 "/usr/include/machine/save_state.h" 3 typedef struct __reg64 { # 415 "/usr/include/machine/save_state.h" 3 int ss_reserved[2*64]; } __reg64_t; typedef struct __reg32 { uint32_t ss_reserved[2]; uint32_t ss_gr1_hi; uint32_t ss_gr1_lo; uint32_t ss_rp_hi; uint32_t ss_rp_lo; uint32_t ss_gr3_hi; uint32_t ss_gr3_lo; uint32_t ss_gr4_hi; uint32_t ss_gr4_lo; uint32_t ss_gr5_hi; uint32_t ss_gr5_lo; uint32_t ss_gr6_hi; uint32_t ss_gr6_lo; uint32_t ss_gr7_hi; uint32_t ss_gr7_lo; uint32_t ss_gr8_hi; uint32_t ss_gr8_lo; uint32_t ss_gr9_hi; uint32_t ss_gr9_lo; uint32_t ss_gr10_hi; uint32_t ss_gr10_lo; uint32_t ss_gr11_hi; uint32_t ss_gr11_lo; uint32_t ss_gr12_hi; uint32_t ss_gr12_lo; uint32_t ss_gr13_hi; uint32_t ss_gr13_lo; uint32_t ss_gr14_hi; uint32_t ss_gr14_lo; uint32_t ss_gr15_hi; uint32_t ss_gr15_lo; uint32_t ss_gr16_hi; uint32_t ss_gr16_lo; uint32_t ss_gr17_hi; uint32_t ss_gr17_lo; uint32_t ss_gr18_hi; uint32_t ss_gr18_lo; uint32_t ss_gr19_hi; uint32_t ss_gr19_lo; uint32_t ss_gr20_hi; uint32_t ss_gr20_lo; uint32_t ss_gr21_hi; uint32_t ss_gr21_lo; uint32_t ss_gr22_hi; uint32_t ss_gr22_lo; uint32_t ss_arg3_hi; uint32_t ss_arg3_lo; uint32_t ss_arg2_hi; uint32_t ss_arg2_lo; uint32_t ss_arg1_hi; uint32_t ss_arg1_lo; uint32_t ss_arg0_hi; uint32_t ss_arg0_lo; unsigned int ss_dp_hi; unsigned int ss_dp_lo; unsigned int ss_ret0_hi; unsigned int ss_ret0_lo; unsigned int ss_ret1_hi; unsigned int ss_ret1_lo; unsigned int ss_sp_hi; unsigned int ss_sp_lo; unsigned int ss_gr31_hi; unsigned int ss_gr31_lo; unsigned int ss_cr11_hi; unsigned int ss_cr11_lo; unsigned int ss_pcoq_head_hi; unsigned int ss_pcoq_head_lo; unsigned int ss_pcsq_head_hi; unsigned int ss_pcsq_head_lo; unsigned int ss_pcoq_tail_hi; unsigned int ss_pcoq_tail_lo; unsigned int ss_pcsq_tail_hi; unsigned int ss_pcsq_tail_lo; unsigned int ss_cr15_hi; unsigned int ss_cr15_lo; unsigned int ss_cr19_hi; unsigned int ss_cr19_lo; unsigned int ss_cr20_hi; unsigned int ss_cr20_lo; unsigned int ss_cr21_hi; unsigned int ss_cr21_lo; unsigned int ss_cr22_hi; unsigned int ss_cr22_lo; unsigned int ss_cpustate_hi; unsigned int ss_cpustate_lo; unsigned int ss_sr4_hi; unsigned int ss_sr4_lo; unsigned int ss_sr0_hi; unsigned int ss_sr0_lo; unsigned int ss_sr1_hi; unsigned int ss_sr1_lo; unsigned int ss_sr2_hi; unsigned int ss_sr2_lo; unsigned int ss_sr3_hi; unsigned int ss_sr3_lo; unsigned int ss_sr5_hi; unsigned int ss_sr5_lo; unsigned int ss_sr6_hi; unsigned int ss_sr6_lo; unsigned int ss_sr7_hi; unsigned int ss_sr7_lo; unsigned int ss_cr0_hi; unsigned int ss_cr0_lo; unsigned int ss_cr8_hi; unsigned int ss_cr8_lo; unsigned int ss_cr9_hi; unsigned int ss_cr9_lo; unsigned int ss_cr10_hi; unsigned int ss_cr10_lo; unsigned int ss_cr12_hi; unsigned int ss_cr12_lo; unsigned int ss_cr13_hi; unsigned int ss_cr13_lo; unsigned int ss_cr24_hi; unsigned int ss_cr24_lo; unsigned int ss_cr25_hi; unsigned int ss_cr25_lo; unsigned int ss_cr26_hi; unsigned int ss_cr26_lo; unsigned int ss_reserved2[6]; unsigned int ss_oldcksum; unsigned int ss_newcksum; } __reg32_t; typedef struct __ss_narrow { int ss_gr1; int ss_rp; int ss_gr3; int ss_gr4; int ss_gr5; int ss_gr6; int ss_gr7; int ss_gr8; int ss_gr9; int ss_gr10; int ss_gr11; int ss_gr12; int ss_gr13; int ss_gr14; int ss_gr15; int ss_gr16; int ss_gr17; int ss_gr18; int ss_gr19; int ss_gr20; int ss_gr21; int ss_gr22; int ss_arg3; int ss_arg2; int ss_arg1; int ss_arg0; unsigned int ss_dp; unsigned int ss_ret0; unsigned int ss_ret1; unsigned int ss_sp; unsigned int ss_gr31; unsigned int ss_cr11; unsigned int ss_pcoq_head; unsigned int ss_pcsq_head; unsigned int ss_pcoq_tail; unsigned int ss_pcsq_tail; unsigned int ss_cr15; unsigned int ss_cr19; unsigned int ss_cr20; unsigned int ss_cr21; unsigned int ss_cr22; unsigned int ss_cpustate; unsigned int ss_sr4; unsigned int ss_sr0; unsigned int ss_sr1; unsigned int ss_sr2; unsigned int ss_sr3; unsigned int ss_sr5; unsigned int ss_sr6; unsigned int ss_sr7; unsigned int ss_cr0; unsigned int ss_cr8; unsigned int ss_cr9; unsigned int ss_cr10; unsigned int ss_cr12; unsigned int ss_cr13; unsigned int ss_cr24; unsigned int ss_cr25; unsigned int ss_cr26; unsigned int ss_mpsfu_high; unsigned int ss_mpsfu_low; unsigned int ss_mpsfu_ovflo; } __ss_narrow_t; typedef struct __save_state { int ss_flags; __ss_narrow_t ss_narrow; int ss_pad; union { fp_dbl_block_t fpdbl; fp_int_block_t fpint; } ss_fpblock; char ss_xor[4*32]; union { __reg64_t ss_64; __reg32_t ss_32; } ss_wide; } save_state_t; # 743 "/usr/include/machine/save_state.h" 3 # 816 "/usr/include/machine/save_state.h" 3 # 875 "/usr/include/machine/save_state.h" 3 # 965 "/usr/include/machine/save_state.h" 3 # 1260 "/usr/include/machine/save_state.h" 3 # 43 "/usr/include/sys/newsig.h" 2 3 typedef struct { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; typedef save_state_t mcontext_t; struct __sub_ctxt { struct __ucontext *__uc_link; sigset_t __uc_sigmask; stack_t __uc_stack; }; typedef struct __ucontext { mcontext_t uc_mcontext; int uc_spares[8]; unsigned int uc_created_by_getcontext:1; unsigned int uc_reserved_flags:31; struct __sub_ctxt uc_subcontext; } ucontext_t; # 110 "/usr/include/sys/newsig.h" 3 # 17 "/usr/include/sys/signal.h" 2 3 # 34 "/usr/include/sys/signal.h" 3 typedef unsigned int sig_atomic_t; struct sigaction { union { void (*__sa_sigaction)(int, siginfo_t *, void *); void (*__sa_handler)(int ); } __handler; sigset_t sa_mask; int sa_flags; }; struct timespec { time_t tv_sec; long tv_nsec; }; typedef struct timespec timestruc_t; struct sigstack { void *ss_sp; int ss_onstack; }; struct sigvec { void (*sv_handler)(int ); int sv_mask; int sv_flags; }; extern "C" { extern void (*signal(int, void (*) (int )))(int ); extern int raise(int); extern int kill(pid_t, int); extern int sigemptyset(sigset_t *); extern int sigfillset(sigset_t *); extern int sigaddset(sigset_t *, int); extern int sigdelset(sigset_t *, int); extern int sigismember(const sigset_t *, int); extern int sigaction(int, const struct sigaction *, struct sigaction *); extern int sigprocmask(int, const sigset_t *, sigset_t *); extern int sigsuspend(const sigset_t *); extern int sigpending(sigset_t *); # 174 "/usr/include/sys/signal.h" 3 extern int sigwaitinfo(const sigset_t *set, siginfo_t *info); extern int sigtimedwait(const sigset_t *set, siginfo_t * info, const struct timespec *timeout); extern int sigqueue(pid_t pid, int signo, const union sigval value); extern void (*bsd_signal(int, void(*)(int)))(int); extern int killpg(pid_t, int); extern int sigstack(struct sigstack *, struct sigstack *); extern int sigaltstack(const stack_t *, stack_t *); extern int siginterrupt(int, int); extern void (*sigset(int, void (*)(int )))(int ); extern int sighold(int); extern int sigrelse(int); extern int sigignore(int); extern int sigpause(int); extern long sigblock(long); extern long sigsetmask(long); extern int sigvector(int, const struct sigvec *, struct sigvec *); extern int (*ssignal(int, int (*) (int )))(int ); extern ssize_t sigspace(size_t); extern int gsignal(int); # 253 "/usr/include/sys/signal.h" 3 } # 1 "/usr/include/sys/syscall.h" 1 3 # 1004 "/usr/include/sys/syscall.h" 3 # 478 "/usr/include/sys/signal.h" 2 3 # 1 "/usr/include/machine/frame.h" 1 3 typedef struct frame_marker { int fm_edp; int fm_esr4; int fm_erp; int fm_crp; int fm_sl; int fm_clup; int fm_ep; int fm_psp; } frame_marker_t; # 479 "/usr/include/sys/signal.h" 2 3 struct siglocal_misc { int sm_syscall; int sm_onstack; int sm_omask; char sm_syscall_action; char sm_eosys; unsigned short sm_error; int sm_rval1; int sm_rval2; int sm_arg[4 ]; }; struct siglocal { struct siglocal_misc sl_misc; save_state_t sl_ss; }; struct siglocalx { struct siglocal_misc sl_misc; ucontext_t sl_uc; siginfo_t sl_si; }; struct __xsi { struct __sub_ctxt sc; int __padding; siginfo_t si; }; struct sigcontext { union { struct siglocal sl; struct siglocalx sx; } sc_ctxt; int sc_args[4 ]; struct frame_marker sc_sfm; }; # 676 "/usr/include/sys/signal.h" 3 # 5 "/usr/include/signal.h" 2 3 # 57 "spxtcl.hh" 2 } # 1 "soplex.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 65 "soplex.hh" 2 # 1 "cachelpsolver.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 46 "cachelpsolver.hh" 2 # 1 "lpsolver.hh" 1 # 1 "svector.hh" 1 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 1 3 extern "C" { extern int __nl_char_size; typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; # 42 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 extern double atof(const char *); extern int atoi(const char *); extern long int atol(const char *); extern double strtod(const char *, char **); extern long int strtol(const char *, char **, int); extern unsigned long int strtoul(const char *, char **, int); extern int rand(void); extern void srand(unsigned int); extern int atexit(void (*) (void)); extern void exit(int); extern char *getenv(const char *); extern int system(const char *); inline int abs(int d) { return (d>0)?d:-d; } extern div_t div(int, int); extern ldiv_t ldiv(long int, long int); extern long int labs(long int); extern int mblen(const char *, size_t); extern int mbtowc(wchar_t *, const char *, size_t); extern int wctomb(char *, wchar_t); extern size_t mbstowcs(wchar_t *, const char *, size_t); extern size_t wcstombs(char *, const wchar_t *, size_t); extern void free(void *); extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); # 114 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 extern void abort(void); extern void *bsearch(const void *, const void *, size_t, size_t, int (*) (const void *, const void *)); extern void *calloc(size_t, size_t); extern void *malloc(size_t); extern void *realloc(void *, size_t); # 172 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 extern void setkey(const char *); extern void lcong48( unsigned short [] ); extern double drand48(void); extern double erand48(unsigned short []); extern long jrand48(unsigned short []); extern long lrand48(void); extern long mrand48(void); extern long nrand48(unsigned short []); extern void srand48(long); extern unsigned short *seed48(unsigned short []); extern int putenv(const char *); # 206 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 extern int clearenv(void); extern int getopt(int, char * const [], const char *); extern char *getpass(const char *); extern char *optarg; extern int optind; extern int opterr; # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/wait.h" 1 3 extern "C" { extern pid_t wait(int *); extern pid_t waitpid(pid_t, int *, int); } # 1 "/usr/include/sys/resource.h" 1 3 # 1 "/usr/include/sys/time.h" 1 3 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; # 76 "/usr/include/sys/time.h" 3 struct itimerspec { struct timespec it_interval; struct timespec it_value; }; typedef enum __clockid_t { CLOCK_INVALID = 0, CLOCK_REALTIME = 1, CLOCK_VIRTUAL = 2, CLOCK_PROFILE = 4, RTTIMER0 = 8, RTTIMER1 = 16 } clockid_t; typedef unsigned long timer_t; struct timeval { time_t tv_sec; long tv_usec; }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; struct timezone { int tz_minuteswest; int tz_dsttime; }; typedef struct __cycles { unsigned long hi; unsigned long lo; } cycles_t; extern "C" { extern double difftime(time_t, time_t); extern time_t mktime(struct tm *); extern time_t time(time_t *); extern char *asctime(const struct tm *); extern char *ctime(const time_t *); extern struct tm *gmtime(const time_t *); extern struct tm *localtime(const time_t *); extern size_t strftime(char *, size_t, const char *, const struct tm *); # 231 "/usr/include/sys/time.h" 3 # 293 "/usr/include/sys/time.h" 3 extern clock_t clock(void); extern void tzset(void); extern char *tzname[2]; extern int clock_settime(clockid_t, const struct timespec *); extern int clock_gettime(clockid_t, struct timespec *); extern int clock_getres(clockid_t, struct timespec *); extern int timer_create(clockid_t, sigevent_t *, timer_t *); extern int timer_delete(timer_t); extern int timer_settime(timer_t, int, const struct itimerspec *, struct itimerspec *); extern int timer_gettime(timer_t, struct itimerspec *); extern int timer_getoverrun(timer_t); extern int nanosleep(const struct timespec *, struct timespec *); # 360 "/usr/include/sys/time.h" 3 extern char *strptime(const char *, const char *, struct tm *); extern long timezone; extern int daylight; typedef long __fd_mask; # 459 "/usr/include/sys/time.h" 3 # 468 "/usr/include/sys/time.h" 3 # 499 "/usr/include/sys/time.h" 3 extern int getitimer(int, struct itimerval *); extern int setitimer(int, const struct itimerval *, struct itimerval *); extern int utimes(const char *path, const struct timeval amtimes[2]); extern int gettimeofday(struct timeval *, void *); extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int adjtime(const struct timeval *, struct timeval *); extern struct tm *getdate(const char *); extern int getdate_r(const char *, struct tm *, int *); extern int settimeofday(const struct timeval *, const struct timezone *); extern int stime(const time_t *); extern void profil(const void *, size_t, size_t, int); # 560 "/usr/include/sys/time.h" 3 extern int getdate_err; } struct ki_timeval { long tv_sec; long tv_nunit; }; # 21 "/usr/include/sys/resource.h" 2 3 # 1 "/usr/include/sys/_rlimit_body.h" 1 3 struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; # 31 "/usr/include/sys/resource.h" 2 3 # 42 "/usr/include/sys/resource.h" 3 # 64 "/usr/include/sys/resource.h" 3 struct rusage { struct timeval ru_utime; struct timeval ru_stime; long ru_maxrss; long ru_ixrss; long ru_idrss; long ru_isrss; long ru_minflt; long ru_majflt; long ru_nswap; long ru_inblock; long ru_oublock; long ru_ioch; long ru_msgsnd; long ru_msgrcv; long ru_nsignals; long ru_nvcsw; long ru_nivcsw; }; extern "C" { extern int getpriority(int, id_t); extern int getrusage(int, struct rusage *); extern int setpriority(int, id_t, int); extern int getrlimit(int, struct rlimit *); extern int setrlimit(int, const struct rlimit *); # 152 "/usr/include/sys/resource.h" 3 } # 185 "/usr/include/sys/resource.h" 3 # 83 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/wait.h" 2 3 extern "C" { extern pid_t wait3(int *, int, struct rusage *); } typedef enum { P_PID, P_PGID, P_SID, P_UID, P_GID, P_CID, P_ALL } idtype_t; extern int waitid(idtype_t, id_t, siginfo_t *, int); union wait { int w_status; struct { unsigned short w_pad; unsigned int w_Retcode:8; unsigned int w_Coredump:1; unsigned int w_Termsig:7; } w_T; struct { unsigned short w_pad; unsigned int w_Stopsig:8; unsigned int w_Stopval:8; } w_S; }; # 231 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/sys/wait.h" 3 # 231 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 2 3 extern int mkstemp(char *); extern char *mktemp(char *); extern int ttyslot(void); extern long a64l(const char *); extern char *l64a(long); extern char *ecvt(double, int, int *, int *); extern char *fcvt(double, int, int *, int *); extern char *gcvt(double, int, char *); extern int getsubopt(char **, char * const *, char **); extern int grantpt(int); extern char *ptsname(int); extern char *realpath(const char *, char *); extern int unlockpt(int); extern void *valloc(size_t); extern char *initstate(unsigned int, char *, size_t); extern char *setstate(char *); extern void srandom(unsigned int); extern long random(void); # 287 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 struct mallinfo { int arena; int ordblks; int smblks; int hblks; int hblkhd; int usmblks; int fsmblks; int uordblks; int fordblks; int keepcost; }; typedef struct { unsigned int word1, word2, word3, word4; } long_double; # 1 "/usr/include/pwd.h" 1 3 extern "C" { struct passwd { char *pw_name; char *pw_passwd; uid_t pw_uid; gid_t pw_gid; char *pw_age; char *pw_comment; char *pw_gecos; char *pw_dir; char *pw_shell; int32_t pw_audid; int pw_audflg; }; extern struct passwd *getpwuid(uid_t); extern struct passwd *getpwnam(const char *); extern void endpwent(void); extern struct passwd *getpwent(void); extern void setpwent(void); struct s_passwd { char *pw_name; char *pw_passwd; char *pw_age; int32_t pw_audid; int pw_audflg; }; extern struct passwd *fgetpwent(FILE *); extern struct s_passwd *getspwent(void); extern struct s_passwd *getspwuid(uid_t); extern struct s_passwd *getspwaid(int32_t); extern struct s_passwd *getspwnam(char *); extern struct s_passwd *fgetspwent(FILE *); # 93 "/usr/include/pwd.h" 3 # 112 "/usr/include/pwd.h" 3 } # 330 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 2 3 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/errno.h" 1 3 extern int errno; # 1 "/usr/include/sys/errno.h" 1 3 extern "C" { extern int errno; } # 206 "/usr/include/sys/errno.h" 3 # 10 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/errno.h" 2 3 extern "C" { extern void perror(const char*); extern int sys_nerr; extern char *sys_errlist[]; extern char *strerror (int); } extern int errno; # 334 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 2 3 extern char *_ldecvt(long_double, int, int *, int *); extern char *_ldfcvt(long_double, int, int *, int *); extern char *_ldgcvt(long_double, int, char *); extern int getpw(int, char *); extern void l3tol(long *, const char *, int); extern void ltol3(char *, const long *, int); extern char *ltostr(long, int); extern char *ultostr(unsigned long, int); extern char *ltoa(long); extern char *ultoa(unsigned long); extern void memorymap(int); extern struct mallinfo mallinfo(void); extern int mallopt(int, int); extern long_double strtold(const char *, char **); # 362 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 # 387 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/stdlib.h" 3 } # 58 "svector.hh" 2 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 59 "svector.hh" 2 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 1 3 extern "C" { # 29 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 3 extern double acos(double); extern double asin(double); extern double atan(double); extern double atan2(double, double); extern double cos(double); extern double sin(double); extern double tan(double); extern double acosd(double); extern double asind(double); extern double atand(double); extern double atan2d(double, double); extern double cosd(double); extern double sind(double); extern double tand(double); extern double cosh(double); extern double sinh(double); extern double tanh(double); extern double acosh(double); extern double asinh(double); extern double atanh(double); extern double cbrt(double); extern double exp(double); extern double frexp(double, int *); extern double ldexp(double, int); extern double log(double); extern double log10(double); extern double log2(double); extern double modf(double, double *); extern double pow(double, double); } inline double pow(double __d,int __expon) { return pow(__d,(double)__expon); } extern "C" { extern double sqrt(double); extern double ceil(double); extern double fabs(double); extern double floor(double); extern double fmod(double, double); extern double rint(double); extern double scalb(double,double); extern double logb(double); extern double nextafter(double, double); extern double remainder(double, double); extern double expm1(double); extern int ilogb(double); extern double log1p(double); extern float acosf( float); extern float asinf( float); extern float atanf( float); extern float atan2f( float, float); extern float cosf( float); extern float sinf( float); extern float tanf( float); extern float sinhf( float); extern float coshf( float); extern float tanhf( float); extern float acosdf( float); extern float asindf( float); extern float atandf( float); extern float atan2df( float, float); extern float cosdf( float); extern float sindf( float); extern float tandf( float); extern float expf( float); extern float fabsf( float); extern float logf( float); extern float log10f( float); extern float log2f( float); extern float powf( float, float ); extern float sqrtf(float); extern float fmodf(float,float); extern float cbrtf(float); extern int finite(double); extern int finitef(float); extern double copysign(double,double); extern float copysignf(float,float); extern double drem(double, double); # 228 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 3 # 257 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 3 extern double erf(double); extern double erfc(double); extern double gamma(double); extern double lgamma(double); extern int isnan(double); extern int isnanf(float); extern int isinf(double); extern int isinff(float); extern double hypot(double, double); extern double j0(double); extern double j1(double); extern double jn(int, double); extern double y0(double); extern double y1(double); extern double yn(int, double); # 297 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 3 extern int signgam; struct __math_exception { int type; char *name; double arg1; double arg2; double retval; }; extern int errno; struct __math_exception ; extern int matherr(struct __math_exception *); extern double cabs(); # 388 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/math.h" 3 extern int fpclassify(double); extern int fpclassifyf(float); extern int isnan(double); extern int isnanf(float); typedef long fp_control; typedef int fp_except; typedef enum { FP_RZ=0, FP_RN, FP_RP, FP_RM } fp_rnd; extern fp_rnd fpgetround(void); extern fp_rnd fpsetround(fp_rnd); extern fp_except fpgetmask(void); extern fp_except fpsetmask(fp_except); extern fp_except fpgetsticky(void); extern fp_except fpsetsticky(fp_except); extern void fpsetdefaults(void); extern int fpgetfastmode(void); extern int fpsetfastmode(int); extern fp_control fpgetcontrol(void); extern fp_control fpsetcontrol(fp_control); } # 60 "svector.hh" 2 # 1 "vector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 112 "vector.hh" 2 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/string.h" 1 3 extern "C" { extern int memcmp(const void *, const void *, size_t); extern char *strncat(char *, const char *, size_t); extern int strncmp(const char *, const char *, size_t); extern void *memmove(void *, const void *, size_t); extern char *strcpy(char *, const char *); extern char *strncpy(char *, const char *, size_t); extern char *strcat(char *, const char *); extern int strcmp(const char *, const char *); extern int strcoll(const char *, const char *); extern size_t strxfrm(char *, const char *, size_t); extern char *strchr(const char *, int); extern char *strpbrk(const char *, const char *); extern char *strrchr(const char *, int); extern char *strstr(const char *, const char *); extern char *strtok(char *, const char *); extern char *strerror(int); # 65 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/string.h" 3 extern void *memcpy(void *, const void *, size_t); extern void *memchr(const void *, int, size_t); extern void *memset(void *, int, size_t); extern size_t strcspn(const char *, const char *); extern size_t strspn(const char *, const char *); extern size_t strlen(const char *); extern void *memccpy(void *, const void *, int, size_t); extern char *strdup(const char *); extern char *strrstr(const char *, const char *); extern int strcasecmp(const char *, const char *); extern int strncasecmp(const char *, const char *, size_t); extern int nl_strcmp(const char *, const char *); extern int nl_strncmp(const char *, const char *, size_t); } # 113 "vector.hh" 2 class SLUFactor ; class SVector ; class SSVector ; class SubSVector ; class IdxSet ; extern "C" { # 1 "vectorC.h" 1 void Vector_MultAddSSVector( register double* vec, register double x, register int n, register const int *idx, register const double *val ) ; void Vector_MultAddSVector( register double* vec, register double x, int n, void *elem ) ; void Vector_MultAddVector( register double x, register int n, register double* v, register const double* w ) ; void Vector_Set0toSSVector( register double*zero, register int n, register const int* idx, register const double* val ) ; double MultiplyVectorSSVector( register const double* dense, register int n, register const int* idx, register const double* val ) ; double MultiplyVectorVector( register const double* v1, register int dim, register const double* v2 ) ; # 125 "vector.hh" 2 } class Vector { friend class LP ; friend class GlobalPointer ; friend Vector& Usolve(Vector&, const SLUFactor&) ; friend Vector& Usolve2(Vector&, Vector&, const SLUFactor&) ; protected: int dimen ; double *val ; public: int dim() const { return dimen ; } double& operator[](int n) { ((void) (( n >= 0 && n < dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "vector.hh" , 198 , "n >= 0 && n < dim()" ), 0) )) ; return val[n] ; } double operator[](int n) const { ((void) (( n >= 0 && n < dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "vector.hh" , 205 , "n >= 0 && n < dim()" ), 0) )) ; return val[n] ; } Vector& operator+=(const Vector& vec) ; Vector& operator+=(const SVector& vec) ; Vector& operator+=(const SubSVector& vec) ; Vector& operator+=(const SSVector& vec) ; Vector& operator-=(const Vector& vec) ; Vector& operator-=(const SVector& vec) ; Vector& operator-=(const SubSVector& vec) ; Vector& operator-=(const SSVector& vec) ; Vector& operator*=(double x) ; double operator*(const SSVector& v) const ; double operator*(const SVector& v) const ; double operator*(const SubSVector& v) const ; double operator*(const Vector& v) const { ((void) (( v.dim() == dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "vector.hh" , 240 , "v.dim() == dim()" ), 0) )) ; return MultiplyVectorVector( val, dimen, v.val ) ; } double maxAbs() const ; double length() const ; double length2() const ; Vector& multAdd(double x, const SVector& vec) ; Vector& multAdd(double x, const SubSVector& vec) ; Vector& multAdd(double x, const SSVector& svec) ; Vector& multAdd(double x, const Vector& vec) { ((void) (( vec.dim() == dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "vector.hh" , 260 , "vec.dim() == dim()" ), 0) )) ; Vector_MultAddVector( x, dim(), *this, vec ) ; return *this ; } operator double*() { return val ; } operator const double*() const { return val ; } friend ostream& operator<<(ostream& s, const Vector& vec) ; int isConsistent() const ; void clear() { if( dimen) memset( val, 0, dimen*sizeof(double) ) ; } Vector& clear(const IdxSet& idx) ; Vector& operator=(const Vector& vec) ; Vector& operator=(const SVector& vec) ; Vector& operator=(const SSVector& vec) ; Vector& assign(const SVector& psv) ; Vector& assign(const SSVector& sv) ; Vector(int dim, double *vl) { ((void) (( dim >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "vector.hh" , 316 , "dim >= 0" ), 0) )) ; Vector::dimen = dim ; Vector::val = vl ; } } ; # 64 "svector.hh" 2 struct SVector_Element { double val ; int idx ; } ; class SVector { friend class GlobalPointer ; friend class Vector ; friend class SSVector ; public: typedef SVector_Element Element ; # 151 "svector.hh" protected: Element *elem ; public: void toFront(int n) ; void add(int i, double v) { int n = size() ; elem[n].idx = i ; elem[n].val = v ; size() = n+1 ; ((void) (( size() <= max() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 175 , "size() <= max()" ), 0) )) ; } void add(const SVector& sv) { add(sv.size(), sv.elem) ; } void add(int n, const int i[], const double v[]) ; void add(int n, const Element e[]) ; void remove(int n, int m) ; void remove(int n) { ((void) (( n < size() && n >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 194 , "n < size() && n >= 0" ), 0) )) ; elem[n] = elem[--size()] ; } void clear() { size() = 0 ; } void sort() ; int size() const { return elem[-1].idx ; } int max() const { return *(int*)&(elem[-1].val) ; } int dim() const ; int number(int i) const { int n = size() ; Element* e = &(elem[n]) ; while(n--) { --e ; if( e->idx == i ) return n ; } return -1 ; } double operator[](int i) const { int n = number(i) ; if(n >= 0) return elem[n].val ; return 0 ; } Element& element(int n) { ((void) (( n >= 0 && n < max() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 246 , "n >= 0 && n < max()" ), 0) )) ; return elem[n] ; } Element element(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 253 , "n >= 0 && n < size()" ), 0) )) ; return elem[n] ; } int& index(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 260 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].idx ; } int index(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 267 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].idx ; } double& value(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 274 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].val ; } double value(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 281 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].val ; } double maxAbs() const ; double length() const { return sqrt(length2()) ; } double length2() const ; SVector& operator*=(double x) ; double operator*(const Vector& w) const ; friend ostream& operator<<(ostream& os, const SVector& v) ; SVector& operator=(const SSVector& sv) ; SVector& operator=(const SVector& sv) ; SVector& operator=(const Vector& sv) ; SVector& assign(const Vector& vec, double eps = 1e-12) ; int isConsistent() const ; SVector(int n=0, Element* mem=0) { setMem(n, mem) ; } Element* mem() const { return elem-1 ; } int& size() { ((void) (( elem ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 339 , "elem" ), 0) )) ; return elem[-1].idx ; } int& max() { ((void) (( elem ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 340 , "elem" ), 0) )) ; return *(int*)(&elem[-1].val) ; } void setMem( int n, Element* elmem ) { if( n ) { ((void) (( n > 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 345 , "n > 0" ), 0) )) ; ((void) (( elmem ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 346 , "elmem" ), 0) )) ; elmem->val = 0 ; elem = &(elmem[1]) ; size() = 0 ; max() = n-1 ; } else elem = 0 ; } } ; inline Vector& Vector::multAdd(double x, const SVector& vec) { ((void) (( vec.dim() <= dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svector.hh" , 361 , "vec.dim() <= dim()" ), 0) )) ; Vector_MultAddSVector( val, x, vec.size(), vec.elem ) ; return *this ; } # 94 "lpsolver.hh" 2 # 1 "lpcolset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 64 "lpcolset.hh" 2 # 1 "lpcol.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 59 "lpcol.hh" 2 # 1 "dsvector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 61 "dsvector.hh" 2 # 1 "ssvector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 60 "ssvector.hh" 2 # 1 "dvector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 95 "dvector.hh" 2 class DVector : public Vector { int memsize ; double* mem ; public: friend DVector operator+(const Vector& v, const Vector& w) ; friend DVector operator+(const SVector& v, const Vector& w) ; friend DVector operator+(const Vector& v, const SVector& w) ; friend DVector operator-(const Vector& v, const Vector& w) ; friend DVector operator-(const SVector& v, const Vector& w) ; friend DVector operator-(const Vector& v, const SVector& w) ; friend DVector operator-(const Vector& vec) ; friend DVector operator-(const SVector& vec) ; friend DVector operator*(const Vector& v, double x) ; friend DVector operator*(double x, const Vector& v) ; DVector& operator+=(const Vector& vec) { Vector::operator+=(vec) ; return *this ; } DVector& operator+=(const SVector& vec) { Vector::operator+=(vec) ; return *this ; } DVector& operator-=(const Vector& vec) { Vector::operator-=(vec) ; return *this ; } DVector& operator-=(const SVector& vec) { Vector::operator-=(vec) ; return *this ; } DVector& operator*=(double x) { Vector::operator*=(x) ; return *this ; } DVector& operator=(const Vector& vec) { if( vec.dim() != dim() ) reDim( vec.dim() ) ; Vector::operator=(vec) ; return *this ; } DVector& operator=(const DVector& vec) { if( vec.dim() != dim() ) reDim( vec.dim() ) ; Vector::operator=(vec) ; return *this ; } DVector& operator=(const SVector& vec) { Vector::operator=(vec) ; return *this ; } void reDim(int newdim) ; void reSize(int newsize) ; void reSize(int newsize, int newdim) ; int memSize() const { return memsize ; } friend istream& operator>>(istream& s, DVector& vec) ; DVector(const Vector& old) ; DVector(const DVector& old) ; DVector(int dim = 0) ; ~DVector() ; int isConsistent() const ; } ; # 68 "ssvector.hh" 2 # 1 "subsvector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 43 "subsvector.hh" 2 class SubSVector { friend Vector& Vector::multAdd(double x, const SubSVector& vec) ; SVector::Element* elem ; int num ; SVector* svec ; public: void toFront(int n) ; void sort() ; int size() const { return num ; } int& size() { return num ; } int dim() const ; int number(int i) const ; double operator[](int i) const { int n = number(i) ; if(n >= 0) return elem[n].val ; return 0 ; } SVector::Element& element(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 119 , "n >= 0 && n < size()" ), 0) )) ; return elem[n] ; } SVector::Element element(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 126 , "n >= 0 && n < size()" ), 0) )) ; return elem[n] ; } int& index(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 133 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].idx ; } int index(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 140 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].idx ; } double& value(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 147 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].val ; } double value(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 154 , "n >= 0 && n < size()" ), 0) )) ; return elem[n].val ; } double length() const { return sqrt(length2()) ; } double length2() const ; SubSVector& operator*=(double x) ; double operator*(const Vector& w) const ; friend ostream& operator<<(ostream& os, const SubSVector& v) ; SubSVector( SVector* sv=0, int first=0, int len=0 ) : elem( (sv && first < sv->max()) ? &sv->element(first) : 0 ) , num ( len ) , svec( sv ) { ((void) (( isConsistent() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 189 , "isConsistent()" ), 0) )) ; } SubSVector(const SubSVector& old) : elem( old.elem ) , num ( old.num ) { ((void) (( isConsistent() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 194 , "isConsistent()" ), 0) )) ; } int isConsistent() const ; }; inline Vector& Vector::multAdd(double x, const SubSVector& vec) { ((void) (( vec.dim() <= dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "subsvector.hh" , 204 , "vec.dim() <= dim()" ), 0) )) ; Vector_MultAddSVector( val, x, vec.size(), vec.elem ) ; return *this ; } # 69 "ssvector.hh" 2 # 1 "didxset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 62 "didxset.hh" 2 # 1 "idxset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 92 "idxset.hh" 2 class IdxSet { protected: friend class Vector ; int num ; int len ; int *idx ; public: int& index(int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 135 , "n >= 0 && n < size()" ), 0) )) ; return idx[n] ; } int index(int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 142 , "n >= 0 && n < size()" ), 0) )) ; return idx[n] ; } int size() const { return num ; } int max() const { return len ; } int dim() const ; int number(int i) const ; void add(int n) { ((void) (( n >= 0 && n + size() <= max() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 178 , "n >= 0 && n + size() <= max()" ), 0) )) ; num += n ; } void add(const IdxSet& set) { add(set.size(), set.idx) ; } void add(int n, const int i[]) ; void addIdx( int i ) { ((void) (( size() < max() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 192 , "size() < max()" ), 0) )) ; idx[num++] = i ; } void remove(int n, int m) ; void remove(int n) { if(n < size() && n >= 0) idx[n] = idx[--num] ; } void clear() { num = 0 ; } void setMax(int mx) { len = mx ; } void setSize(int sz) { num = sz ; ((void) (( size() <= max() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 234 , "size() <= max()" ), 0) )) ; ((void) (( size() >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 235 , "size() >= 0" ), 0) )) ; } int*& indexMem() { return idx ; } const int* indexMem() const { return idx ; } operator int* () { return idx ; } operator const int* () const { return idx ; } void toFront(int n) ; IdxSet& operator=(const IdxSet& set) ; int isConsistent() const ; IdxSet(int n=0, int imem[]=0, int l=0) : num(l), len(n), idx(imem) { ((void) (( isConsistent() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idxset.hh" , 274 , "isConsistent()" ), 0) )) ; } } ; # 67 "didxset.hh" 2 class DIdxSet : public IdxSet { private: int*& indexMem() ; public: DIdxSet& operator=(const IdxSet& sv) { int n = sv.size() ; if(max() - size() < n) setMax(size() + n) ; IdxSet::operator=(sv) ; return *this ; } DIdxSet& operator=(const DIdxSet& sv) { return operator=(IdxSet(sv)) ; } void add(int n) { if(max() - size() < n) setMax(size() + n) ; IdxSet::add(n) ; } void add(const IdxSet& sv) { int n = sv.size() ; if(max() - size() < n) setMax(size() + n) ; IdxSet::add(sv) ; } void add(int n, const int *i) { if(max() - size() < n) setMax(size() + n) ; IdxSet::add(n, i) ; } void setMax(int newmax=1) ; DIdxSet(const IdxSet& old) ; DIdxSet(const DIdxSet& old) ; DIdxSet(int n = 8) ; ~DIdxSet() ; } ; # 71 "ssvector.hh" 2 class SVSet ; class SSVector : protected DVector, protected DIdxSet { SSVector& assign2product1(const SVSet& A, const SSVector& x ) ; SSVector& assign2productShort(const SVSet& A, const SSVector& x ) ; SSVector& assign2productFull(const SVSet& A, const SSVector& x ) ; int setupStatus ; friend class DVector ; friend class Vector ; friend class DSVector ; friend class SMoPlex ; public: double epsilon ; int isSetup() const { return setupStatus ; } void unSetup() { setupStatus = 0 ; } void setup( ) ; void forceSetup( ) { setupStatus = 1 ; } int index(int n) const { ((void) (( isSetup() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 156 , "isSetup()" ), 0) )) ; return IdxSet::index(n) ; } double value(int n) const { ((void) (( isSetup() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 163 , "isSetup()" ), 0) )) ; ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 164 , "n >= 0 && n < size()" ), 0) )) ; return val[idx[n]] ; } int number(int i) const { ((void) (( isSetup() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 171 , "isSetup()" ), 0) )) ; return IdxSet::number(i) ; } int size() const { ((void) (( isSetup() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 178 , "isSetup()" ), 0) )) ; return IdxSet::size() ; } void add( int i, double x ) { ((void) (( val[i] == 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 187 , "val[i] == 0" ), 0) )) ; ((void) (( number(i) < 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 188 , "number(i) < 0" ), 0) )) ; addIdx(i) ; val[i] = x ; } void setValue( int i, double x ) ; void clearIdx( int i ) { if( isSetup() ) { int n = number(i) ; if( n >= 0 ) remove( n ) ; } val[i] = 0 ; } void clearNum( int n ) { ((void) (( isSetup() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 211 , "isSetup()" ), 0) )) ; ((void) (( index(n) >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 212 , "index(n) >= 0" ), 0) )) ; val[index(n)] = 0 ; remove( n ) ; } double operator[](int i) const { return val[i] ; } const int* indexMem() const { return IdxSet::indexMem() ; } const double* values() const { return val ; } const IdxSet& indices() const { return *this ; } int* altIndexMem() { unSetup() ; return IdxSet::indexMem() ; } double* altValues() { unSetup() ; return val ; } IdxSet& altIndices() { unSetup() ; return *this ; } SSVector& operator+=(const Vector& vec) ; SSVector& operator+=(const SVector& vec) ; SSVector& operator+=(const SubSVector& vec) ; SSVector& operator+=(const SSVector& vec) ; SSVector& operator-=(const Vector& vec) ; SSVector& operator-=(const SVector& vec) ; SSVector& operator-=(const SubSVector& vec) ; SSVector& operator-=(const SSVector& vec) ; SSVector& operator*=(double x) ; SSVector& multAdd(double x, const SSVector& vec ) ; SSVector& multAdd(double x, const SVector& vec ) ; SSVector& multAdd(double x, const SubSVector& vec ) ; SSVector& multAdd(double x, const Vector& vec ) ; SSVector& assign2product(const SSVector& x, const SVSet& A ) ; SSVector& assign2product(const SVSet& A, const SSVector& x ) ; SSVector& assign2product4setup(const SVSet& A, const SSVector& x ) ; SSVector& assign2productAndSetup(const SVSet& A, SSVector& x ) ; double maxAbs() const ; double length() const ; double length2() const ; int dim() const { return dimen ; } void reDim ( int newdim ) ; void setSize( int n ) { unSetup() ; IdxSet::setSize( n ) ; } void reMem( int newsize ) ; void clear () ; SSVector& operator=(const SSVector& rhs) ; SSVector& operator=(SSVector& rhs) ; SSVector& operator=(const SVector& rhs) ; SSVector& operator=(const Vector& rhs) { unSetup() ; Vector::operator=(rhs) ; return *this ; } SSVector& assign(const SVector& rhs ) ; SSVector( const Vector& vec, double eps=1e-16 ) : DVector ( vec ) , DIdxSet ( vec.dim()+1 ) , setupStatus( 0 ) , epsilon ( eps ) { } SSVector( int dim=0, double eps=1e-16 ) : DVector ( dim ) , DIdxSet ( dim+1 ) , setupStatus( 1 ) , epsilon ( eps ) { Vector::clear() ; } SSVector( const SSVector& vec ) : DVector ( vec ) , DIdxSet ( vec.dim()+1 ) , setupStatus( vec.setupStatus ) , epsilon ( vec.epsilon ) { *((DIdxSet*)this) = vec ; } int isConsistent() const ; } ; inline Vector& Vector::multAdd(double x, const SSVector& svec) { ((void) (( svec.dim() <= dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 376 , "svec.dim() <= dim()" ), 0) )) ; if( svec.isSetup() ) Vector_MultAddSSVector( val, x, svec.size(), svec.indexMem(), svec.val ) ; else multAdd( x, *(const Vector*)&svec ) ; return *this ; } inline Vector& Vector::assign(const SSVector& svec) { ((void) (( svec.dim() <= dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 389 , "svec.dim() <= dim()" ), 0) )) ; if( svec.isSetup() ) Vector_Set0toSSVector( val, svec.size(), svec.indexMem(), svec.val ) ; else operator=( *(const Vector*)&svec ) ; return *this ; } inline Vector& Vector::operator=(const SSVector& vec) { if( vec.isSetup() ) { clear ( ) ; assign( vec ) ; } else operator=( *(const Vector*)&vec ) ; return *this ; } inline double Vector::operator*(const SSVector& v) const { ((void) (( dim() == v.dim() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "ssvector.hh" , 411 , "dim() == v.dim()" ), 0) )) ; if( v.isSetup() ) return MultiplyVectorSSVector( val, v.size(), v.indexMem(), v.val ) ; else return operator*( *(const Vector*)&v ) ; } # 66 "dsvector.hh" 2 class DSVector : public SVector { friend class GlobalPointer ; friend class SLinSolver ; Element* theelem ; int* mem() ; void allocMem( int ) ; void makeMem(int n) { if(max() - size() < ++n) setMax(size() + n) ; } public: DSVector& operator=(const SSVector& sv) { int n = sv.size() ; clear() ; makeMem(n) ; SVector::operator=(sv) ; return *this ; } DSVector& operator=(const SVector& sv) { int n = sv.size() ; clear() ; makeMem(n) ; SVector::operator=(sv) ; return *this ; } DSVector& operator=(const DSVector& sv) { int n = sv.size() ; clear() ; makeMem(n) ; SVector::operator=(sv) ; return *this ; } DSVector& operator=(const Vector& vec) ; DSVector& assign(const Vector& vec, double eps = 1e-16) ; void add(const SVector& sv) { int n = sv.size() ; clear() ; makeMem(n) ; SVector::add(sv) ; } void add(int i, double v) { makeMem(1) ; SVector::add(i, v) ; } void add(int n, const int *i, const double *v) { makeMem(n) ; SVector::add(n, i, v) ; } void setMax(int newmax = 1) ; DSVector(const Vector& vec) ; DSVector(const SVector& old) ; DSVector(const DSVector& old) ; DSVector(int n = 8) ; ~DSVector() ; int isConsistent() const ; } ; # 66 "lpcol.hh" 2 class LPCol { private: double up, low, object ; DSVector vec ; public: double obj() const { return object ; } double& obj() { return object ; } double upper() const { return up ; } double& upper() { return up ; } double lower() const { return low ; } double& lower() { return low ; } const SVector& colVector() const { return vec ; } DSVector& colVector() { return vec ; } LPCol(const LPCol& old) : up(old.up), low(old.low), object(old.object), vec(old.vec) { } LPCol( int defDim = 0 ) : up(1e+300), low(0), object(0), vec( defDim ) { } LPCol(double obj, const SVector& vector, double upper, double lower) : up(upper), low(lower), object(obj), vec(vector) { } int isConsistent() const { return vec.isConsistent() ; } } ; # 71 "lpcolset.hh" 2 # 1 "svset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 55 "svset.hh" 2 # 1 "dataset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 107 "dataset.hh" 2 # 1 "dataarray.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 91 "dataarray.hh" 2 # 1 "/usr/include/memory.h" 1 3 # 93 "dataarray.hh" 2 template class DataArray { friend class GlobalPointer ; int thesize ; int themax ; T *data ; public: T& operator[](int n) { ((void) (( n >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 164 , "n >= 0" ), 0) )) ; ((void) (( n < thesize ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 165 , "n < thesize" ), 0) )) ; return data[n] ; } const T& operator[](int n) const { ((void) (( n >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 171 , "n >= 0" ), 0) )) ; ((void) (( n < thesize ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 172 , "n < thesize" ), 0) )) ; return data[n] ; } T& last() { ((void) (( thesize > 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 180 , "thesize > 0" ), 0) )) ; return data[thesize-1] ; } const T& last() const { ((void) (( thesize > 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 186 , "thesize > 0" ), 0) )) ; return data[thesize-1] ; } operator T* () { return data ; } operator const T* () const { return data ; } long append( const T& t ) { return insert( thesize, 1, &t ) ; } long append( int n, const T t[] ) { return insert( thesize, n, t ) ; } long append( const DataArray& t ) { return insert( thesize, t ) ; } long insert( int i, int n ) { long j = size() ; long delta = reSize( thesize+n ) ; while(i < j--) data[j+n] = data[j] ; return delta ; } long insert(int i, int n, const T t[]) { if(n > 0) { long delta = insert(i, n) ; memcpy(&(data[i]), t, n*sizeof(T)) ; return delta ; } return 0 ; } long insert(int i, const DataArray& t) { if( t.size() ) { long delta = insert(i, t.size()) ; memcpy(&(data[i]), t.data, t.size()*sizeof(T)) ; return delta ; } return 0 ; } void remove( int n=0, int m=1 ) { ((void) (( n < size() && n >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 242 , "n < size() && n >= 0" ), 0) )) ; if(n+m < size()) memcpy( &(data[n]), &(data[n+m]), (size()-(n+m)) * sizeof(T) ) ; else m = size() - n ; thesize -= m ; } void removeLast( int m=1 ) { ((void) (( m <= size() && m >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 252 , "m <= size() && m >= 0" ), 0) )) ; thesize -= m ; } void clear() { thesize = 0 ; } int size() const { return thesize ; } long reSize(int newsize) { ((void) (( memFactor >= 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 269 , "memFactor >= 1" ), 0) )) ; if( newsize > themax ) return reMax( int(memFactor * newsize), newsize ) ; else if( newsize < 0 ) thesize = 0 ; else thesize = newsize ; return 0 ; } int max() const { return themax ; } long reMax( int newMax = 1, int newSize = -1 ) { if( newSize >= 0 ) thesize = newSize ; if( newMax < newSize ) newMax = newSize ; if( newMax < 1 ) newMax = 1 ; if( newMax == themax ) return 0 ; themax = newMax ; long olddata = long(data) ; if( thesize <= 0 ) { free( data ) ; data = (T*)malloc( themax * sizeof(T) ) ; } else data = (T*)realloc( data, themax * sizeof(T) ) ; if( data == 0 ) { cerr << "ERROR: DataArray could not reallocate memory\n" ; exit(-1) ; } ((void) (( data ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 319 , "data" ), 0) )) ; return long(data) - olddata ; } double memFactor ; DataArray& operator=(const DataArray& rhs) { reSize( rhs.size() ) ; memcpy( data, rhs.data, size() * sizeof(T) ) ; return *this ; } int isConsistent() const { if( data == 0 || themax < 1 || themax < thesize) { cout << "Inconsistency detected in class DataArray\n" ; return 0 ; } return 1 ; } DataArray(const DataArray& old) : thesize( old.thesize ) , themax ( old.themax ) , memFactor ( old.memFactor ) { data = (T*)malloc( max() * sizeof(T) ) ; if( data == 0 ) { cerr << "ERROR: DataArray could not allocate memory\n" ; exit(-1) ; } if( thesize ) memcpy( data, old.data, thesize * sizeof(T) ) ; ((void) (( isConsistent() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 367 , "isConsistent()" ), 0) )) ; } DataArray( int size = 0, int max = 0, double fac = 1.2 ) : memFactor ( fac ) { thesize = (size < 0) ? 0 : size ; if( max > thesize ) themax = max ; else themax = (thesize == 0) ? 1 : thesize ; data = (T*)malloc( themax * sizeof(T) ) ; if( data == 0 ) { cerr << "ERROR: DataArray could not allocate memory\n" ; exit(-1) ; } ((void) (( isConsistent() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataarray.hh" , 389 , "isConsistent()" ), 0) )) ; } ~DataArray() { free(data) ; } } ; # 114 "dataset.hh" 2 struct DataSet_Key { signed int info:8 ; signed int idx:(8*sizeof(int)-8) ; int isValid() const { return idx >= 0 ; } void inValidate() { idx = -1 ; info = 0 ; } DataSet_Key() : info(0) , idx(-1) {} } ; template < class DATA > class DataSet { friend class GlobalPointer ; public: # 201 "dataset.hh" typedef DataSet_Key Key ; protected: struct Item { DATA data ; int info ; } *theitem ; Key* thekey ; int themax ; int thesize ; int thenum ; int firstfree ; public: int add(Key& newkey, const DATA& item) { DATA* data = create(newkey) ; if(data == 0) return 1 ; memcpy(data, &item, sizeof(DATA)) ; return 0 ; } int add(const DATA& item) { DATA* data = create() ; if(data == 0) return 1 ; memcpy(data, &item, sizeof(DATA)) ; return 0 ; } int add(Key newkey[], const DATA* item, int n) { ((void) (( n>=0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 273 , "n>=0" ), 0) )) ; if(num()+n > max()) return 1 ; for(int i=0; i=0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 284 , "n>=0" ), 0) )) ; if(num()+n > max()) return 1 ; for(int i=0; i& set) { if(num()+set.num() > max()) return 1 ; for(int i=0; i& set) { if(num()+set.num() > max()) return 1 ; for(int i=0; i= max()) return 0 ; if( firstfree != -themax-1 ) { newkey.idx = -firstfree-1 ; firstfree = theitem[newkey.idx].info ; } else newkey.idx = thesize++ ; thekey[thenum] = newkey ; theitem[newkey.idx].info = thenum ; ++thenum ; return &(theitem[newkey.idx].data) ; } DATA* create() { Key tmp ; return create(tmp) ; } private: void CCbug() { while(-firstfree == thesize) { firstfree = theitem[-firstfree-1].info ; --thesize ; } } public: void remove(int removenum) { if(has(removenum)) { int idx = thekey[removenum].idx ; theitem[idx].info = firstfree ; firstfree = -idx-1 ; CCbug() ; --thenum ; if(removenum != thenum) { thekey[removenum] = thekey[thenum] ; theitem[thekey[removenum].idx].info = removenum ; } } } void remove(Key removekey) { remove(number(removekey)) ; } void remove(DATA& item) { remove(number(&item)) ; } void remove( int perm[] ) { int i, j, first = -1 ; for( i = j = 0 ; i < num() ; ++i ) { if( perm[i] >= 0 ) perm[i] = j++ ; else { int idx = thekey[i].idx ; theitem[idx].info = firstfree ; firstfree = -idx-1 ; if( first < 0 ) first = i ; } } if( first >= 0 ) { for( i = first, j = num() ; i < j ; ++i ) { if( perm[i] >= 0 ) { thekey[perm[i]] = thekey[i] ; theitem[thekey[i].idx].info = perm[i] ; thekey[i].idx = -1 ; } else --thenum ; } } } void remove(Key *keys, int n, int* perm ) { ((void) (( perm ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 442 , "perm" ), 0) )) ; for( int i = num()-1 ; i >= 0 ; --i ) perm[i] = i ; while(--n >= 0) perm[number(keys[n])] = -1 ; remove( perm ) ; } void remove(Key *keys, int n ) { DataArray perm(num()) ; remove( keys, n, perm ) ; } void remove(int *nums, int n, int* perm ) { ((void) (( perm ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 460 , "perm" ), 0) )) ; for( int i = num()-1 ; i >= 0 ; --i ) perm[i] = i ; while(--n >= 0) perm[nums[n]] = -1 ; remove( perm ) ; } void remove( int *nums, int n ) { DataArray perm(num()) ; remove( nums, n, perm ) ; } void clear() { thesize = 0 ; thenum = 0 ; firstfree = -themax-1 ; } DATA& operator[](int n) { return theitem[thekey[n].idx].data ; } const DATA& operator[](int n) const { return theitem[thekey[n].idx].data ; } DATA& operator[](Key k) { return theitem[k.idx].data ; } const DATA& operator[](Key k) const { return theitem[k.idx].data ; } int max() const { return themax ; } int num() const { return thenum ; } int size() const { return thesize ; } Key key(int n) const { ((void) (( n >= 0 && n < num() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 527 , "n >= 0 && n < num()" ), 0) )) ; return thekey[n] ; } Key key(DATA* item) const { ((void) (( number(item) >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 534 , "number(item) >= 0" ), 0) )) ; return thekey[number(item)] ; } int number(Key k) const { return (k.idx < 0 || k.idx >= size()) ? -1 : theitem[k.idx].info ; } int number(DATA* item) const { if ((unsigned long)item < (unsigned long)theitem || (unsigned long)item >= (unsigned long)&(theitem[size()])) return -1 ; long idx = (((long)item) - ((long)theitem)) / sizeof(Item) ; return theitem[idx].info ; } int has(Key k) const { return theitem[k.idx].info >= 0 ; } int has(int n) const { return (n >= 0 && n < num()) ; } int has(DATA* item) const { return number(item) >= 0 ; } int reMax(int newmax = 0) { long delta = long(theitem) ; newmax = (newmax < size()) ? size() : newmax ; int* lastfree = &firstfree ; while(*lastfree != -themax-1) lastfree = &(theitem[-1 - *lastfree].info) ; *lastfree = -newmax-1 ; themax = newmax ; theitem = (Item*)realloc(theitem, themax * sizeof(Item)) ; thekey = (Key *)realloc(thekey, themax * sizeof(Key)) ; if( theitem == 0 || thekey == 0 ) { cerr << "ERROR: DataSet could not reallocate memory\n" ; exit(-1) ; } return long(theitem) - delta ; } DataSet& operator=(const DataSet& rhs) { int i ; if( rhs.size() > max() ) reMax( rhs.size() ) ; clear() ; for(i = 0 ; i < rhs.size() ; ++i) memcpy(&(theitem[i]), &(rhs.theitem[i]), sizeof(Item)) ; for(i = 0 ; i < rhs.num() ; ++i) thekey[i] = rhs.thekey[i] ; firstfree = rhs.firstfree ; themax = rhs.themax ; thenum = rhs.thenum ; thesize = rhs.thesize ; return *this ; } DataSet(const DataSet& old) { themax = old.themax ; thesize = old.thesize ; thenum = old.thenum ; if(old.firstfree == -old.themax-1) firstfree = -themax-1 ; else firstfree = old.firstfree ; theitem = (Item*)malloc(themax * sizeof(Item)) ; thekey = (Key *)malloc(themax * sizeof(Key)) ; if( theitem == 0 || thekey == 0 ) { cerr << "ERROR: DataSet could not allocate memory\n" ; exit(-1) ; } ((void) (( theitem ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 641 , "theitem" ), 0) )) ; ((void) (( thekey ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 642 , "thekey" ), 0) )) ; memcpy(theitem, old.theitem, themax * sizeof(Item)) ; memcpy(thekey, old.thekey, themax * sizeof(Key)) ; } DataSet(int max = 8) { themax = (max < 1) ? 8 : max ; thesize = thenum = 0 ; firstfree = -themax-1 ; theitem = (Item*)malloc(themax * sizeof(Item)) ; thekey = (Key *)malloc(themax * sizeof(Key)) ; if( theitem == 0 || thekey == 0 ) { cerr << "ERROR: DataSet could not allocate memory\n" ; exit(-1) ; } ((void) (( theitem ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 660 , "theitem" ), 0) )) ; ((void) (( thekey ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "dataset.hh" , 661 , "thekey" ), 0) )) ; } ~DataSet() { free(theitem) ; free(thekey) ; } isConsistent() const { if(theitem == 0 || thekey == 0) { cerr << "Inconsistency detected in class DataSet\n" ; return 0 ; } if(thesize > themax || thenum > themax || thenum > thesize) { cerr << "Inconsistency detected in class DataSet\n" ; return 0 ; } if(thesize == thenum && firstfree != -themax-1) { cerr << "Inconsistency detected in class DataSet\n" ; return 0 ; } if(thesize != thenum && firstfree == -themax-1) { cerr << "Inconsistency detected in class DataSet\n" ; return 0 ; } for(int i = 0 ; i < thenum ; ++i) { if(theitem[thekey[i].idx].info != i) { cerr << "Inconsistency detected in class DataSet\n" ; return 0 ; } } return 1 ; } } ; # 61 "svset.hh" 2 # 1 "idlist.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 55 "idlist.hh" 2 # 1 "islist.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 93 "islist.hh" 2 template < class T > class IsElement : public T { protected: IsElement* the_next ; public: IsElement*& next() { return the_next ; } IsElement* next() const { return the_next ; } IsElement(const T& old) : T(old) , the_next(0) {} IsElement(const IsElement& old) : T(old) , the_next(0) {} IsElement() {} } ; template < class T > class IsList { protected: T* the_first ; T* the_last ; public: typedef IsElement Element ; void append(T* elem) { if(the_last) the_last->next() = elem ; else the_first = elem ; the_last = elem ; } void prepend(T* elem) { if(the_first) elem->next() = the_first ; else the_last = elem ; the_first = elem ; } void insert(T* elem, T* after) { ((void) (( find(after) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 190 , "find(after)" ), 0) )) ; if(after == the_last) append(elem) ; else { elem->next() = after->next() ; after->next() = elem ; } } void append(IsList& list) { if(list.the_first) { append(list.the_first) ; the_last = list.the_last ; } } void prepend(IsList& list) { if(list.the_first) { prepend(list.the_last) ; the_first = list.the_first ; } } void insert(IsList& list, T*after) { ((void) (( find(after) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 241 , "find(after)" ), 0) )) ; if(list.the_first) { list.the_last->next() = after->next() ; after->next() = list.first() ; if(after == last()) the_last = list.last() ; } } void remove_next(T *after) { ((void) (( find(after) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 257 , "find(after)" ), 0) )) ; if(after->next()) { if(after->next() == last()) the_last = after ; after->next() = after->next()->next() ; } } void remove(const T *elem) { if(the_first) { if(elem == the_first) { the_first = next(elem) ; if(the_first == 0) the_last = 0 ; } else { T *after = the_first ; for( ; after != the_last; after = after->next()) if(after->next() == elem) { remove_next(after) ; return ; } } } } void remove(const IsList& list) { if(the_first != 0 && list.the_first != 0) { ((void) (( find(list.first()) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 300 , "find(list.first())" ), 0) )) ; ((void) (( find(list.last()) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 301 , "find(list.last())" ), 0) )) ; if(the_first == list.the_first) { if(the_last == list.the_last) the_first = the_last = 0 ; else the_first = list.the_last->next() ; } else { T *after = the_first ; for( ; after->next() != list.the_first; after = after->next()) ; if(the_last == list.the_last) the_last = after ; else after->next() = list.the_last->next() ; } } } void clear() { the_first = the_last = 0 ; } T* first() const { return the_first ; } T* last() const { return the_last ; } T* next(const T *elem) const { return (elem == the_last) ? 0 : (T*)(elem->next()) ; } int length() const { int num ; if(the_first) { T *test = the_first ; for(num = 1; test != the_last; test = test->next()) ++num ; return num ; } return 0 ; } int find(const T* elem) const { T *test = the_first ; do { if(test == elem) return 1 ; } while( (test = next(test)) ) ; return 0 ; } IsList sublist(const T* start = 0, const T* end = 0) const { IsList part = *this ; if(start) { ((void) (( find(start) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 384 , "find(start)" ), 0) )) ; part.the_first = (T *)start ; } if(end) { ((void) (( part.find(end) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 389 , "part.find(end)" ), 0) )) ; part.the_last = (T *)end ; } return part ; } void move(long delta) { if(the_first) { T* elem ; the_last = (T*)(delta + long(the_last)) ; the_first = (T*)(delta + long(the_first)) ; for(elem = first() ; elem ; elem = next(elem)) if(elem != last()) elem->next() = (T*)(delta + long(elem->next())) ; } } IsList(T* first = 0, T* last = 0) : the_first(first), the_last(last) { if(first) { ((void) (( last ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 430 , "last" ), 0) )) ; ((void) (( find(last) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "islist.hh" , 431 , "find(last)" ), 0) )) ; } } int isConsistent() const { if(first() != 0 && last() == 0) { cerr << "Inconsistency detected in class IsList\n" ; return 0 ; } if(first() == 0 && last() != 0) { cerr << "Inconsistency detected in class IsList\n" ; return 0 ; } if(first() && find(last()) == 0) { cerr << "Inconsistency detected in class IsList\n" ; return 0 ; } return 1 ; } } ; # 61 "idlist.hh" 2 template < class T > class IdElement : public T { IdElement* theprev ; IdElement* thenext ; public: IdElement*& next() { return thenext ; } IdElement*const& next() const { return thenext ; } IdElement*& prev() { return theprev ; } IdElement*const& prev() const { return theprev ; } IdElement() : theprev(0) , thenext(0) {} IdElement(const T& old) : T(old) , theprev(0) , thenext(0) {} } ; template < class T > class IdList : public IsList< T > { public: T* first() const { return (T*)the_first ; } T* last() const { return (T*)the_last ; } T* next(const T *elem) const { return (elem == last()) ? 0 : (T*)(elem->next()) ; } T* prev(const T *elem) const { return (elem == first()) ? 0 : (T*)(elem->prev()) ; } void append (T* elem) { if(last()) { last()->next() = elem ; elem->prev() = last() ; } else the_first = elem ; the_last = elem ; } void prepend(T* elem) { if(first()) { elem->next() = first() ; first()->prev() = elem ; } else the_last = elem ; the_first = elem ; } void insert (T* elem, T* after) { ((void) (( find(after) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 176 , "find(after)" ), 0) )) ; if(after == last()) append(elem) ; else { elem->next() = after->next() ; elem->prev() = after ; after->next() = elem->next()->prev() = elem ; } } void append (IdList& list) { if(list.first()) { append(list.first()) ; the_last = list.last() ; } } void prepend(IdList& list) { if(list.first()) { prepend(list.last()) ; the_first = list.the_first ; } } void insert (IdList& list, T* after) { ((void) (( find(after) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 210 , "find(after)" ), 0) )) ; if(list.first()) { list.last()->next() = after->next() ; list.first()->prev() = after ; after->next() = list.first() ; if(after == last()) the_last = list.last() ; else list.last()->next()->prev() = list.last() ; } } void remove_next(T* after) { remove(next(after)) ; } void remove(T* elem) { if(elem == first()) { the_first = next(elem) ; if(first() == 0) the_last = 0 ; } else if(elem == last()) the_last = elem->prev() ; else { elem->next()->prev() = elem->prev() ; elem->prev()->next() = elem->next() ; } } void remove(IdList& list) { if(first() != 0 && list.first() != 0) { ((void) (( find(list.first()) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 253 , "find(list.first())" ), 0) )) ; ((void) (( find(list.last()) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 254 , "find(list.last())" ), 0) )) ; if(first() == list.first()) { if(last() == list.last()) the_first = the_last = 0 ; else the_first = list.last()->next() ; } else if(last() == list.last()) the_last = list.last()->prev() ; else { T* after = first() ; for( ; after->next() != list.first(); after = after->next()) ; if(last() == list.last()) the_last = after ; else after->next() = list.last()->next() ; } } } void move(long delta) { if(the_first) { T* elem ; IsList::move(delta) ; for(elem = last() ; elem ; elem = prev(elem)) if(elem != first()) elem->prev() = (T*)(delta + long(elem->prev())) ; } } IdList sublist(const T* start = 0, const T* end = 0) const { IdList part = *this ; if(start) { ((void) (( find(start) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 309 , "find(start)" ), 0) )) ; part.the_first = (T*)start ; } if(end) { ((void) (( part.find(end) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "idlist.hh" , 314 , "part.find(end)" ), 0) )) ; part.the_last = (T*)end ; } return part ; } IdList(T* first = 0, T* last = 0) : IsList(first, last) {} int isConsistent() const { for(T* it = first() ; it ; it = next(it)) { if(it != first() && it->prev()->next() != it) { cerr << "Inconsistency detected in class idlist\n" ; return 0 ; } if(it != last() && it->next()->prev() != it) { cerr << "Inconsistency detected in class idlist\n" ; return 0 ; } } return IsList::isConsistent() ; } } ; # 63 "svset.hh" 2 class SVSet_DLPSV : public SVector { SVSet_DLPSV *thenext ; SVSet_DLPSV *theprev ; public: SVSet_DLPSV*& next() { return thenext ; } SVSet_DLPSV*const& next() const { return thenext ; } SVSet_DLPSV*const& prev() const { return theprev ; } SVSet_DLPSV*& prev() { return theprev ; } SVector& svector() { return *((SVector*)this) ; } SVSet_DLPSV() {} SVSet_DLPSV(const SVSet_DLPSV& copy) : SVector(copy) {} } ; typedef DataSet::Key SVSet_Key ; typedef DataArray SVSet_Base ; class SVSet : private SVSet_Base { friend class GlobalPointer ; typedef SVSet_DLPSV DLPSV ; DataSet set ; IdList list ; void ensurePSVec(int n) { if(num() + n > max()) { ((void) (( factor > 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "svset.hh" , 150 , "factor > 1" ), 0) )) ; reMax( int(factor*max()) + 8 + n) ; } } void ensureMem(int n) ; public: typedef SVSet_Key Key ; double factor ; double& memFactor ; void add(const SVector& svec) { ensurePSVec(1) ; SVector* new_svec = create(svec.size()) ; *new_svec = svec ; } void add(Key& nkey, const SVector& svec) { ensurePSVec(1) ; SVector* new_svec = create(nkey, svec.size()) ; *new_svec = svec ; } void add(const SVector svec[], int n) ; void add(Key nkey[], const SVector svec[], int n) ; void add(const SVSet& set) ; void add(Key nkey[], const SVSet& set) ; SVector* create(int idxmax = -1) ; SVector* create(Key& nkey, int idxmax = -1) ; void xtend(SVector& svec, int newmax) ; void add2(SVector &svec, int idx, double val) ; void add2(SVector &svec, int n, const int idx[], const double val[]) ; void remove(Key removekey) ; void remove(int removenum) { remove( key(removenum) ) ; } void remove(SVector *svec) { remove( key(svec) ) ; } void remove(int perm[]) ; void remove(Key keys[], int n) { DataArray perm(num()) ; remove( keys, n, perm ) ; } void remove(int nums[], int n) { DataArray perm(num()) ; remove( nums, n, perm ) ; } void remove(Key keys[], int n, int* perm) ; void remove(int nums[], int n, int* perm) ; void clear() { DataArray::clear() ; DataArray::reMax( 10000 ) ; set.clear() ; list.clear() ; } SVector& operator[](int n) { return set[n] ; } const SVector& operator[](int n) const { return set[n] ; } SVector& operator[](Key k) { return set[k] ; } const SVector& operator[](Key k) const { return set[k] ; } int num() const { return set.num() ; } int max() const { return set.max() ; } Key key(int n) const { return set.key(n) ; } Key key(const SVector* svec) const { return set.key((DLPSV*)svec) ; } int number(Key k) const { return set.number(k) ; } int number(const SVector* svec) const { return set.number((DLPSV*)svec) ; } int has(Key k) const { return set.has(k) ; } int has(int n) const { return set.has(n) ; } int has(const SVector* svec) const { return set.has((DLPSV*)svec) ; } int memSize() const { return DataArray::size() ; } int memMax() const { return DataArray::max() ; } void memRemax(int newmax) ; void memPack() ; void reMax(int newmax = 0) ; int isConsistent() const ; SVSet& operator=(const SVSet& rhs) ; SVSet(const SVSet& old) ; SVSet(int max = -1, int memmax = -1, double fac = 1.1, double memFac = 1.2) : DataArray ( 0, (memmax > 0) ? memmax : 8 * ((max>0) ? max : 8), memFac ) , set ( (max > 0) ? max : 8 ) , factor ( fac ) , memFactor ( DataArray::memFactor ) { } } ; # 73 "lpcolset.hh" 2 class LPColSet : protected SVSet { private: friend class GlobalPointer ; friend class DoPlex ; DVector low, up, object ; public: typedef SVSet::Key Key ; int num() const { return SVSet::num() ; } int max() const { return SVSet::max() ; } const Vector& obj() const { return object ; } Vector& obj() { return object ; } double obj( int i ) const { return object[i] ; } double& obj( int i ) { return object[i] ; } double obj( Key k ) const { return object[number(k)] ; } double& obj( Key k ) { return object[number(k)] ; } const Vector& lower() const { return low ; } Vector& lower() { return low ; } double lower( int i ) const { return low[i] ; } double& lower( int i ) { return low[i] ; } double lower( Key k ) const { return low[number(k)] ; } double& lower( Key k ) { return low[number(k)] ; } const Vector& upper() const { return up ; } Vector& upper() { return up ; } double upper( int i ) const { return up[i] ; } double& upper( int i ) { return up[i] ; } double upper( Key k ) const { return up[number(k)] ; } double& upper( Key k ) { return up[number(k)] ; } SVector& colVector( int i ) { return operator[](i) ; } const SVector& colVector( int i ) const { return operator[](i) ; } const SVector& colVector( Key k ) const { return operator[](k) ; } SVector& colVector( Key k ) { return operator[](k) ; } Key key( int i ) const { return SVSet::key(i) ; } int number( Key k ) const { return SVSet::number(k) ; } int has( Key k ) const { return SVSet::has(k) ; } void add(const LPCol& col) { Key k ; add(k, col) ; } void add(Key& key, const LPCol& col) { add( key, col.obj(), col.lower(), col.colVector(), col.upper() ) ; } void add(double obj, double lower, const SVector& colVector, double upper) { Key k ; add(k, obj, lower, colVector, upper) ; } void add (Key& key, double obj, double lower, const SVector& colVector, double upper ) ; void add( const LPColSet& set ) ; void add(Key key[], const LPColSet& set ) ; void add2(Key k, int n, int idx[], double val[]) { SVSet::add2(colVector(k), n, idx, val) ; } void add2(int i, int n, int idx[], double val[]) { SVSet::add2(colVector(i), n, idx, val) ; } SVector& create(int nonzeros=0, double obj=1, double lw=0, double upp=1) { Key k ; return create( k, nonzeros, obj, lw, upp ) ; } SVector& create(Key& nkey, int nonzeros=0, double obj=1, double low=0, double up=1) ; void remove(int i) ; void remove(Key k) { remove( number(k) ) ; } void remove(int perm[]) ; void remove(Key keys[], int n) { DataArray perm(num()) ; remove( keys, n, perm ) ; } void remove(int nums[], int n) { DataArray perm(num()) ; remove( nums, n, perm ) ; } void remove(Key keys[], int n, int* perm) ; void remove(int nums[], int n, int* perm) ; void clear() ; void reMax(int newmax = 0) { SVSet::reMax ( newmax ) ; up.reSize ( max() ) ; low.reSize ( max() ) ; object.reSize( max() ) ; } int memSize() const { return SVSet::memSize() ; } int memMax() const { return SVSet::memMax() ; } void memRemax(int newmax) { SVSet::memRemax(newmax) ; } void memPack() { SVSet::memPack() ; } LPColSet& operator=( const LPColSet& rs ) { SVSet::operator=(rs) ; low = rs.low ; up = rs.up ; object = rs.object ; return *this ; } LPColSet( int max = -1, int memmax = -1 ) : SVSet(max, memmax), low(0), up(0), object(0) { } int isConsistent() const ; } ; # 96 "lpsolver.hh" 2 # 1 "lprowset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 65 "lprowset.hh" 2 # 1 "lprow.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 56 "lprow.hh" 2 class LPRow { private: double left, right ; DSVector vec ; public: static double infinity ; enum Type { LESS_EQUAL, EQUAL, GREATER_EQUAL, RANGE } ; Type type() const ; double value() const ; double lhs() const { return left ; } double& lhs() { return left ; } double rhs() const { return right ; } double& rhs() { return right ; } const SVector& rowVector() const { return vec ; } DSVector& rowVector() { return vec ; } LPRow( int defDim = 0 ) : left(0), right( infinity ), vec( defDim ) {} LPRow(const LPRow& row) : left(row.left), right(row.right), vec(row.vec) {} LPRow(double lhs, const SVector& rowVector, double rhs) : left(lhs), right(rhs), vec(rowVector) {} LPRow(const SVector& rowVector, Type type, double value) ; int isConsistent() const { return vec.isConsistent() ; } } ; # 72 "lprowset.hh" 2 class LPRowSet : protected SVSet { private: DVector left, right ; friend class GlobalPointer ; public: typedef SVSet::Key Key ; int num() const { return SVSet::num() ; } int max() const { return SVSet::max() ; } const Vector& lhs() const { return left ; } Vector& lhs() { return left ; } double lhs( int i ) const { return left[i] ; } double& lhs( int i ) { return left[i] ; } double lhs( Key k ) const { return left[number(k)] ; } double& lhs( Key k ) { return left[number(k)] ; } const Vector& rhs() const { return right ; } Vector& rhs() { return right ; } double rhs( int i ) const { return right[i] ; } double& rhs( int i ) { return right[i] ; } double rhs( Key k ) const { return right[number(k)] ; } double& rhs( Key k ) { return right[number(k)] ; } SVector& rowVector( int i ) { return operator[](i) ; } const SVector& rowVector( int i ) const { return operator[](i) ; } const SVector& rowVector( Key k ) const { return operator[](k) ; } SVector& rowVector( Key k ) { return operator[](k) ; } LPRow::Type type( int i ) const { if( rhs(i) >= LPRow::infinity ) return LPRow::GREATER_EQUAL ; if( lhs(i) <= -LPRow::infinity ) return LPRow::LESS_EQUAL ; if( lhs(i) == rhs(i) ) return LPRow::EQUAL ; return LPRow::RANGE ; } LPRow::Type type( Key k ) const { return type(number(k)) ; } double value( int i ) const { if( rhs(i) < LPRow::infinity ) return rhs(i) ; else { ((void) (( lhs(i) > -LPRow::infinity ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "lprowset.hh" , 178 , "lhs(i) > -LPRow::infinity" ), 0) )) ; return lhs(i) ; } } double value( Key k ) const { return value(number(k)) ; } Key key( int i ) const { return SVSet::key(i) ; } int number( Key k ) const { return SVSet::number(k) ; } int has( Key k ) const { return SVSet::has(k) ; } void add(const LPRow& row) { Key k ; add(k, row) ; } void add(Key& key, const LPRow& row) { add( key, row.lhs(), row.rowVector(), row.rhs() ) ; } void add(double lhs, const SVector& rowVector, double rhs) { Key k ; add(k, lhs, rowVector, rhs) ; } void add(Key& key, double lhs, const SVector& rowVector, double rhs) ; void add( const LPRowSet& set ) ; void add(Key key[], const LPRowSet& set ) ; void xtend(int n, int newmax) { SVSet::xtend(rowVector(n), newmax ) ; } void xtend(Key key, int newmax) { SVSet::xtend(rowVector(key), newmax ) ; } void add2(Key k, int n, int idx[], double val[]) { SVSet::add2(rowVector(k), n, idx, val) ; } void add2(int i, int n, int idx[], double val[]) { SVSet::add2(rowVector(i), n, idx, val) ; } SVector& create(int nonzeros = 0, double lhs = 0, double rhs = 1) { Key k ; return create( k, nonzeros, lhs, rhs ) ; } SVector& create(Key& nkey, int nonzeros = 0, double lhs = 0, double rhs = 1) ; void remove(int i) ; void remove(Key k) { remove( number(k) ) ; } void remove(int perm[]) ; void remove(Key keys[], int n) { DataArray perm(num()) ; remove( keys, n, perm ) ; } void remove(int nums[], int n) { DataArray perm(num()) ; remove( nums, n, perm ) ; } void remove(Key keys[], int n, int* perm) ; void remove(int nums[], int n, int* perm) ; void clear() ; void reMax(int newmax = 0) { SVSet::reMax( newmax ) ; left.reSize ( max() ) ; right.reSize( max() ) ; } int memSize() const { return SVSet::memSize() ; } int memMax() const { return SVSet::memMax() ; } void memRemax(int newmax) { SVSet::memRemax(newmax) ; } void memPack() { SVSet::memPack() ; } LPRowSet& operator=( const LPRowSet& rs ) { SVSet::operator=(rs) ; left = rs.left ; right = rs.right ; return *this ; } LPRowSet( int max = -1, int memmax = -1 ) : SVSet(max, memmax), left(0), right(0) { } int isConsistent() const ; } ; # 97 "lpsolver.hh" 2 class LPSolver { public: enum Status { UNKNOWN = 0, UNBOUNDED, INFEASIBLE, PRIMAL, DUAL, SOLVED, ERROR } ; enum Sense { MAXIMIZE=1, MINIMIZE=-1 } ; struct ColId { int id ; } ; struct RowId { int id ; } ; enum VarStatus { ON_UPPER, ON_LOWER, FIXED, ZERO, BASIC } ; static const double infinity ; virtual Status solve() = 0 ; virtual void setBasis(const signed char rows[], const signed char cols[]) = 0 ; virtual void setTermination(double value = infinity, double time = -1, int iteration = -1) = 0 ; virtual void getTermination(double* value = 0, double* time = 0, int* iteration = 0) const = 0 ; virtual double objValue() const = 0 ; virtual Status getPrimal(Vector& vector) const = 0 ; virtual const Vector& primal() const = 0 ; virtual Status getDual(Vector& vector) const = 0 ; virtual const Vector& dual() const = 0 ; virtual Status getSlacks(Vector& vector) const = 0 ; virtual const Vector& slacks() const = 0 ; virtual Status getRdCost( Vector& vector ) const = 0 ; virtual const Vector& rdCost() const = 0 ; virtual Status getResult(double* value = 0, Vector* primal = 0, Vector* slacks = 0, Vector* dual = 0, Vector* reduCost = 0) const = 0 ; virtual Status getBasis(signed char rows[], signed char cols[]) const = 0 ; virtual const signed char* rowBasis() const = 0 ; virtual const signed char* colBasis() const = 0 ; virtual int iterations() const = 0 ; virtual double time() const = 0 ; virtual void clear() = 0 ; virtual void readFile(char* filename) = 0 ; virtual void dumpFile(char* filename) const = 0 ; virtual void addRow(const LPRow& row) = 0 ; virtual void addRow(RowId& id, const LPRow& row) = 0 ; virtual void addRows( const LPRowSet& set ) = 0 ; virtual void addRows(RowId id[], const LPRowSet& set ) = 0 ; virtual void addCol(const LPCol& col) = 0 ; virtual void addCol(ColId& id, const LPCol& col) = 0 ; virtual void addCols( const LPColSet& set ) = 0 ; virtual void addCols(ColId id[], const LPColSet& set ) = 0 ; virtual void removeRow(int i) = 0 ; virtual void removeRow(RowId id) = 0 ; virtual void removeCol(int i) = 0 ; virtual void removeCol(ColId id) = 0 ; virtual void removeRows(RowId id[], int n, int perm[] = 0) = 0 ; virtual void removeRows(int nums[], int n, int perm[] = 0) = 0 ; virtual void removeRows(int perm[]) = 0 ; virtual void removeRowRange(int start, int end, int perm[] = 0) = 0 ; virtual void removeCols(ColId id[], int n, int perm[] = 0) = 0 ; virtual void removeCols(int nums[], int n, int perm[] = 0) = 0 ; virtual void removeCols(int perm[]) = 0 ; virtual void removeColRange(int start, int end, int perm[] = 0) = 0 ; virtual void changeObj( const Vector& newObj ) = 0 ; virtual void changeObj( int i, double newVal ) = 0 ; virtual void changeObj( ColId id, double newVal ) = 0 ; virtual void changeLower( const Vector& newLower ) = 0 ; virtual void changeLower( int i, double newLower ) = 0 ; virtual void changeLower( ColId id, double newLower ) = 0 ; virtual void changeUpper( const Vector& newUpper ) = 0 ; virtual void changeUpper( int i, double newUpper ) = 0 ; virtual void changeUpper( ColId id, double newUpper ) = 0 ; virtual void changeBounds( const Vector& newLower, const Vector& newUpper ) = 0 ; virtual void changeBounds( int i, double newLower, double newUpper ) = 0 ; virtual void changeBounds( ColId id, double newLower, double newUpper ) = 0 ; virtual void changeLhs( const Vector& newLhs ) = 0 ; virtual void changeLhs( int i, double newLhs ) = 0 ; virtual void changeLhs( RowId id, double newLhs ) = 0 ; virtual void changeRhs( const Vector& newRhs ) = 0 ; virtual void changeRhs( int i, double newRhs ) = 0 ; virtual void changeRhs( RowId id, double newRhs ) = 0 ; virtual void changeRange( const Vector& newLhs, const Vector& newRhs )= 0 ; virtual void changeRange( int i, double newLhs, double newRhs ) = 0 ; virtual void changeRange( RowId id, double newLhs, double newRhs ) = 0 ; virtual void changeRow( int i, const LPRow& newRow ) = 0 ; virtual void changeRow( RowId id, const LPRow& newRow ) = 0 ; virtual void changeCol( int i, const LPCol& newCol ) = 0 ; virtual void changeCol( ColId id, const LPCol& newCol ) = 0 ; virtual void changeElement( int i, int j, double val ) = 0 ; virtual void changeElement( RowId rid, ColId cid, double val)= 0 ; virtual void changeSense( Sense sns) = 0 ; virtual void getRow(int i, LPRow& row) const = 0 ; virtual void getRow( RowId id, LPRow& row) const = 0 ; virtual void getRows(int start, int end, LPRowSet& set) const = 0 ; virtual const SVector& rowVector(int i) const = 0 ; virtual const SVector& rowVector( RowId id ) const = 0 ; virtual const LPRowSet& rows() const = 0 ; virtual void getCol(int i, LPCol& column) const = 0 ; virtual void getCol( ColId id, LPCol& column) const = 0 ; virtual void getCols(int start, int end, LPColSet& set) const= 0 ; virtual const SVector& colVector(int i) const = 0 ; virtual const SVector& colVector( ColId id ) const = 0 ; virtual const LPColSet& cols() const = 0 ; virtual double lhs( int i ) const = 0 ; virtual double lhs( RowId id ) const = 0 ; virtual void getLhs( Vector& lhs ) const = 0 ; virtual const Vector& lhs( ) const = 0 ; virtual double rhs( int i ) const = 0 ; virtual double rhs( RowId id ) const = 0 ; virtual void getRhs( Vector& rhs ) const = 0 ; virtual const Vector& rhs( ) const = 0 ; virtual double obj( int i ) const = 0 ; virtual double obj( ColId id ) const = 0 ; virtual void getObj( Vector& obj ) const = 0 ; virtual const Vector& obj() const = 0 ; virtual double lower( int i ) const = 0 ; virtual double lower( ColId id ) const = 0 ; virtual void getLower( Vector& low ) const = 0 ; virtual const Vector& lower( ) const = 0 ; virtual double upper( int i ) const = 0 ; virtual double upper( ColId id ) const = 0 ; virtual void getUpper( Vector& up ) const = 0 ; virtual const Vector& upper( ) const = 0 ; virtual Sense sense( ) const = 0 ; virtual Status status() const = 0 ; virtual int nofCols() const = 0 ; virtual int nofRows() const = 0 ; virtual int nofNZEs() const = 0 ; virtual int number(RowId id) const = 0 ; virtual int number(ColId id) const = 0 ; virtual RowId rowId(int i) const = 0 ; virtual ColId colId(int i) const = 0 ; virtual int has(RowId id) const { return number(id) >= 0 ; } virtual int has(ColId id) const { return number(id) >= 0 ; } virtual void getRowIds( RowId ids[] ) const = 0 ; virtual void getColIds( ColId ids[] ) const = 0 ; virtual ~LPSolver() {} } ; # 53 "cachelpsolver.hh" 2 class CacheLPSolver : public LPSolver { private: DVector theObj ; DVector thePrimal ; DVector theRdCost ; DataArray colBase ; DVector theDual ; DVector theSlack ; DataArray rowBase ; public: virtual double obj( int i ) const = 0 ; virtual double obj( ColId id ) const = 0 ; virtual const Vector& obj() const ; virtual const Vector& primal() const ; virtual const Vector& slacks() const ; virtual const Vector& dual() const ; virtual const Vector& rdCost() const ; virtual void getRowIds( RowId ids[] ) const ; virtual void getColIds( ColId ids[] ) const ; virtual const signed char* rowBasis() const ; virtual const signed char* colBasis() const ; } ; # 72 "soplex.hh" 2 # 1 "timer.hh" 1 # 1 "timer.h" 1 # 1 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/time.h" 1 3 # 309 "/home2/paubert/logiciels/egcs/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.21/include/time.h" 3 # 41 "timer.h" 2 extern "C" { # 56 "timer.h" enum _Timer_Status {Timer_RESET, Timer_STOPPED, Timer_RUNNING}; struct _Timer_Struct { enum _Timer_Status status; clock_t uAccount; clock_t sAccount; clock_t rAccount; }; extern double Timer_ticks2sec(clock_t ticks); extern void Timer_getTicks(clock_t* usrTicks, clock_t* sysTicks, clock_t* realTicks); typedef struct _Timer_Struct Timer_t; static inline void Timer_reset(Timer_t *timer) { ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 108 , "timer" ), 0) )) ; timer->status = Timer_RESET; timer->uAccount = timer->rAccount = timer->sAccount = 0; } static inline void Timer_start(Timer_t *timer) { ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 117 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 120 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; if (timer->status != Timer_RUNNING) { clock_t uTime, sTime, rTime; Timer_getTicks(&uTime, &sTime, &rTime); timer->uAccount -= uTime; timer->sAccount -= sTime; timer->rAccount -= rTime; timer->status = Timer_RUNNING; } } static inline double Timer_stop(Timer_t *timer) { ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 138 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 141 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; if (timer->status == Timer_RUNNING) { clock_t uTime, sTime, rTime; Timer_getTicks(&uTime, &sTime, &rTime); timer->uAccount += uTime; timer->sAccount += sTime; timer->rAccount += rTime; timer->status = Timer_STOPPED; } return (Timer_ticks2sec(timer->uAccount)); } static inline void Timer_getTimes(const Timer_t *timer, double *userTime, double *systemTime, double *realTime) { ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 166 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 169 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; if (timer->status != Timer_RUNNING) { if (userTime) *userTime = Timer_ticks2sec(timer->uAccount); if (systemTime) *systemTime = Timer_ticks2sec(timer->sAccount); if (realTime) *realTime = Timer_ticks2sec(timer->rAccount); } else { clock_t uTime, sTime, rTime; Timer_getTicks(&uTime, &sTime, &rTime); if (userTime) *userTime = Timer_ticks2sec(uTime + timer->uAccount); if (systemTime) *systemTime = Timer_ticks2sec(sTime + timer->sAccount); if (realTime) *realTime = Timer_ticks2sec(rTime + timer->rAccount); } ((void) (( userTime ? *userTime >= 0.0 : 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 192 , "userTime ? *userTime >= 0.0 : 1" ), 0) )) ; ((void) (( systemTime ? *systemTime >= 0.0 : 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 193 , "systemTime ? *systemTime >= 0.0 : 1" ), 0) )) ; ((void) (( realTime ? *realTime >= 0.0 : 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 194 , "realTime ? *realTime >= 0.0 : 1" ), 0) )) ; } static inline double Timer_userTime(const Timer_t *timer) { double uTime; ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 202 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 205 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; Timer_getTimes(timer, &uTime, 0, 0); return (uTime); } static inline double Timer_systemTime(const Timer_t *timer) { double sTime; ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 216 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 219 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; Timer_getTimes(timer, 0, &sTime, 0); return (sTime); } static inline double Timer_realTime(const Timer_t *timer) { double rTime; ((void) (( timer ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 230 , "timer" ), 0) )) ; ((void) (( timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "timer.h" , 233 , "timer->status == Timer_RESET || timer->status == Timer_STOPPED || timer->status == Timer_RUNNING" ), 0) )) ; Timer_getTimes(timer, 0, 0, &rTime); return (rTime); } extern long Timer_resolution(void); } # 50 "timer.hh" 2 class Timer { public: void reset(); void start(); double stop(); double userTime() const; double systemTime() const; double realTime() const; void getTimes(double *userTime = 0, double *systemTime = 0, double *realTime = 0) const; static long resolution(); Timer(); protected: Timer_t timer; } ; inline void Timer::reset() { Timer_reset(&timer); } inline void Timer::start() { Timer_start(&timer); } inline double Timer::stop() { return Timer_stop(&timer); } inline double Timer::userTime() const { return Timer_userTime(&timer); } inline double Timer::systemTime() const { return Timer_systemTime(&timer); } inline double Timer::realTime() const { return Timer_realTime(&timer); } inline void Timer::getTimes(double *userTime, double *systemTime, double *realTime) const { Timer_getTimes(&timer, userTime, systemTime, realTime); } inline long Timer::resolution() { return Timer_resolution(); } inline Timer::Timer() { Timer_reset(&timer); } # 73 "soplex.hh" 2 # 1 "spxlp.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 74 "spxlp.hh" 2 # 1 "nameset.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 97 "nameset.hh" 2 # 1 "datahashtable.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 64 "datahashtable.hh" 2 template struct DataHashTable_Element { HashItem item ; Info info ; enum { FREE, RELEASED, USED } status ; } ; template class DataHashTable { private: typedef DataHashTable_Element Element ; DataArray< DataHashTable_Element > element ; int hashsize ; int thenum ; int (*hashval) (const HashItem*) ; double factor ; int theCurrent ; int cFrontBug ; int autoHashSize() const { int i, j ; int hashsze = 1 ; int size = element.size() ; DataArray prime(size) ; for( i = 2 ; i < size ; ++i ) prime[i] = 1 ; for( i = 2 ; i < size ; ++i ) { if( prime[i] ) { for( j = i ; j < size ; j += i ) prime[j] = 0 ; if( size % i != 0 ) { hashsze *= i ; if( hashsze > size ) { hashsze /= i ; break ; } } } } return hashsze ; } int index( const HashItem& h) const { int i, j ; for ( i = j = (*hashval)(&h) % element.size() ; element[i].status != DataHashTable_Element::FREE ; ) { if( element[i].item == h ) return i ; i = (i+hashsize) % element.size() ; if( i == j ) break ; } return -1 ; } public: int max () const { return element.size() ; } int num () const { return thenum ; } int hashSize () const { return hashsize ; } int has (const HashItem& h) const { return index(h) >= 0 ? 1 : 0 ; } Info* get (const HashItem& h) { int i = index(h) ; return i >= 0 ? &element[i].info : 0 ; } const Info* get (const HashItem& h) const { int i = index(h) ; return i >= 0 ? &element[i].info : 0 ; } Info& operator[](const HashItem& h) { return element[index(h)].info ; } const Info& operator[](const HashItem& h) const { return element[index(h)].info ; } const HashItem* first() const { *(int*)&theCurrent = -1 ; return next() ; } const HashItem* last() const { *(int*)&theCurrent = element.size() ; return prev() ; } const HashItem* next() const { if( theCurrent < 0 ) *(int*)&theCurrent = -1 ; while( ++*(int*)&theCurrent < element.size() ) { if( element[theCurrent].status == DataHashTable_Element::USED ) return &element[theCurrent].item ; } *(int*)&theCurrent = -1 ; return 0 ; } const HashItem* current() const { return (theCurrent<0) ? 0 : &element[theCurrent].item ; } const HashItem* prev() const { if( theCurrent > element.size() ) *(int*)&theCurrent = element.size() ; while( --*(int*)&theCurrent >= 0 ) { if( element[theCurrent].status == DataHashTable_Element::USED ) return &element[theCurrent].item ; } return 0 ; } void add (const HashItem& h, const Info& x) { ((void) (( !has(h) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "datahashtable.hh" , 319 , "!has(h)" ), 0) )) ; int i ; if( thenum >= element.size() ) reMax( int(factor * thenum) + 1 ) ; for ( i = (*hashval)(&h) % element.size() ; element[i].status == DataHashTable_Element::USED ; i = (i+hashsize) % element.size() ) ; element[i].status = DataHashTable_Element::USED ; memcpy( &(element[i].info), &x, cFrontBug ) ; memcpy( &(element[i].item), &h, sizeof(HashItem) ) ; ++thenum ; } void remove (const HashItem& h) { ((void) (( has(h) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "datahashtable.hh" , 339 , "has(h)" ), 0) )) ; element[index(h)].status = DataHashTable_Element::RELEASED ; --thenum ; } void clear () { for( int i = element.size()-1 ; i >= 0 ; --i ) element[i].status = DataHashTable_Element::FREE ; thenum = 0 ; } void reMax (int nel =-1, int hashsze=0) { DataArray< DataHashTable_Element > cpy(element) ; element.reSize( nel < num() ? num() : nel ) ; clear() ; if( hashsze < 1 ) this->hashsize = autoHashSize() ; else this->hashsize = hashsze ; for( int i = cpy.size()-1 ; i >= 0 ; --i ) if( cpy[i].status == DataHashTable_Element::USED ) add( cpy[i].item, cpy[i].info ) ; } int isConsistent () const { int i, tot ; for( i = element.size()-1, tot = 0 ; i >= 0 ; --i ) if( element[i].status == DataHashTable_Element::USED ) { ++tot ; if( !has( element[i].item ) ) { cout << "Inconsistency detected in class DataHashTable\n" ; return 0 ; } } if( tot != thenum ) { cout << "Inconsistency detected in class DataHashTable\n" ; return 0 ; } return element.isConsistent() ; } # 414 "datahashtable.hh" DataHashTable ( int (*f)(const HashItem*), int nel = 256 , int hashsze = 0 , double incr = 2.0 ) : element(nel) , hashval(f) , factor (incr) { cFrontBug = sizeof(Info) ; clear() ; if( hashsze < 1 ) this->hashsize = autoHashSize() ; else this->hashsize = hashsze ; ((void) (( factor > 1 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "datahashtable.hh" , 445 , "factor > 1" ), 0) )) ; } } ; # 107 "nameset.hh" 2 class NameSet_Name { protected: friend class NameSet ; static char deflt; public: const char *name; friend int operator==(const NameSet_Name& n1, const NameSet_Name& n2) { return (strcmp (n1.name, n2.name) == 0); } friend ostream& operator<<(ostream& out, const NameSet_Name& n) { return out << n.name; } friend int hashFunction (const NameSet_Name&); int isConsistent () const { return (name != 0); } NameSet_Name (const char* str) { name = str; } NameSet_Name (const NameSet_Name& str) { name = str.name; } NameSet_Name () { name = &deflt; } } ; class NameSet_CharPtr : public NameSet_Name { protected: NameSet_CharPtr *the_next ; public: NameSet_CharPtr*& next() { return the_next ; } NameSet_CharPtr*const& next() const { return the_next ; } NameSet_CharPtr(const NameSet_CharPtr& org) : NameSet_Name(org), the_next(0) { } NameSet_CharPtr() : NameSet_Name(), the_next(0) {} } ; class NameSet { public: typedef DataSet_Key Key ; protected: IsList list ; DataSet set ; char* mem ; int memmax ; int memused ; DataHashTable hashtab ; public: const char* operator[](int num) const { return set[num].name ; } const char* operator[](Key key) const { DataSet::Key* keyptr = (DataSet::Key*)&key ; return set[*keyptr].name ; } int num() const { return set.num() ; } int max() const { return set.max() ; } int size() const { return set.size() ; } int memMax() const { return memmax ; } int memSize() const { return memused ; } Key key(int num) const { return set.key(num) ; } Key key(const char* str) const { const NameSet_Name nam(str) ; return (*hashtab.get(nam)) ; } int number(Key key) const { DataSet::Key* keyptr = (DataSet::Key*)&key ; return set.number(*keyptr) ; } int number(const char *str) const { const NameSet_Name nam(str) ; if (hashtab.has(nam)) return number(*hashtab.get(nam)) ; else return -1 ; } int has(int num) const { return set.has(num) ; } int has(const char* str) const { const NameSet_Name nam(str) ; return hashtab.has(nam) ; } int has(Key key) const { DataSet::Key* keyptr = (DataSet::Key*)&key ; return set.has(*keyptr) ; } void add(const char* str) ; void add(Key& key, const char* str) ; void add(const NameSet& set) ; void add(Key key[], const NameSet& set) ; void remove(Key key) ; void remove(int num) { remove(key(num)) ; } void remove(const char* str) ; void remove(Key keys[], int n) ; void remove(int nums[], int n) ; void clear() ; void reMax(int newmax = 0) ; void memRemax(int newmax = 0) ; void memPack() ; double factor ; double memFactor ; int dump(int file) ; int read(int file) ; int isConsistent() const ; NameSet& operator=(const NameSet& rhs) ; NameSet(const NameSet& old) ; NameSet(int max=8, int mmax=-1, double fac=2, double memFac=2) ; ~NameSet() ; } ; # 86 "spxlp.hh" 2 # 99 "spxlp.hh" class SPxLP_Id ; class SPxLP_SPxColId : public SVSet_Key { friend class SPxLP ; SPxLP_SPxColId(const SVSet::Key& key) : SVSet_Key(key) { } public: SPxLP_SPxColId() { } SPxLP_SPxColId(const SPxLP_Id& key) ; } ; class SPxLP_SPxRowId : public SVSet_Key { friend class SPxLP ; SPxLP_SPxRowId(const SVSet::Key& key) : SVSet_Key(key) { } public: SPxLP_SPxRowId() { } SPxLP_SPxRowId(const SPxLP_Id& key) ; } ; class SPxLP_Id : public SVSet_Key { public: enum Type { ROWID = -1, NONE = 0, COLID = 1 } ; Type type() const { return info ? (info < 0 ? ROWID : COLID) : NONE ; } int isValid() const { return info != 0 ; } void inValidate() { info = 0 ; } int isSPxRowId() const { return info < 0 ; } int isSPxColId() const { return info > 0 ; } int operator==(const SPxLP_Id& id) { return (*(int*)this == *(int*)&id) ; } int operator!=(const SPxLP_Id& id) { return (*(int*)this != *(int*)&id) ; } SPxLP_Id& operator=(const SPxLP_Id& id) { *((int*)this) = *((int*)(&id)) ; return *this ; } SPxLP_Id& operator=(const SPxLP_SPxColId cid) { *(int*)this = *(int*)&cid ; info = COLID * (cid.info + 1) ; return *this ; } SPxLP_Id& operator=(const SPxLP_SPxRowId rid) { *(int*)this = *(int*)&rid ; info = ROWID * (rid.info + 1) ; return *this ; } SPxLP_Id() { info = NONE ; idx = -1 ; } SPxLP_Id(const SPxLP_SPxColId& cid) { info = COLID * (cid.info + 1) ; idx = cid.idx ; } SPxLP_Id(const SPxLP_SPxRowId& rid) { info = ROWID * (rid.info + 1) ; idx = rid.idx ; } } ; inline SPxLP_SPxRowId::SPxLP_SPxRowId(const SPxLP_Id& key) : SVSet_Key(key) { ((void) (( !key.isSPxColId() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "spxlp.hh" , 269 , "!key.isSPxColId()" ), 0) )) ; info = info*SPxLP_Id::ROWID - 1 ; } inline SPxLP_SPxColId::SPxLP_SPxColId(const SPxLP_Id& key) : SVSet_Key(key) { ((void) (( !key.isSPxRowId() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "spxlp.hh" , 276 , "!key.isSPxRowId()" ), 0) )) ; info = info*SPxLP_Id::COLID - 1 ; } class SoPlex ; class SPxLP : protected LPRowSet, protected LPColSet { friend class SPxBasis; friend class SPxScale ; friend int getmarsz (SoPlex*) ; friend int getmartz (SoPlex*) ; friend int SPxLP__readLine( istream& is, char*& f1, char*& f2, char*& f3, char*& f4, char*& f5, char*& f6 ) ; static int SPxLP::readLine( istream& is, char*& f1, char*& f2, char*& f3, char*& f4, char*& f5, char*& f6 ) ; SVector& colVector(int i) { return LPColSet::colVector(i) ; } SVector& rowVector(int i) { return LPRowSet::rowVector(i) ; } protected: const LPRowSet* lprowset() const { LPRowSet* svs = (LPRowSet*)this ; return svs ; } const LPColSet* lpcolset() const { LPColSet* svs = (LPColSet*)this ; return svs ; } SVSet* rowset() { SVSet* svs = (SVSet*)(LPRowSet*)this ; return svs ; } SVSet* colset() { SVSet* svs = (SVSet*)(LPColSet*)this ; return svs ; } public: typedef SPxLP_SPxRowId SPxRowId ; typedef SPxLP_SPxColId SPxColId ; typedef SPxLP_Id Id ; enum SPxSense { MAXIMIZE = 1, MINIMIZE = -1 } ; private: SPxSense thesense ; public: static const double infinity ; int nRows() const { return LPRowSet::num() ; } int nCols() const { return LPColSet::num() ; } void getRow(int i, LPRow& row) const ; void getRow( SPxRowId id, LPRow& row) const { getRow( number(id), row ) ; } void getRows(int start, int end, LPRowSet& set) const ; const SVector& rowVector(int i) const { return LPRowSet::rowVector(i) ; } const SVector& rowVector(SPxRowId& id) const { return LPRowSet::rowVector(id) ; } const Vector& rhs( ) const { return LPRowSet::rhs() ; } double rhs(int i) const { return LPRowSet::rhs(i) ; } double& rhs(int i) { return LPRowSet::rhs(i) ; } double rhs(SPxRowId& id) const { return LPRowSet::rhs(id) ; } const Vector& lhs( ) const { return LPRowSet::lhs() ; } double lhs(int i) const { return LPRowSet::lhs(i) ; } double& lhs(int i) { return LPRowSet::lhs(i) ; } double lhs(SPxRowId& id) const { return LPRowSet::lhs(id) ; } void getCol(int i, LPCol& column) const ; void getCol( SPxColId id, LPCol& col) const { getCol( number(id), col ) ; } void getCols(int start, int end, LPColSet& set) const ; const SVector& colVector(int i) const { return LPColSet::colVector(i) ; } const SVector& colVector(SPxColId& id) const { return LPColSet::colVector(id) ; } void getObj( Vector& obj ) const ; double obj(int i) const { return spxSense() * maxObj(i) ; } double obj(SPxColId& id) const { return spxSense() * maxObj(id) ; } const Vector& maxObj( ) const { return LPColSet::obj() ; } double maxObj(int i) const { return LPColSet::obj(i) ; } double& maxObj(int i) { return LPColSet::obj(i) ; } double maxObj(SPxColId& id) const { return LPColSet::obj(id) ; } const Vector& upper( ) const { return LPColSet::upper() ; } double upper(int i) const { return LPColSet::upper(i) ; } double& upper(int i) { return LPColSet::upper(i) ; } double upper(SPxColId& id) const { return LPColSet::upper(id) ; } const Vector& lower( ) const { return LPColSet::lower() ; } double lower(int i) const { return LPColSet::lower(i) ; } double& lower(int i) { return LPColSet::lower(i) ; } double lower(SPxColId& id) const { return LPColSet::lower(id) ; } SPxSense spxSense() const { return thesense ; } int number(const SPxRowId& id) const { return LPRowSet::number(id) ; } int number(const SPxColId& id) const { return LPColSet::number(id) ; } int number(const Id& id) const { return (id.type() == Id::COLID) ? LPColSet::number( id ) : LPRowSet::number( id ) ; } SPxRowId rId(int n) const { return LPRowSet::key(n) ; } SPxColId cId(int n) const { return LPColSet::key(n) ; } private: void doAddRow ( const LPRow& row) ; void doAddRows( const LPRowSet& set ) ; void doAddCol ( const LPCol& col) ; void doAddCols( const LPColSet& set ) ; public: void addRow(const LPRow& row) { doAddRow( row ) ; } void addRow(SPxRowId& id, const LPRow& row) { addRow( row ) ; id = rId( nRows()-1 ) ; } void addRows( const LPRowSet& set ) { doAddRows( set ) ; } void addRows(SPxRowId id[], const LPRowSet& set ) ; void addCol(const LPCol& col) { doAddCol(col) ; } void addCol(SPxColId& id, const LPCol& col) { addCol( col ) ; id = cId( nCols()-1 ) ; } void addCols( const LPColSet& set ) { doAddCols( set ) ; } void addCols(SPxColId id[], const LPColSet& set ) ; protected: virtual void addedRows( int n ) { (void)n ; } virtual void addedCols( int n ) { (void)n ; } void added2Set( SVSet& set, const SVSet& add, int n ) ; public: void removeRow(int i) { doRemoveRow(i) ; } void removeRow(SPxRowId id) { removeRow( number(id) ) ; } void removeCols(int perm[]) { doRemoveCols(perm) ; } void removeRows(int perm[]) { doRemoveRows(perm) ; } void removeRows(SPxRowId id[], int n, int perm[] = 0 ) ; void removeRows(int nums[], int n, int perm[] = 0 ) ; void removeRowRange(int start, int end, int perm[] = 0) ; void removeCol(int i) { doRemoveCol(i) ; } void removeCol(SPxColId id) { removeCol( number(id) ) ; } void removeCols(SPxColId id[], int n, int perm[] = 0 ) ; void removeCols(int nums[], int n, int perm[] = 0 ) ; void removeColRange(int start, int end, int perm[] = 0) ; virtual void clear() ; protected: virtual void doRemoveRow(int i) ; virtual void doRemoveCols(int perm[]) ; virtual void doRemoveRows(int perm[]) ; virtual void doRemoveCol(int i) ; public: virtual void read ( istream& in, NameSet* rowNames=0, NameSet* colNames=0, DIdxSet* intVars=0 ) ; virtual void readLP ( istream& in, NameSet* rowNames=0, NameSet* colNames=0, DIdxSet* intVars=0 ) ; virtual void readMPS( istream& in, NameSet* rowNames=0, NameSet* colNames=0 ) ; friend istream& operator>>( istream& is, SPxLP& lp ) { lp.read( is ) ; return is ; } friend ostream& operator<<( ostream& os, const SPxLP& lp ) ; virtual void changeObj( const Vector& newObj ) ; virtual void changeObj( int i, double newVal ) ; virtual void changeObj( SPxColId id, double newVal ) { changeObj( number(id), newVal ) ; } virtual void changeLower( const Vector& newLower ) ; virtual void changeLower( int i, double newLower ) ; virtual void changeLower( SPxColId id, double newLower ) { changeLower( number(id), newLower ) ; } virtual void changeUpper( const Vector& newUpper ) ; virtual void changeUpper( int i, double newUpper ) ; virtual void changeUpper( SPxColId id, double newUpper ) { changeUpper( number(id), newUpper ) ; } virtual void changeBounds( const Vector& newLower, const Vector& newUpper ) ; virtual void changeBounds( int i, double newLower, double newUpper ) ; virtual void changeBounds( SPxColId id, double newLower, double newUpper) { changeBounds( number(id), newLower, newUpper ) ; } virtual void changeLhs( const Vector& newLhs ) ; virtual void changeLhs( int i, double newLhs ) ; virtual void changeLhs( SPxRowId id, double newLhs ) { changeLhs( number(id), newLhs ) ; } virtual void changeRhs( const Vector& newRhs ) ; virtual void changeRhs( int i, double newRhs ) ; virtual void changeRhs( SPxRowId id, double newRhs ) { changeRhs( number(id), newRhs ) ; } virtual void changeRange( const Vector& newLhs, const Vector& newRhs) ; virtual void changeRange( int i, double newLhs, double newRhs ) ; virtual void changeRange( SPxRowId id, double newLhs, double newRhs ) { changeRange( number(id), newLhs, newRhs ) ; } virtual void changeRow( int i, const LPRow& newRow ) ; virtual void changeRow( SPxRowId id, const LPRow& newRow ) { changeRow( number(id), newRow ) ; } virtual void changeCol( int i, const LPCol& newCol ) ; virtual void changeCol( SPxColId id, const LPCol& newCol ) { changeCol( number(id), newCol ) ; } virtual void changeElement( int i, int j, double val ) ; virtual void changeElement( SPxRowId rid, SPxColId cid, double val) { changeElement( number(rid), number(cid), val ) ; } virtual void changeSense( SPxSense sns ) { if( sns != thesense ) LPColSet::obj() *= -1 ; thesense = sns ; } int isConsistent() const ; SPxLP() { clear() ; } } ; # 74 "soplex.hh" 2 # 1 "spxbasis.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 79 "spxbasis.hh" 2 # 1 "slinsolver.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 43 "slinsolver.hh" 2 # 64 "slinsolver.hh" class SLinSolver { public: enum Status { OK = 0, INSTABLE = 1 , SINGULAR = 2 , UNLOADED = 4 , ERROR = 8 } ; virtual Status status() const = 0 ; virtual void clear() = 0 ; virtual int memory() const = 0 ; virtual int dim() const = 0 ; virtual Status load( const SVector* vec[], int dim ) = 0 ; virtual double stability() const = 0 ; virtual void solve2right( Vector& x, Vector& b ) const = 0 ; virtual void solve2right( Vector& x, SSVector& b ) const = 0 ; virtual void solve2right( SSVector& x, Vector& b ) const = 0 ; virtual void solve2right( SSVector& x, SSVector& b ) const = 0 ; virtual void solveRight ( Vector& x, const Vector& b ) const = 0 ; virtual void solveRight ( Vector& x, const SVector& b ) const = 0 ; virtual void solveRight ( SSVector& x, const Vector& b ) const = 0 ; virtual void solveRight ( SSVector& x, const SVector& b ) const = 0 ; virtual void solveRight4update( SSVector& x, const SVector& b ) = 0 ; virtual void solve2right4update( SSVector& x, Vector& two, const SVector& b, SSVector& rhs ) = 0 ; virtual void solve2left( Vector& x, Vector& b ) const = 0 ; virtual void solve2left( Vector& x, SSVector& b ) const = 0 ; virtual void solve2left( SSVector& x, Vector& b ) const = 0 ; virtual void solve2left( SSVector& x, SSVector& b ) const = 0 ; virtual void solveLeft ( Vector& x, const SVector& b ) const = 0 ; virtual void solveLeft ( Vector& x, const Vector& b ) const = 0 ; virtual void solveLeft ( SSVector& x, const SVector& b ) const = 0 ; virtual void solveLeft ( SSVector& x, const Vector& b ) const = 0 ; virtual void solveLeft ( SSVector& x, Vector& two, const SVector& b, SSVector& rhs2 ) const = 0 ; virtual Status change(int idx, const SVector& subst, const SSVector* eta=0 ) = 0 ; virtual ~SLinSolver() {} virtual int isConsistent() const = 0 ; } ; # 87 "spxbasis.hh" 2 # 99 "spxbasis.hh" class SoPlex ; class SPxBasis { protected: SoPlex* theLP ; public: enum SPxStatus { NO_PROBLEM = -2 , SINGULAR = -1 , REGULAR = 0 , DUAL = 1 , PRIMAL = 2 , OPTIMAL = 3 , UNBOUNDED = 4 , INFEASIBLE = 5 } ; private: SPxStatus thestatus ; public: SPxStatus status() const { return thestatus ; } void setStatus(SPxStatus stat) { thestatus = stat ; } class Desc { public: enum Status { P_ON_LOWER = -4, P_ON_UPPER = -2, P_FREE = -1, P_FIXED = P_ON_UPPER + P_ON_LOWER, D_FREE = 1, D_ON_UPPER = 2, D_ON_LOWER = 4, D_ON_BOTH = D_ON_LOWER + D_ON_UPPER , D_UNDEFINED = 8 } ; private: friend class SPxBasis ; DataArray rowstat ; DataArray colstat ; DataArray* stat ; DataArray* costat ; public: int nCols() const { return colstat.size() ; } int nRows() const { return rowstat.size() ; } int dim() const { return stat->size() ; } int coDim() const { return costat->size() ; } Status& rowStatus( int i ) { return *(Status*)&rowstat[i] ; } Status rowStatus( int i ) const{ return *(Status*)&rowstat[i] ; } const Status* rowStatus( void ) const { return (const Status*)(const int*)rowstat ; } Status& colStatus( int i ) { return *(Status*)&colstat[i] ; } Status colStatus( int i ) const{ return *(Status*)&colstat[i] ; } const Status* colStatus( void ) const { return (const Status*)(const int*)colstat ; } Status& status( int i ) { return *(Status*)&(*stat)[i] ; } Status status( int i ) const { return *(Status*)&(*stat)[i] ; } const Status* status( void ) const { return (const Status*)(const int*)*stat ; } Status& coStatus( int i ) { return *(Status*)&(*costat)[i] ; } Status coStatus( int i ) const { return *(Status*)&(*costat)[i] ; } const Status* coStatus( void ) const { return (const Status*)(const int*)*costat ; } void reSize( int rowDim, int colDim ) ; int isConsistent( ) const ; } ; private: Desc thedesc ; public: const Desc& desc() const { return thedesc ; } Desc& desc() { return thedesc ; } Desc::Status dualColStatus( int i ) const ; Desc::Status dualStatus( const SPxLP::SPxColId& id ) const { return dualColStatus( ((SPxLP*)theLP)->number(id) ) ; } Desc::Status dualRowStatus( int i ) const ; Desc::Status dualStatus( const SPxLP::SPxRowId& id ) const { return dualRowStatus( ((SPxLP*)theLP)->number(id) ) ; } Desc::Status dualStatus( const SPxLP::Id& id ) const { return id.isSPxRowId() ? dualStatus( SPxLP::SPxRowId(id) ) : dualStatus( SPxLP::SPxRowId(id) ) ; } virtual void load( const Desc& ) ; virtual void readBasis( istream& in, NameSet& rowNames, NameSet& colNames ) ; protected: DataArray theBaseId ; DataArray matrix ; void loadMatrixVecs() ; int matrixIsSetup ; public: int maxUpdates ; double nonzeroFactor ; SPxLP::Id& baseId(int i) { return theBaseId[i] ; } SPxLP::Id baseId(int i) const { return theBaseId[i] ; } const SVector& baseVec(int i) const { return *matrix[i] ; } protected: SLinSolver* factor ; int factorized ; int iterCount ; int updateCount ; int nzCount ; double nzFac ; double lastFill ; SPxLP::Id lastin ; SPxLP::Id lastout ; int lastidx ; public: SPxLP::Id lastEntered() const { return lastin ; } SPxLP::Id lastLeft() const { return lastout ; } int lastIndex() const { return lastidx ; } int lastUpdate() const { return updateCount ; } int iteration() const { return iterCount ; } SoPlex* solver() const { return theLP ; } Vector& multBaseWith( Vector& x) const ; Vector& multWithBase( Vector& x) const ; double stability() const { return factor->stability() ; } void solve2 ( Vector& x, Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2right( x, rhs ) ; } void solve2 ( Vector& x, SSVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2right( x, rhs ) ; } void solve2 ( SSVector& x, Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2right( x, rhs ) ; } void solve2 ( SSVector& x, SSVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2right( x, rhs ) ; } void solve ( Vector& x, const Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveRight( x, rhs ) ; } void solve ( Vector& x, const SVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveRight( x, rhs ) ; } void solve ( SSVector& x, const SVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveRight( x, rhs ) ; } void solve ( SSVector& x, const Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveRight( x, rhs ) ; } void solve4update( SSVector& x, const SVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveRight4update( x, rhs ) ; } void solve4update(SSVector& x, Vector& y, const SVector& rhsx, SSVector& rhsy) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2right4update( x, y, rhsx, rhsy ) ; } void coSolve2( Vector& x, Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2left( x, rhs ) ; } void coSolve2( Vector& x, SSVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2left( x, rhs ) ; } void coSolve2( SSVector& x, Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2left( x, rhs ) ; } void coSolve2( SSVector& x, SSVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solve2left( x, rhs ) ; } void coSolve( Vector& x, const Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveLeft( x, rhs ) ; } void coSolve( Vector& x, const SVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveLeft( x, rhs ) ; } void coSolve( SSVector& x, const SVector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveLeft( x, rhs ) ; } void coSolve( SSVector& x, const Vector& rhs ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveLeft( x, rhs ) ; } void coSolve( SSVector& x, Vector& y, const SVector& rhsx, SSVector& rhsy ) const { if( !factorized ) ((SPxBasis*)this)->SPxBasis::factorize() ; factor->solveLeft( x, y, rhsx, rhsy ) ; } protected: void reDim() ; public: void addedRows( int n ) ; void removedRow(int i) ; void removedRows(int perm[]) ; void addedCols( int n ) ; void removedCol(int i) ; void removedCols(int perm[]) ; void changedRow( int ) ; void changedCol( int ) ; void changedElement( int, int ) ; virtual void change( int i, SPxLP::Id& id, const SVector* enterVec, const SSVector* eta=0 ) ; protected: virtual int doFactorize() ; virtual void factorize() ; void setRep( ) ; public: void load( SLinSolver* solver ) ; void load( SoPlex* lp ) ; void unLoad( ) { theLP = 0 ; setStatus( NO_PROBLEM ) ; } int isConsistent() const ; SPxBasis() ; } ; # 75 "soplex.hh" 2 # 1 "array.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 76 "array.hh" 2 template class Array { protected: int num ; T *data ; public: T& operator[](int n) { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 126 , "n >= 0 && n < size()" ), 0) )) ; return data[n] ; } const T& operator[](int n) const { ((void) (( n >= 0 && n < size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 132 , "n >= 0 && n < size()" ), 0) )) ; return data[n] ; } operator T* () { return data ; } operator const T* () const { return data ; } void append(int n) { insert(size(), n) ; } void append(int n, const T* tarray) { insert(size(), n, tarray) ; } void append(const Array& tarray) { insert(size(), tarray) ; } void insert(int i, int n) { ((void) (( i <= size() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 155 , "i <= size()" ), 0) )) ; if(n > 0) { int k ; T *olddata = data ; data = new T[size()+n] ; ((void) (( data ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 161 , "data" ), 0) )) ; if(size() > 0) { for(k = 0; k < i; ++k) data[k] = olddata[k] ; for(; k < size(); ++k) data[k+n] = olddata[k] ; delete[] olddata ; } num += n ; } } void insert(int i, int n, const T* tarray) { insert(i, n) ; for(n--; n >= 0; --n) data[n+i] = tarray[n] ; } void insert(int i, const Array& tarray) { int n = tarray.size() ; insert(i, n) ; for(n--; n >= 0; --n) data[n+i] = tarray.data[n] ; } void remove(int n=0, int m=1) { ((void) (( n >= 0 && m >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 194 , "n >= 0 && m >= 0" ), 0) )) ; if(m > 0 && n < size()) { T *olddata = data ; m -= (n+m <= size()) ? 0 : n+m-size() ; num -= m ; if(num > 0) { int i ; data = new T[num] ; for(i = 0; i < n; ++i) data[i] = olddata[i] ; for(; i < num; ++i) data[i] = olddata[i+m] ; } delete[] olddata ; } } void clear() { if(num > 0) { num = 0 ; delete[] data ; } } int size() const { return num ; } void reSize(int newsize) { if(newsize < size()) remove(newsize, size()-newsize) ; else if(newsize > size()) append(newsize - size()) ; } Array& operator=(const Array& rhs) { reSize(rhs.size()) ; for(int i = 0 ; i < size() ; ++i) data[i] = rhs.data[i] ; return *this ; } Array(int n = 0) : data( 0 ) { ((void) (( n >= 0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 255 , "n >= 0" ), 0) )) ; num = n ; if(num > 0) { data = new T[num] ; ((void) (( data ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 260 , "data" ), 0) )) ; } } Array(const Array& old) : num(old.num) { if(num > 0) { data = new T[num] ; ((void) (( data ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "array.hh" , 271 , "data" ), 0) )) ; *this = old ; } } ~Array() { if(num > 0) delete[] data ; } int isConsistent() const { if(num < 0 || (num > 0 && data == 0) ) { cerr << "Inconsistency detected in class array\n" ; return 0 ; } return 1 ; } } ; # 76 "soplex.hh" 2 # 1 "random.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 56 "random.hh" 2 class Random { private: double themin ; double themax ; unsigned long next ; double next_random () { next = next * 1103515245 + 12345 ; return last_random() ; } double last_random() const { int i = ( int ) ( next / 65536 ) % 32768 ; return ( ( double ) i / 32768 ); } public: double min() const { return themin ; } double max() const { return themax ; } operator double() { return (themin + (themax-themin) * next_random() ) ; } double last() const { return (themin + (themax-themin) * last_random() ) ; } void setMin(double min) { themin = min ; } void setMax(double max) { themax = max ; } void setSeed(double seed) { seed = (seed-themin) / (themax-themin) ; next = (unsigned long)(seed * 32768 * 65536 ) ; } Random(double min=0, double max=1, double seed=0.5) : themin(min), themax(max) { if( seed < min || seed > max ) seed = (min + max) / 2 ; setSeed(seed) ; } int isConsistent() const { return themin <= themax ; } } ; # 77 "soplex.hh" 2 # 1 "unitvector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 62 "unitvector.hh" 2 class UnitVector : public SVector { private: Element themem ; Element themem1 ; public: double value(int n) const { (void)n ; ((void) (( n==0 ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "unitvector.hh" , 95 , "n==0" ), 0) )) ; return 1 ; } UnitVector( int i = 0 ) : SVector( 2, &themem ) { add(i, 1.0) ; } UnitVector( const UnitVector& rhs ) : SVector( 2, &themem ) , themem ( rhs.themem ) , themem1( rhs.themem1 ) {} UnitVector& operator=( const UnitVector& rhs ) { themem1 = rhs.themem1 ; return *this ; } int isConsistent() const ; } ; # 78 "soplex.hh" 2 # 1 "updatevector.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 64 "updatevector.hh" 2 extern "C" { void UpdateUpdateVector( double*, double, int, const int*, const double* ) ; } class UpdateVector : public DVector { double theval ; SSVector thedelta ; public: double& value() { return theval ; } double value() const { return theval ; } SSVector& delta() { return thedelta ; } const SSVector& delta() const { return thedelta ; } const IdxSet& idx() const { return thedelta.indices() ; } void update() { multAdd( theval, thedelta ) ; } void clear() { DVector::clear() ; clearUpdate() ; } void clearUpdate() { thedelta.clear() ; theval = 0 ; } void reDim( int newdim ) { DVector::reDim(newdim) ; thedelta.reDim(newdim) ; } UpdateVector& operator=(const DVector& rhs) { DVector::operator=(rhs) ; return *this ; } UpdateVector& operator=(const UpdateVector& rhs) ; UpdateVector( int dim , double eps ) : DVector ( dim ), theval ( 0 ), thedelta( dim, eps ) { } int isConsistent() const ; } ; # 79 "soplex.hh" 2 # 94 "soplex.hh" class SPxPricer ; class SPxRatioTester ; class SPxStarter ; class SPxSimplifier ; # 115 "soplex.hh" class SoPlex : public CacheLPSolver, public SPxLP, protected SPxBasis { friend class DoPlex ; friend class SPxFastRT ; Timer theTime ; public: enum Representation { ROW = -1, COLUMN = 1 } ; Representation rep() const { return therep ; } private: Representation therep ; public: enum Type { ENTER=-1, LEAVE=1 } ; Type type() const { return theType ; } enum Pricing { FULL, PARTIAL } ; Pricing pricing() const { return thePricing ; } private: Type theType ; Pricing thePricing ; public: friend istream& operator>>( istream& is, SoPlex& lp ) { lp.read( is ) ; return is ; } virtual void read( istream& in, NameSet* rowNames=0, NameSet* colNames=0, DIdxSet* intVars=0 ) ; void load( const SPxLP& LP ) ; void load( SLinSolver* slu ) ; void load( SPxPricer* ) ; void load( SPxRatioTester* ) ; void load( SPxStarter* ) ; void load( SPxSimplifier* ) ; void load( const SPxBasis::Desc& ) ; SPxBasis::readBasis ; void setRep ( int rep ) ; void setType( Type tp ) ; void setPricing( Pricing pr ) ; virtual void reLoad() ; void readFile(char* filename) ; void dumpFile(char* filename) const ; void clear() ; LPSolver::Status solve() ; LPSolver::Status status() const ; virtual double value() const ; LPSolver::Status getPrimal (Vector& vector) const ; LPSolver::Status getSlacks (Vector& vector) const ; LPSolver::Status getDual (Vector& vector) const ; LPSolver::Status getRdCost (Vector& vector) const ; virtual int terminate () ; private: double thedelta ; public: double epsilon() const { return primVec.delta().epsilon ; } void setEpsilon( double eps ) ; double delta() const { return thedelta ; } void setDelta( double d) ; int maxCycle ; int numCycle ; public: private: void localAddRows( int start ) ; void localAddCols( int start ) ; protected: virtual void addedRows( int n ) ; virtual void addedCols( int n ) ; virtual void doRemoveRow(int i) ; virtual void doRemoveRows(int perm[]) ; virtual void doRemoveCol(int i) ; virtual void doRemoveCols(int perm[]) ; public: virtual void changeObj( const Vector& newObj ) ; virtual void changeObj( int i, double newVal ) ; virtual void changeObj( SPxLP::SPxColId id, double newVal ) { changeObj( number(id), newVal ) ; } virtual void changeLower( const Vector& newLower ) ; virtual void changeLower( int i, double newLower ) ; virtual void changeLower( SPxLP::SPxColId id, double newLower ) { changeLower( number(id), newLower ) ; } virtual void changeUpper( const Vector& newUpper ) ; virtual void changeUpper( int i, double newUpper ) ; virtual void changeUpper( SPxLP::SPxColId id, double newUpper ) { changeUpper( number(id), newUpper ) ; } virtual void changeBounds( const Vector& newLower, const Vector& newUpper ) ; virtual void changeBounds( int i, double newLower, double newUpper ) ; virtual void changeBounds( SPxLP::SPxColId id, double newLower, double newUpper) { changeBounds( number(id), newLower, newUpper ) ; } virtual void changeLhs( const Vector& newLhs ) ; virtual void changeLhs( int i, double newLhs ) ; virtual void changeLhs( SPxLP::SPxRowId id, double newLhs ) { changeLhs( number(id), newLhs ) ; } virtual void changeRhs( const Vector& newRhs ) ; virtual void changeRhs( int i, double newRhs ) ; virtual void changeRhs( SPxLP::SPxRowId id, double newRhs ) { changeRhs( number(id), newRhs ) ; } virtual void changeRange( const Vector& newLhs, const Vector& newRhs) ; virtual void changeRange( int i, double newLhs, double newRhs ) ; virtual void changeRange( SPxLP::SPxRowId id, double newLhs, double newRhs ) { changeRange( number(id), newLhs, newRhs ) ; } virtual void changeRow( int i, const LPRow& newRow ) ; virtual void changeRow( SPxLP::SPxRowId id, const LPRow& newRow ) { changeRow( number(id), newRow ) ; } virtual void changeCol( int i, const LPCol& newCol ) ; virtual void changeCol( SPxLP::SPxColId id, const LPCol& newCol ) { changeCol( number(id), newCol ) ; } virtual void changeElement( int i, int j, double val ) ; virtual void changeElement( SPxLP::SPxRowId rid, SPxLP::SPxColId cid, double val) { changeElement( number(rid), number(cid), val ) ; } virtual void changeSense( SPxLP::SPxSense sns ) ; public: int dim() const { return thecovectors->num() ; } int coDim() const { return thevectors->num() ; } int number(SPxRowId id) const { return SPxLP::number( id ) ; } int number(SPxColId id) const { return SPxLP::number( id ) ; } int number(Id id) const { return SPxLP::number( id ) ; } Id id(int i) const { if( rep() == ROW ) { SPxLP::SPxRowId rid = SPxLP::rId(i) ; return Id( rid ) ; } else { SPxLP::SPxColId cid = SPxLP::cId(i) ; return Id( cid ) ; } } Id coId(int i) const { if( rep() == ROW ) { SPxLP::SPxColId cid = SPxLP::cId(i) ; return Id( cid ) ; } else { SPxLP::SPxRowId rid = SPxLP::rId(i) ; return Id( rid ) ; } } int isId( SPxLP::Id id ) const { return id.info * therep > 0 ; } int isCoId( SPxLP::Id id ) const { return id.info * therep < 0 ; } protected: Array unitVecs ; const SVSet* thevectors ; const SVSet* thecovectors ; int nNZEs ; int nVeCs ; int coVecDim ; Array > subcovectors ; int sortLP ( int pe, int nPes ) ; void splitLP( int pe, int nPes ) ; virtual void splitLP() ; public: const SVector& vector(int i) const { return (*thevectors)[i] ; } const SVector& vector(const SPxLP::SPxRowId& rid) const { ((void) (( rid.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 738 , "rid.isValid()" ), 0) )) ; return (rep() == ROW) ? (*thevectors)[number(rid)] : *(const SVector*)&(unitVecs[number(rid)]) ; } const SVector& vector(const SPxLP::SPxColId& cid) const { ((void) (( cid.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 747 , "cid.isValid()" ), 0) )) ; return (rep() == COLUMN) ? (*thevectors)[number(cid)] : *(const SVector*)&(unitVecs[number(cid)]) ; } const SVector& vector(const Id& id) const { ((void) (( id.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 762 , "id.isValid()" ), 0) )) ; return id.isSPxRowId() ? vector( SPxLP::SPxRowId(id) ) : vector( SPxLP::SPxColId(id) ) ; } const SVector& coVector(int i) const { return (*thecovectors)[i] ; } const SVector& coVector(const SPxLP::SPxRowId& rid) const { ((void) (( rid.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 777 , "rid.isValid()" ), 0) )) ; return (rep() == COLUMN) ? (*thecovectors)[number(rid)] : *(const SVector*)&(unitVecs[number(rid)]) ; } const SVector& coVector(const SPxLP::SPxColId& cid) const { ((void) (( cid.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 786 , "cid.isValid()" ), 0) )) ; return (rep() == ROW) ? (*thecovectors)[number(cid)] : *(const SVector*)&(unitVecs[number(cid)]) ; } const SVector& coVector(const Id& id) const { ((void) (( id.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 801 , "id.isValid()" ), 0) )) ; return id.isSPxRowId() ? coVector( SPxLP::SPxRowId(id) ) : coVector( SPxLP::SPxColId(id) ) ; } const SVector& unitVector( int i ) const { return unitVecs[i] ; } SPxBasis::Desc::Status status( int i ) ; SPxBasis::Desc::Status coStatus( int i ) ; int isBasic( SPxBasis::Desc::Status stat ) const { return (stat * rep() > 0) ; } int isBasic( SPxLP::Id id ) const { ((void) (( id.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 831 , "id.isValid()" ), 0) )) ; return id.isSPxRowId() ? isBasic( SPxLP::SPxRowId(id) ) : isBasic( SPxLP::SPxColId(id) ) ; } int isBasic( SPxLP::SPxRowId rid ) const { return isBasic( desc().rowStatus( number(rid) ) ) ; } int isBasic( SPxLP::SPxColId cid ) const { return isBasic( desc().colStatus( number(cid) ) ) ; } int isRowBasic( int i ) const { return isBasic( desc().rowStatus(i) ) ; } int isColBasic( int i ) const { return isBasic( desc().colStatus(i) ) ; } int isBasic( int i ) const { return isBasic( desc().status(i) ) ; } int isCoBasic( int i ) const { return isBasic( desc().coStatus(i) ) ; } SPxBasis::dualRowStatus ; SPxBasis::dualColStatus ; protected: DVector primRhs ; UpdateVector primVec ; DVector dualRhs ; UpdateVector dualVec ; UpdateVector addVec ; DVector theURbound ; DVector theLRbound ; DVector theUCbound ; DVector theLCbound ; DVector theUBbound ; DVector theLBbound ; DVector* theFrhs ; UpdateVector* theFvec ; DVector* theCoPrhs ; UpdateVector* theCoPvec ; UpdateVector* thePvec ; UpdateVector* theRPvec ; UpdateVector* theCPvec ; DVector* theUbound ; DVector* theLbound ; DVector* theCoUbound ; DVector* theCoLbound ; DVector theCoTest ; DVector theTest ; public: UpdateVector& fVec() const { return *theFvec ; } const Vector& fRhs() const { return *theFrhs ; } const Vector& ubBound() const { return theUBbound ; } Vector& ubBound() { return theUBbound ; } const Vector& lbBound() const { return theLBbound ; } Vector& lbBound() { return theLBbound ; } const Vector& fTest() const { ((void) (( type() == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1035 , "type() == LEAVE" ), 0) )) ; return theCoTest ; } UpdateVector& coPvec() const { return *theCoPvec ; } const Vector& coPrhs() const { return *theCoPrhs ; } const Vector& ucBound() const { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1061 , "theType == LEAVE" ), 0) )) ; return *theCoUbound ; } Vector& ucBound() { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1075 , "theType == LEAVE" ), 0) )) ; return *theCoUbound ; } const Vector& lcBound() const { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1082 , "theType == LEAVE" ), 0) )) ; return *theCoLbound ; } Vector& lcBound() { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1096 , "theType == LEAVE" ), 0) )) ; return *theCoLbound ; } const Vector& coTest() const { ((void) (( type() == ENTER ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1109 , "type() == ENTER" ), 0) )) ; return theCoTest ; } UpdateVector& pVec() const { return *thePvec ; } const Vector& upBound() const { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1127 , "theType == LEAVE" ), 0) )) ; return *theUbound ; } Vector& upBound() { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1141 , "theType == LEAVE" ), 0) )) ; return *theUbound ; } const Vector& lpBound() const { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1148 , "theType == LEAVE" ), 0) )) ; return *theLbound ; } Vector& lpBound() { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1162 , "theType == LEAVE" ), 0) )) ; return *theLbound ; } const Vector& test() const { ((void) (( type() == ENTER ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1175 , "type() == ENTER" ), 0) )) ; return theTest ; } double computePvec(int i) ; void computePvec() ; double computeTest(int i) ; void computeTest() ; private: double theShift ; double lastShift ; protected: int leaveCount ; int enterCount ; public: void shiftFvec() ; void shiftPvec() ; void shiftUBbound(int i, double to ) { ((void) (( theType == ENTER ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1234 , "theType == ENTER" ), 0) )) ; theShift += to - theUBbound[i] ; theUBbound[i] = to ; } void shiftLBbound(int i, double to ) { ((void) (( theType == ENTER ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1241 , "theType == ENTER" ), 0) )) ; theShift += theLBbound[i] - to ; theLBbound[i] = to ; } void shiftUPbound(int i, double to ) { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1248 , "theType == LEAVE" ), 0) )) ; theShift += to - (*theUbound)[i] ; (*theUbound)[i] = to ; } void shiftLPbound(int i, double to ) { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1255 , "theType == LEAVE" ), 0) )) ; theShift += (*theLbound)[i] - to ; (*theLbound)[i] = to ; } void shiftUCbound(int i, double to ) { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1262 , "theType == LEAVE" ), 0) )) ; theShift += to - (*theCoUbound)[i] ; (*theCoUbound)[i] = to ; } void shiftLCbound(int i, double to ) { ((void) (( theType == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1269 , "theType == LEAVE" ), 0) )) ; theShift += (*theCoLbound)[i] - to ; (*theCoLbound)[i] = to ; } void testBounds() const ; virtual double shift() const { return theShift ; } virtual void unShift( void ) ; private: void perturbMin( const UpdateVector& vec, Vector& low, Vector& up, double eps, int start=0, int incr=1 ) ; void perturbMax( const UpdateVector& vec, Vector& low, Vector& up, double eps, int start=0, int incr=1 ) ; double perturbMin( const UpdateVector& uvec, Vector& low, Vector& up, double eps, double delta, const SPxBasis::Desc::Status* stat, int start, int incr ) ; double perturbMax( const UpdateVector& uvec, Vector& low, Vector& up, double eps, double delta, const SPxBasis::Desc::Status* stat, int start, int incr ) ; public: virtual double maxInfeas() const ; const SPxBasis& basis() const { return *this ; } const SPxPricer* pricer() const { return thepricer ; } const SLinSolver* slinSolver() const { return SPxBasis::factor ; } const SPxRatioTester* ratiotester() const { return theratiotester; } const SPxStarter* starter() const { return thestarter ; } const SPxSimplifier* simplifier() const { return thesimplifier ; } protected: virtual void factorize( ) ; private: SPxPricer* thepricer ; SPxRatioTester* theratiotester ; SPxStarter* thestarter ; SPxSimplifier* thesimplifier ; int leave(int i) ; int enter(Id& id) ; double coTest(int, SPxBasis::Desc::Status) const ; void computeCoTest() ; void updateCoTest() ; double test(int i, SPxBasis::Desc::Status stat) const ; void updateTest() ; void computeFtest() ; void updateFtest() ; Vector* solveVector2 ; SSVector* solveVector2rhs ; Vector* coSolveVector2 ; SSVector* coSolveVector2rhs ; public: void setup4solve( Vector* y, SSVector* rhs ) const { ((void) (( type() == LEAVE ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1407 , "type() == LEAVE" ), 0) )) ; ((SoPlex*)this)->solveVector2 = y ; ((SoPlex*)this)->solveVector2rhs = rhs ; } void setup4coSolve( Vector* y, SSVector* rhs ) const { ((void) (( type() == ENTER ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1421 , "type() == ENTER" ), 0) )) ; ((SoPlex*)this)->coSolveVector2 = y ; ((SoPlex*)this)->coSolveVector2rhs = rhs ; } protected: private: int initialized ; protected: int isInitialized() const { return initialized ; } public: virtual void init() ; protected: virtual void unInit() { initialized = 0 ; } virtual void reDim() ; void computeFrhs() ; virtual void computeFrhsXtra() ; virtual void computeFrhs1( const Vector&, const Vector& ) ; void computeFrhs2( const Vector&, const Vector& ) ; virtual void computeEnterCoPrhs( ) ; void computeEnterCoPrhs4Row( int i, int n ) ; void computeEnterCoPrhs4Col( int i, int n ) ; virtual void computeLeaveCoPrhs( ) ; void computeLeaveCoPrhs4Row( int i, int n ) ; void computeLeaveCoPrhs4Col( int i, int n ) ; double nonbasicValue() const ; virtual const SVector* enterVector(const Id& id) { ((void) (( id.isValid() ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "soplex.hh" , 1501 , "id.isValid()" ), 0) )) ; return id.isSPxRowId() ? &vector( SPxRowId(id) ) : &vector( SPxColId(id) ) ; } virtual void getLeaveVals( int i, SPxBasis::Desc::Status& leaveStat, Id& leaveId, double& leaveMax, double& leavebound, int& leaveNum ) ; virtual void getLeaveVals2(int leaveIdx, double leaveMax, Id enterId, double& enterBound, double& newUBbound, double& newLBbound, double& newCoPrhs ) ; virtual void getEnterVals( Id id, double& enterTest, double& enterUB, double& enterLB, double& enterVal, double& enterMax, double& enterPric, SPxBasis::Desc::Status& enterStat, double& enterRO ) ; virtual void getEnterVals2(int leaveIdx, double enterMax, double& leaveBound ) ; virtual void ungetEnterVal(Id enterId, SPxBasis::Desc::Status enterStat, double leaveVal, const SVector& vec ) ; virtual void rejectEnter(Id enterId, double enterTest, SPxBasis::Desc::Status enterStat ) ; virtual void rejectLeave( int leaveNum, Id leaveId, SPxBasis::Desc::Status leaveStat, const SVector* newVec=0) ; virtual void setupPupdate( void ) ; virtual void doPupdate( void ) ; virtual void clearUpdateVecs( void ) ; virtual void perturbMinEnter( void ) ; virtual void perturbMaxEnter( void ) ; virtual void perturbMinLeave( void ) ; virtual void perturbMaxLeave( void ) ; void clearDualBounds( SPxBasis::Desc::Status, double&, double&) ; void setDualColBounds( ) ; void setDualRowBounds( ) ; void setPrimalBounds( ) ; void setEnterBound4Col( int, int ) ; void setEnterBound4Row( int, int ) ; virtual void setEnterBounds( ) ; void setLeaveBound4Row( int i, int n ) ; void setLeaveBound4Col( int i, int n ) ; virtual void setLeaveBounds( ) ; private: int maxIters ; double maxTime ; public: void setTermination(double value = LPSolver::infinity, double time = -1 , int iteration = -1 ) ; virtual void getTermination(double* value = 0 , double* time = 0 , int* iteration = 0 ) const ; double objValue() const { return value() ; } LPSolver::Status getResult(double* value = 0, Vector* primal = 0, Vector* slacks = 0, Vector* dual = 0, Vector* reduCost = 0) const ; void setBasis(const signed char rows[], const signed char cols[]) ; LPSolver::Status getBasis(signed char rows[], signed char cols[]) const ; int iterations() const { return basis().iteration() ; } double time() const { return theTime.userTime() ; } void addRow(const LPRow& row) { SPxLP::addRow( row ) ; } void addRow(LPSolver::RowId& id, const LPRow& row) { SPxLP::addRow( *(SPxRowId*)&id, row ) ; } void addRows( const LPRowSet& set ) { SPxLP::addRows( set ) ; } void addRows(LPSolver::RowId id[], const LPRowSet& set ) { SPxLP::addRows( (SPxRowId*)id, set ) ; } void addCol(const LPCol& col) { SPxLP::addCol( col ) ; } void addCol(LPSolver::ColId& id, const LPCol& col) { SPxLP::addCol( *(SPxColId*)&id, col ) ; } void addCols( const LPColSet& set ) { SPxLP::addCols( set ) ; } void addCols(LPSolver::ColId id[], const LPColSet& set ) { SPxLP::addCols( (SPxColId*)id, set ) ; } void removeRow(int i) { SPxLP::removeRow( i ) ; } void removeRow(LPSolver::RowId id) { SPxLP::removeRow( *(SPxRowId*)&id ) ; } void removeCol(int i) { SPxLP::removeCol( i ) ; } void removeCol(LPSolver::ColId id) { SPxLP::removeCol( *(SPxColId*)&id ) ; } void removeRows(LPSolver::RowId id[], int n, int perm[] = 0) { SPxLP::removeRows( (SPxRowId*)id, n, perm ) ; } void removeRows(int nums[], int n, int perm[] = 0) { SPxLP::removeRows( nums, n, perm ) ; } void removeRows(int perm[]) { SPxLP::removeRows( perm ) ; } void removeRowRange(int start, int end, int perm[] = 0) { SPxLP::removeRowRange( start, end, perm ) ; } void removeCols(LPSolver::ColId id[], int n, int perm[] = 0) { SPxLP::removeCols( (SPxColId*)&id, n, perm ) ; } void removeCols(int nums[], int n, int perm[] = 0) { SPxLP::removeCols( nums, n, perm ) ; } void removeCols(int perm[]) { SPxLP::removeCols( perm ) ; } void removeColRange(int start, int end, int perm[] = 0) { SPxLP::removeColRange( start, end, perm ) ; } void changeObj( LPSolver::ColId id, double newVal ) { changeObj( *(SPxColId*)&id, newVal ) ; } void changeLower( LPSolver::ColId id, double newLower ) { changeLower( *(SPxColId*)&id, newLower ) ; } void changeUpper( LPSolver::ColId id, double newUpper ) { changeUpper( *(SPxColId*)&id, newUpper ) ; } void changeBounds( LPSolver::ColId id, double newLower, double newUpper ) { changeBounds( *(SPxColId*)&id, newLower, newUpper ) ; } void changeLhs( LPSolver::RowId id, double newLhs ) { changeLhs( *(SPxRowId*)&id, newLhs ) ; } void changeRhs( LPSolver::RowId id, double newRhs ) { changeRhs( *(SPxRowId*)&id, newRhs ) ; } void changeRange( LPSolver::RowId id, double newLhs, double newRhs ) { changeRange( *(SPxRowId*)&id, newLhs, newRhs ) ; } void changeRow( LPSolver::RowId id, const LPRow& newRow ) { changeRow( *(SPxRowId*)&id, newRow ) ; } void changeCol( LPSolver::ColId id, const LPCol& newCol ) { changeCol( *(SPxColId*)&id, newCol ) ; } void changeElement( LPSolver::RowId rid, LPSolver::ColId cid, double val) { changeElement( *(SPxRowId*)&rid, *(SPxColId*)&cid, val ) ; } void changeSense( LPSolver::Sense sns) { changeSense( SPxSense(int(sns)) ) ; } void getRow(int i, LPRow& row) const { SPxLP::getRow( i, row) ; } void getRow( LPSolver::RowId id, LPRow& row) const { SPxLP::getRow( *(SPxRowId*)&id, row) ; } void getRows(int start, int end, LPRowSet& set) const { SPxLP::getRows( start, end, set) ; } const SVector& rowVector(int i) const { return SPxLP::rowVector(i) ; } const SVector& rowVector( LPSolver::RowId id ) const { return SPxLP::rowVector(*(SPxRowId*)&id) ; } const LPRowSet& rows() const { return *lprowset() ; } void getCol(int i, LPCol& column) const { SPxLP::getCol( i, column) ; } void getCol( LPSolver::ColId id, LPCol& column) const { SPxLP::getCol( *(SPxColId*)&id, column ) ; } void getCols(int start, int end, LPColSet& set) const { SPxLP::getCols( start, end, set) ; } const SVector& colVector(int i) const { return SPxLP::colVector(i) ; } const SVector& colVector( LPSolver::ColId id ) const { return SPxLP::colVector(*(SPxColId*)&id) ; } const LPColSet& cols() const { return *lpcolset() ; } double obj( int i ) const { return SPxLP::obj(i) ; } double obj( LPSolver::ColId id ) const { return SPxLP::obj( *(SPxColId*)&id ) ; } void getObj( Vector& obj ) const { SPxLP::getObj( obj ) ; } double lower( int i ) const { return SPxLP::lower(i) ; } double lower( LPSolver::ColId id ) const { return SPxLP::lower( *(SPxColId*)&id ) ; } void getLower( Vector& lw ) const { lw = SPxLP::lower( ) ; } const Vector& lower( ) const { return SPxLP::lower() ; } double upper( int i ) const { return SPxLP::upper(i) ; } double upper( LPSolver::ColId id ) const { return SPxLP::upper( *(SPxColId*)&id ) ; } void getUpper( Vector& upp ) const { upp = SPxLP::upper( ) ; } const Vector& upper( ) const { return SPxLP::upper() ; } double lhs( int i ) const { return SPxLP::lhs( i ) ; } double lhs( LPSolver::RowId id ) const { return SPxLP::lhs( *(SPxRowId*)&id ) ; } void getLhs( Vector& lhs ) const { lhs = SPxLP::lhs() ; } const Vector& lhs( ) const { return SPxLP::lhs() ; } double rhs( int i ) const { return SPxLP::rhs( i ) ; } double rhs( LPSolver::RowId id ) const { return SPxLP::rhs( *(SPxRowId*)&id ) ; } void getRhs( Vector& rhs ) const { rhs = SPxLP::rhs() ; } const Vector& rhs( ) const { return SPxLP::rhs() ; } LPSolver::Sense sense( ) const { return LPSolver::Sense(spxSense()) ; } int nofRows() const { return nRows() ; } int nofCols() const { return nCols() ; } int nofNZEs() const ; LPSolver::RowId rowId(int i) const { SPxRowId id = rId(i) ; return *(LPSolver::RowId*)&id ; } LPSolver::ColId colId(int i) const { SPxColId id = cId(i) ; return *(LPSolver::ColId*)&id ; } int number(LPSolver::RowId id) const { return number( *(SPxRowId*)&id ) ; } int number(LPSolver::ColId id) const { return number( *(SPxColId*)&id ) ; } int has(LPSolver::RowId id) const { return number(id) >= 0 ; } int has(LPSolver::ColId id) const { return number(id) >= 0 ; } SoPlex& operator=( const SoPlex& base ) ; SoPlex( const SoPlex& base ) ; SoPlex( Type type=LEAVE, SoPlex::Representation rep=SoPlex::ROW, SPxPricer* pric =0, SPxRatioTester* rt =0, SPxStarter* start=0, SPxSimplifier* simple=0 ) ; int isConsistent() const ; private: void testVecs() ; } ; # 65 "spxtcl.hh" 2 # 1 "slufactor.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 81 "slufactor.hh" 2 extern "C" { # 1 "clutypes.h" 1 typedef struct { int *orig ; int *perm ; } Perm ; typedef struct _dr_ { struct _dr_ *next ; struct _dr_ *prev ; int idx ; } Dring ; typedef struct { struct Row { Dring list ; Dring *elem ; int size ; int used ; double *val ; int *idx ; int *start ; int *len ; int *max ; } row ; struct Col { Dring list ; Dring *elem ; int size ; int used ; int *idx ; double *val ; int *start ; int *len ; int *max ; } col ; int lastColSing ; int lastRowSing ; } U ; typedef struct { int size ; double *val ; int *idx ; int startSize ; int firstUpdate ; int firstUnused ; int *start ; int *row ; int updateType ; double *rval ; int *ridx ; int *rbeg ; int *rorig ; int *rperm ; } L ; # 143 "clutypes.h" # 100 "slufactor.hh" 2 # 1 "clumembers.h" 1 typedef struct CLUFactor { int thedim ; int stat ; int nzCnt ; double initMaxabs ; double maxabs ; double rowMemMult ; double colMemMult ; double lMemMult ; Perm row ; Perm col ; L l ; double *diag ; U u ; double *work ; double *work2 ; } CLUFactor ; # 101 "slufactor.hh" 2 } class SLUFactor : public SLinSolver, private CLUFactor { public: enum UpdateType { ETA = 0, FOREST_TOMLIN } ; protected: void assign(const SLUFactor& old) ; void freeAll() ; void changeEta( int idx, SSVector& eta ) ; DVector vec ; SSVector ssvec ; int usetup ; UpdateType uptype ; SSVector eta ; SSVector forest ; double lastThreshold ; public: typedef SLinSolver::Status Status ; double minThreshold ; double epsilon ; int candidates ; double minStability ; UpdateType utype() { return uptype ; } void setUtype( UpdateType tp ) { uptype = tp ; } void clear() ; int dim() const { return thedim ; } int memory() const { return nzCnt + l.start[l.firstUnused]; } Status status() const { return (Status)stat ; } double stability() const ; Status load( const SVector* vec[], int dim ) ; void solve2right( Vector& x, Vector& b ) const ; void solve2right( Vector& x, SSVector& b ) const ; void solve2right( SSVector& x, Vector& b ) const ; void solve2right( SSVector& x, SSVector& b ) const ; void solveRight ( Vector& x, const Vector& b ) const ; void solveRight ( Vector& x, const SVector& b ) const ; void solveRight ( SSVector& x, const Vector& b ) const ; void solveRight ( SSVector& x, const SVector& b ) const ; void solveRight4update( SSVector& x, const SVector& b ) ; void solve2right4update( SSVector& x, Vector& two, const SVector& b, SSVector& rhs ) ; void solve2left( Vector& x, Vector& b ) const ; void solve2left( Vector& x, SSVector& b ) const ; void solve2left( SSVector& x, Vector& b ) const ; void solve2left( SSVector& x, SSVector& b ) const ; void solveLeft ( Vector& x, const Vector& b ) const ; void solveLeft ( Vector& x, const SVector& b ) const ; void solveLeft ( SSVector& x, const Vector& b ) const ; void solveLeft ( SSVector& x, const SVector& b ) const ; void solveLeft ( SSVector& x, Vector& two, const SVector& b, SSVector& rhs2 ) const ; Status change( int idx, const SVector& subst, const SSVector* eta=0 ) ; Vector& zeroVec() const { return ((SLUFactor*)this)->vec ; } void SLUFactor::dump() const ; int isConsistent() const ; SLUFactor& operator=(const SLUFactor& old) ; SLUFactor(const SLUFactor& old) : vec ( old.vec ) , ssvec ( old.ssvec ) , eta ( old.eta ) , forest( old.forest ) { assign(old) ; } SLUFactor() ; virtual ~SLUFactor() ; } ; # 66 "spxtcl.hh" 2 # 1 "spxdefaultpr.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 55 "spxdefaultpr.hh" 2 # 1 "spxpricer.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 64 "spxpricer.hh" 2 class SPxPricer { public: virtual void load( SoPlex* lp ) = 0 ; virtual void clear() = 0 ; virtual SoPlex* solver() const = 0 ; virtual double epsilon() const = 0 ; virtual void setEpsilon( double eps ) = 0 ; virtual void setType( SoPlex::Type ) = 0 ; virtual void setRep( SoPlex::Representation ) = 0 ; virtual int selectLeave() = 0 ; virtual void left4(int n, SoPlex::Id id) = 0 ; virtual SoPlex::Id selectEnter() = 0 ; virtual void entered4(SoPlex::Id id, int n) = 0 ; virtual void addedVecs ( int n ) = 0 ; virtual void addedCoVecs( int n ) = 0 ; virtual void removedVec(int i) = 0 ; virtual void removedVecs(const int perm[]) = 0 ; virtual void removedCoVec(int i) = 0 ; virtual void removedCoVecs(const int perm[]) = 0 ; virtual void changeObj( const Vector& newObj ) = 0 ; virtual void changeObj( int i, double newVal ) = 0 ; virtual void changeLower( const Vector& newLower ) = 0 ; virtual void changeLower( int i, double newLower ) = 0 ; virtual void changeUpper( const Vector& newUpper ) = 0 ; virtual void changeUpper( int i, double newUpper ) = 0 ; virtual void changeLhs( const Vector& newLhs ) = 0 ; virtual void changeLhs( int i, double newLhs ) = 0 ; virtual void changeRhs( const Vector& newRhs ) = 0 ; virtual void changeRhs( int i, double newRhs ) = 0 ; virtual void changeRow( int i, const LPRow& newRow ) = 0 ; virtual void changeCol( int i, const LPCol& newCol ) = 0 ; virtual void changeElement( int i, int j, double val ) = 0 ; virtual void changeSense( SoPlex::Sense sns ) = 0 ; virtual ~SPxPricer() {} } ; # 62 "spxdefaultpr.hh" 2 class SPxDefaultPR : public SPxPricer { protected: SoPlex* thesolver ; double theeps ; public: SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) { theeps = eps ; } void load( SoPlex* solver ) { thesolver = solver ; } void clear() { thesolver = 0 ; } void setType( SoPlex::Type tp ) { (void)tp ; } void setRep( SoPlex::Representation rep ) { (void)rep ; } int selectLeave(double& bst, int start, int incr) ; int selectLeave() ; void left4(int n, SoPlex::Id id) { (void)n ; (void)id ; } SoPlex::Id selectEnter(double& bst, int start1, int incr1, int start2, int incr2) ; SoPlex::Id selectEnter() ; void entered4(SoPlex::Id id, int n) { (void)n ; (void)id ; } void addedVecs ( int n ) { (void)n ; } void addedCoVecs( int n ) { (void)n ; } void removedVec(int i) { (void)i ; } void removedVecs(const int perm[]) { (void)perm ; } void removedCoVec(int i) { (void)i ; } void removedCoVecs(const int perm[]) { (void)perm ; } void changeObj( const Vector& newObj ) { (void)newObj ; } void changeObj( int i, double newVal ) { (void)newVal ; (void)i ; } void changeLower( const Vector& newLower ) { (void)newLower ; } void changeLower( int i, double newLower ) { (void)i ; (void)newLower ; } void changeUpper( const Vector& newUpper ) { (void)newUpper ; } void changeUpper( int i, double newUpper ) { (void)i ; (void)newUpper ; } void changeLhs( const Vector& newLhs ) { (void)newLhs ; } void changeLhs( int i, double newLhs ) { (void)i ; (void)newLhs ; } void changeRhs( const Vector& newRhs ) { (void)newRhs ; } void changeRhs( int i, double newRhs ) { (void)i ; (void)newRhs ; } void changeRow( int i, const LPRow& newRow ) { (void)i ; (void)newRow ; } void changeCol( int i, const LPCol& newCol ) { (void)i ; (void)newCol ; } void changeElement( int i, int j, double val ) { (void)i ; (void)j ; (void)val ; } void changeSense( SoPlex::Sense sns ) { (void)sns ; } } ; # 68 "spxtcl.hh" 2 # 1 "spxparmultpr.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 47 "spxparmultpr.hh" 2 struct SPxParMultPr_Tmp { SoPlex::Id id ; double test ; } ; class SPxParMultPR : public SPxPricer { protected: SoPlex* thesolver ; double theeps ; DataArray pricSet ; int multiParts ; int used ; int min ; int last ; int count ; public: static int partialSize ; SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) { theeps = eps ; } void load( SoPlex* solver ) ; void clear() { thesolver = 0 ; } void setType( SoPlex::Type tp ) ; void setRep( SoPlex::Representation rep ) { (void)rep ; } int selectLeave() ; void left4(int n, SoPlex::Id id) { (void)n ; (void)id ; } SPxLP::Id selectEnter() ; void entered4(SoPlex::Id id, int n) ; void addedVecs ( int n ) { (void)n ; } void addedCoVecs( int n ) { (void)n ; } void removedVec(int i) { (void)i ; } void removedVecs(const int perm[]) { (void)perm ; } void removedCoVec(int i) { (void)i ; } void removedCoVecs(const int perm[]) { (void)perm ; } void changeObj( const Vector& newObj ) { (void)newObj ; } void changeObj( int i, double newVal ) { (void)newVal ; (void)i ; } void changeLower( const Vector& newLower ) { (void)newLower ; } void changeLower( int i, double newLower ) { (void)i ; (void)newLower ; } void changeUpper( const Vector& newUpper ) { (void)newUpper ; } void changeUpper( int i, double newUpper ) { (void)i ; (void)newUpper ; } void changeLhs( const Vector& newLhs ) { (void)newLhs ; } void changeLhs( int i, double newLhs ) { (void)i ; (void)newLhs ; } void changeRhs( const Vector& newRhs ) { (void)newRhs ; } void changeRhs( int i, double newRhs ) { (void)i ; (void)newRhs ; } void changeRow( int i, const LPRow& newRow ) { (void)i ; (void)newRow ; } void changeCol( int i, const LPCol& newCol ) { (void)i ; (void)newCol ; } void changeElement( int i, int j, double val ) { (void)i ; (void)j ; (void)val ; } void changeSense( SoPlex::Sense sns ) { (void)sns ; } int isConsistent() const ; } ; # 69 "spxtcl.hh" 2 # 1 "spxhybridpr.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxhybridpr.hh" 2 # 1 "spxdevexpr.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxdevexpr.hh" 2 class SPxDevexPR : public SPxPricer { private: protected: double last ; DVector penalty ; DVector coPenalty ; SoPlex* thesolver ; double theeps ; public: SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) { theeps = eps ; } void load( SoPlex* base ) ; void clear() { thesolver = 0 ; } void setType( SoPlex::Type ) ; void setRep( SoPlex::Representation rep ) ; int selectLeave() ; protected: int selectLeave(double& best, int start=0, int incr=1) ; public: void left4(int n, SoPlex::Id id) ; protected: void left4(int n, SoPlex::Id id, int start, int incr) ; public: SoPlex::Id selectEnter() ; protected: SoPlex::Id selectEnter(double& best, int start1=0, int incr1=1, int start2=0, int incr2=1) ; public: void entered4(SoPlex::Id id, int n) ; protected: void entered4(SoPlex::Id id, int n, int start1, int incr1, int start2, int incr2) ; public: virtual void addedVecs ( int n ) ; virtual void addedCoVecs( int n ) ; virtual void removedVec(int i) ; virtual void removedCoVecs(const int perm[]) ; virtual void removedVecs(const int perm[]) ; virtual void removedCoVec(int i) ; void changeObj( const Vector& newObj ) { (void)newObj ; } void changeObj( int i, double newVal ) { (void)newVal ; (void)i ; } void changeLower( const Vector& newLower ) { (void)newLower ; } void changeLower( int i, double newLower ) { (void)i ; (void)newLower ; } void changeUpper( const Vector& newUpper ) { (void)newUpper ; } void changeUpper( int i, double newUpper ) { (void)i ; (void)newUpper ; } void changeLhs( const Vector& newLhs ) { (void)newLhs ; } void changeLhs( int i, double newLhs ) { (void)i ; (void)newLhs ; } void changeRhs( const Vector& newRhs ) { (void)newRhs ; } void changeRhs( int i, double newRhs ) { (void)i ; (void)newRhs ; } void changeRow( int i, const LPRow& newRow ) { (void)i ; (void)newRow ; } void changeCol( int i, const LPCol& newCol ) { (void)i ; (void)newCol ; } void changeElement( int i, int j, double val ) { (void)i ; (void)j ; (void)val ; } void changeSense( SoPlex::Sense sns ) { (void)sns ; } int isConsistent() const ; } ; # 29 "spxhybridpr.hh" 2 # 1 "spxsteeppr.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 68 "spxsteeppr.hh" 2 class SPxSteepPR : public SPxPricer { protected: DVector penalty ; DVector coPenalty ; DVector workVec ; SSVector workRhs ; int lastIdx ; SoPlex::Id lastId ; double pi_p ; double theeps ; SoPlex* thesolver ; int prefSetup ; DataArray coPref ; DataArray pref ; DataArray leavePref ; void setupPrefs( double mult, double tie, double cotie, double shift, double coshift, int rstart=0, int cstart=0, int rend=-1, int cend=-1 ) ; virtual void setupPrefs( SoPlex::Type ) ; public: enum Setup { EXACT, DEFAULT } ; Setup setup ; double accuracy ; SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) { theeps = eps ; } void load( SoPlex* base ) ; void clear() ; void setType( SoPlex::Type ) ; void setRep( SoPlex::Representation rep ) ; int selectLeave() ; protected: int selectLeave(double& best, int start=0, int incr=1) ; public: void left4(int n, SoPlex::Id id) ; void left4(int n, SoPlex::Id id, int start, int incr) ; SoPlex::Id selectEnter() ; protected: SoPlex::Id selectEnter(double& best, int start1=0, int incr1=1, int start2=0, int incr2=1) ; SoPlex::Id otherSelectEnter(double& best, int start1=0, int incr1=1, int start2=0, int incr2=1) ; public: void entered4(SoPlex::Id id, int n) ; void entered4(SoPlex::Id id, int n, int start1, int incr1, int start2, int incr2) ; virtual void addedVecs ( int n ) ; virtual void addedCoVecs( int n ) ; virtual void removedVec(int i) ; virtual void removedCoVecs(const int perm[]) ; virtual void removedVecs(const int perm[]) ; virtual void removedCoVec(int i) ; void changeObj( const Vector& newObj ) { (void)newObj ; } void changeObj( int i, double newVal ) { (void)newVal ; (void)i ; } void changeLower( const Vector& newLower ) { (void)newLower ; } void changeLower( int i, double newLower ) { (void)i ; (void)newLower ; } void changeUpper( const Vector& newUpper ) { (void)newUpper ; } void changeUpper( int i, double newUpper ) { (void)i ; (void)newUpper ; } void changeLhs( const Vector& newLhs ) { (void)newLhs ; } void changeLhs( int i, double newLhs ) { (void)i ; (void)newLhs ; } void changeRhs( const Vector& newRhs ) { (void)newRhs ; } void changeRhs( int i, double newRhs ) { (void)i ; (void)newRhs ; } void changeRow( int i, const LPRow& newRow ) { (void)i ; (void)newRow ; } void changeCol( int i, const LPCol& newCol ) { (void)i ; (void)newCol ; } void changeElement( int i, int j, double val ) { (void)i ; (void)j ; (void)val ; } void changeSense( SoPlex::Sense sns ) { (void)sns ; } int isConsistent() const ; SPxSteepPR() : workRhs ( 0, 1e-16 ) , setup ( DEFAULT ) , accuracy( 1e-4 ) {} } ; # 31 "spxhybridpr.hh" 2 class SPxHybridPR : public SPxPricer { SPxSteepPR steep ; SPxParMultPR parmult ; SPxDevexPR devex ; SPxPricer* thepricer ; SoPlex* thesolver ; double theeps ; public: SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) ; void load( SoPlex* solver ) ; void clear() ; void setType( SoPlex::Type tp ) ; void setRep( SoPlex::Representation rep ) ; int selectLeave() ; void left4(int n, SoPlex::Id id) ; SoPlex::Id selectEnter() ; void entered4(SoPlex::Id id, int n) ; void addedVecs ( int n ) ; void addedCoVecs( int n ) ; void removedVec(int i) ; void removedVecs(const int perm[]) ; void removedCoVec(int i) ; void removedCoVecs(const int perm[]) ; void changeObj( const Vector& newObj ) ; void changeObj( int i, double newVal ) ; void changeLower( const Vector& newLower ) ; void changeLower( int i, double newLower ) ; void changeUpper( const Vector& newUpper ) ; void changeUpper( int i, double newUpper ) ; void changeLhs( const Vector& newLhs ) ; void changeLhs( int i, double newLhs ) ; void changeRhs( const Vector& newRhs ) ; void changeRhs( int i, double newRhs ) ; void changeRow( int i, const LPRow& newRow ) ; void changeCol( int i, const LPCol& newCol ) ; void changeElement( int i, int j, double val ) ; void changeSense( SoPlex::Sense sns ) ; int isConsistent() const ; SPxHybridPR() ; } ; # 70 "spxtcl.hh" 2 # 1 "spxweightpr.hh" 1 class SPxWeightPR : public SPxPricer { protected: DVector cPenalty ; DVector rPenalty ; DVector leavePenalty ; const double* coPenalty ; const double* penalty ; double objlength ; virtual void computeCP( int start, int end ) ; virtual void computeRP( int start, int end ) ; SoPlex* thesolver ; double theeps ; public: SoPlex* solver() const { return thesolver ; } double epsilon() const { return theeps ; } void setEpsilon( double eps ) { theeps = eps ; } void load( SoPlex* base ) ; void clear() { thesolver = 0 ; } int selectLeave() ; SoPlex::Id selectEnter() ; virtual void addedVecs ( int n ) ; virtual void addedCoVecs( int n ) ; virtual void removedVec(int i) ; virtual void removedCoVecs(const int perm[]) ; virtual void removedVecs(const int perm[]) ; virtual void removedCoVec(int i) ; void setType( SoPlex::Type tp ) ; void setRep( SoPlex::Representation rep ) ; void left4(int n, SoPlex::Id id) { (void)n ; (void)id ; } void entered4(SoPlex::Id id, int n) { (void)n ; (void)id ; } void changeObj( const Vector& newObj ) { (void)newObj ; } void changeObj( int i, double newVal ) { (void)newVal ; (void)i ; } void changeLower( const Vector& newLower ) { (void)newLower ; } void changeLower( int i, double newLower ) { (void)i ; (void)newLower ; } void changeUpper( const Vector& newUpper ) { (void)newUpper ; } void changeUpper( int i, double newUpper ) { (void)i ; (void)newUpper ; } void changeLhs( const Vector& newLhs ) { (void)newLhs ; } void changeLhs( int i, double newLhs ) { (void)i ; (void)newLhs ; } void changeRhs( const Vector& newRhs ) { (void)newRhs ; } void changeRhs( int i, double newRhs ) { (void)i ; (void)newRhs ; } void changeRow( int i, const LPRow& newRow ) { (void)i ; (void)newRow ; } void changeCol( int i, const LPCol& newCol ) { (void)i ; (void)newCol ; } void changeElement( int i, int j, double val ) { (void)i ; (void)j ; (void)val ; } void changeSense( SoPlex::Sense sns ) { (void)sns ; } int isConsistent() const ; } ; # 73 "spxtcl.hh" 2 # 1 "spxdefaultrt.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 57 "spxdefaultrt.hh" 2 # 1 "spxratiotester.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 53 "spxratiotester.hh" 2 class SPxRatioTester { public: virtual void load( SoPlex* lp ) = 0 ; virtual void clear( ) = 0 ; virtual SoPlex* solver() const = 0 ; virtual int selectLeave(double& val) = 0 ; virtual SoPlex::Id selectEnter(double& val) = 0 ; virtual void setType( SoPlex::Type ) = 0 ; virtual ~SPxRatioTester() {} } ; # 64 "spxdefaultrt.hh" 2 class SPxDefaultRT : public SPxRatioTester { protected: SoPlex* thesolver ; int selectLeave(double& val, int start, int incr) ; SoPlex::Id selectEnter(double& val, int start1, int incr1, int start2, int incr2) ; public: SoPlex* solver() const { return thesolver ; } void load( SoPlex* solver ) { thesolver = solver ; } void clear( ) { thesolver = 0 ; } int selectLeave(double& val) ; SoPlex::Id selectEnter(double& val) ; void setType( SoPlex::Type ) {} } ; # 74 "spxtcl.hh" 2 # 1 "spxharrisrt.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 55 "spxharrisrt.hh" 2 class SPxHarrisRT : public SPxRatioTester { protected: SoPlex* thesolver ; int maxDelta ( double* max, double* val, int num, const int* idx, const double* upd, const double* vec, const double* low, const double* up, double delta, double epsilon, double infinity ) ; int minDelta ( double* max, double* val, int num, const int* idx, const double* upd, const double* vec, const double* low, const double* up, double delta, double epsilon, double infinity ) ; public: SoPlex* solver() const { return thesolver ; } void load( SoPlex* solver ) { thesolver = solver ; } void clear( ) { thesolver = 0 ; } int selectLeave(double& val) ; SoPlex::Id selectEnter(double& val) ; void setType( SoPlex::Type ) {} } ; # 75 "spxtcl.hh" 2 # 1 "spxfastrt.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 56 "spxfastrt.hh" 2 class SPxFastRT : public SPxRatioTester { protected: double minStab ; double epsilon ; double delta ; double delta0 ; void resetTols() ; void relax() ; void tighten() ; int maxDelta( double& val, double& abs, UpdateVector& upd, Vector& low, Vector& up, int start, int incr ) ; virtual int maxDelta( double& val, double& abs ) ; virtual SoPlex::Id maxDelta( int& nr, double& val, double& abs ) ; int minDelta( double& val, double& abs, UpdateVector& upd, Vector& low, Vector& up, int start, int incr ) ; virtual int minDelta( double& val, double& abs, UpdateVector& upd, Vector& low, Vector& up ) { return minDelta( val, abs, upd, low, up, 0, 1 ) ; } virtual int minDelta( double& val, double& abs ) ; virtual SoPlex::Id minDelta( int& nr, double& val, double& abs ) ; int maxSelect( double& val, double& stab, double& best, double& bestDelta, double max, const UpdateVector& upd, const Vector& low, const Vector& up, int start = 0, int incr = 1 ) ; virtual int maxSelect( double& val, double& stab, double& bestDelta, double max ) ; virtual SoPlex::Id maxSelect( int& nr, double& val, double& stab, double& bestDelta, double max ) ; int minSelect( double& val, double& stab, double& best, double& bestDelta, double max, const UpdateVector& upd, const Vector& low, const Vector& up, int start = 0, int incr = 1 ) ; virtual int minSelect( double& val, double& stab, double& bestDelta, double max ) ; virtual SoPlex::Id minSelect( int& nr, double& val, double& stab, double& bestDelta, double max ) ; int minReleave( double& sel, int leave, double maxabs ) ; int maxReleave( double& sel, int leave, double maxabs ) ; int minShortLeave( double& sel, int leave, double max, double abs ) ; int maxShortLeave( double& sel, int leave, double max, double abs ) ; virtual int minReenter( double& sel, double max, double maxabs, SoPlex::Id id, int nr ) ; virtual int maxReenter( double& sel, double max, double maxabs, SoPlex::Id id, int nr ) ; virtual int shortEnter( SoPlex::Id& enterId, int nr, double max, double maxabs ) ; SoPlex* thesolver ; public: SoPlex* solver() const { return thesolver ; } void load( SoPlex* solver ) ; void clear() ; int selectLeave(double& val) ; SoPlex::Id selectEnter(double& val) ; void setType( SoPlex::Type ) ; } ; # 76 "spxtcl.hh" 2 # 1 "spxweightst.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 51 "spxweightst.hh" 2 # 1 "spxstarter.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 59 "spxstarter.hh" 2 class SPxStarter { public: virtual void generate( SoPlex& base ) = 0 ; virtual ~SPxStarter() { } virtual int isConsistent() const ; }; # 58 "spxweightst.hh" 2 class SPxWeightST : public SPxStarter { DataArray forbidden ; DataArray* weight ; DataArray* coWeight ; void SPxWeightST::setPrimalStatus(SPxBasis::Desc&, const SoPlex&, const SoPlex::Id&) ; protected: DataArray rowWeight ; DataArray colWeight ; DataArray rowRight ; DataArray colUp ; virtual void setupWeights( SoPlex& base ) ; public: void generate( SoPlex& base ) ; SPxWeightST() {} int isConsistent() const ; } ; # 77 "spxtcl.hh" 2 # 1 "spxsumst.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 40 "spxsumst.hh" 2 # 1 "spxvectorst.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 46 "spxvectorst.hh" 2 class SPxVectorST : public SPxWeightST { const Vector* prim ; const Vector* dvec ; protected: void setupWeights( SoPlex& base ) ; public: void primal( const Vector& v ) { prim = &v ; dvec = 0 ; } void dual( const Vector& v ) { prim = 0 ; dvec = &v ; } SPxVectorST() {} } ; # 47 "spxsumst.hh" 2 class SPxSumST : public SPxVectorST { private: protected: void setupWeights( SoPlex& base ) ; public: SPxSumST() {} } ; # 78 "spxtcl.hh" 2 # 1 "spxscale.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 47 "spxscale.hh" 2 # 1 "spxsimplifier.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 53 "spxsimplifier.hh" 2 class SPxSimplifier { private: protected: public: virtual void load( SPxLP* ) = 0; virtual void unload( ) = 0; virtual SPxLP* loadedLP() const = 0; virtual int simplify( ) = 0; virtual void unsimplify( ) = 0; virtual double value( double x ) { return x ; } int isConsistent() const { return 1 ; } } ; # 54 "spxscale.hh" 2 class SPxScale : public SPxSimplifier { SPxLP* lp ; DataArray colscale ; DataArray rowscale ; public: virtual void load( SPxLP* ) ; virtual void unload( ) ; virtual SPxLP* loadedLP() const { return lp ; } virtual int simplify( ) ; virtual void unsimplify( ) ; int isConsistent() const { return colscale.isConsistent() && rowscale.isConsistent() ; } SPxScale() {} } ; # 80 "spxtcl.hh" 2 # 1 "spxrem1sm.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxrem1sm.hh" 2 class SPxRem1SM : public SPxSimplifier { private: SPxLP* lp ; double delta ; protected: public: void load( SPxLP* ) ; void unload( ) ; SPxLP* loadedLP() const { return lp ; } int simplify( ) ; void unsimplify( ) ; double value( double x ) { return x - lp->spxSense()*delta ; } } ; # 81 "spxtcl.hh" 2 # 1 "spxredundantsm.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxredundantsm.hh" 2 class SPxRedundantSM : public SPxSimplifier { private: double delta ; SPxLP* lp ; void dummy( const SVector&, double&, double&, int&, int& ) const ; protected: public: void load( SPxLP* ) ; void unload( ) ; SPxLP* loadedLP() const { return lp ; } int simplify( ) ; void unsimplify( ) ; double value( double x ) { return x + lp->spxSense()*delta ; } } ; # 82 "spxtcl.hh" 2 # 1 "spxaggregatesm.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxaggregatesm.hh" 2 class SPxAggregateSM : public SPxSimplifier { private: double delta ; SPxLP* lp ; protected: int eliminate( const SVector& row, double b ) ; public: double maxFill ; double stability ; void load( SPxLP* ) ; void unload( ) ; SPxLP* loadedLP() const { return lp ; } int simplify( ) ; void unsimplify( ) ; double value( double x ) { return x + lp->spxSense()*delta ; } } ; # 83 "spxtcl.hh" 2 # 1 "spxgeneralsm.hh" 1 # 1 "/usr/local/include/assert.h" 1 3 # 19 "/usr/local/include/assert.h" 3 extern "C" { extern void __eprintf (const char *, const char *, unsigned, const char *); } # 50 "/usr/local/include/assert.h" 3 # 21 "spxgeneralsm.hh" 2 class SPxGeneralSM : public SPxSimplifier { private: SPxRem1SM rem1 ; SPxRedundantSM redu ; SPxAggregateSM aggr ; SPxScale scale ; SPxLP* lp ; public: void load( SPxLP* ) ; void unload( ) ; SPxLP* loadedLP() const ; int simplify( ) ; void unsimplify( ) ; double value( double x ) ; SPxGeneralSM() {} } ; # 84 "spxtcl.hh" 2 # 109 "spxtcl.hh" extern "C" { void initSPxTCL( Tcl_Interp* interp ) ; } class SPxTCL : public SoPlex { public: SLUFactor slu ; static int cntrC ; private: int terminate() { if( cntrC ) return 1 ; if( maxTime > 0 && time() > maxTime ) return 1 ; return SoPlex::terminate() ; } void factorize( ) { SoPlex::factorize( ) ; if( verbose ) { cout.precision(16) ; cout << (type() == LEAVE ? "L " : "E ") ; cout << basis().iteration() << ":\t" ; cout << value() ; cout << "\t(" << shift() << ")\n" << flush; } } public: int& minDim ; double& nzFac ; int& mxUpd ; int verbose ; double maxTime ; Timer timer ; SPxScale scale ; SPxRem1SM rem1 ; SPxAggregateSM aggr ; SPxRedundantSM redu ; SPxGeneralSM general ; SPxWeightST wgtST ; SPxVectorST vecST ; SPxSumST sumST ; SPxDefaultPR defPR ; SPxParMultPR pmlPR ; SPxHybridPR hbrPR ; SPxWeightPR wgtPR ; SPxSteepPR stpPR ; SPxDevexPR dvxPR ; SPxDefaultRT defRT ; SPxHarrisRT stbRT ; SPxFastRT fstRT ; NameSet rowNames ; NameSet colNames ; int leaveCount() { return SoPlex::leaveCount ; } int enterCount() { return SoPlex::enterCount ; } double time() { return timer.userTime() ; } LPSolver::Status solve() { timer.reset() ; timer.start() ; LPSolver::Status stat = SoPlex::solve() ; timer.stop() ; return stat ; } SPxTCL() ; } ; # 58 "spxtcl.cc" 2 static SPxTCL spx ; extern "C" { extern double verySparseFactor4right ; extern double verySparseFactor4left ; extern double verySparseFactor ; } extern double cacheProductFactor ; extern double shortProductFactor ; extern double hybridFactor ; extern int rowScale ; static int verySparseRight( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) verySparseFactor4right = x ; } char buf[32] ; sprintf( buf, "%g", verySparseFactor4right ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int verySparseLeft( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) verySparseFactor4left = x ; } char buf[32] ; sprintf( buf, "%g", verySparseFactor4left ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int verySparse( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) verySparseFactor = x ; } char buf[32] ; sprintf( buf, "%g", verySparseFactor ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int hybrid_factor( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) hybridFactor = x ; } char buf[32] ; sprintf( buf, "%g", hybridFactor ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int rowscale( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { int x = atoi( argv[1] ) ; if( x >= 0 ) rowScale = x ; } char buf[32] ; sprintf( buf, "%d", rowScale ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int shortProduct( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) shortProductFactor = x ; } char buf[32] ; sprintf( buf, "%g", shortProductFactor ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int cacheProduct( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; if( x >= 0 ) cacheProductFactor = x ; } char buf[32] ; sprintf( buf, "%g", cacheProductFactor ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int setPartialFill( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { int x = atoi( argv[1] ) ; if( x >= 0 ) spx.pmlPR.partialSize = x ; } char buf[32] ; sprintf( buf, "%d", spx.pmlPR.partialSize ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int accuracy( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double accuracy = atof( argv[1] ) ; if( accuracy >= 0 ) spx.stpPR.accuracy = accuracy ; } char buf[32] ; sprintf( buf, "%.10e", spx.stpPR.accuracy ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int vectorlen( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { int x = atoi( argv[1] ) ; if( x > 0 ) spx.minDim = x ; } char buf[32] ; sprintf( buf, "%d", spx.minDim ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static void setupParameters( Tcl_Interp* interp ) { Tcl_CreateCommand( interp, "accuracy", accuracy, 0, 0 ) ; Tcl_CreateCommand( interp, "vectorlen", vectorlen, 0, 0 ) ; Tcl_CreateCommand( interp, "rightverysparsefactor", verySparseRight, 0, 0 ) ; Tcl_CreateCommand( interp, "leftverysparsefactor", verySparseLeft, 0, 0 ) ; Tcl_CreateCommand( interp, "verysparsefactor", verySparse, 0, 0 ) ; Tcl_CreateCommand( interp, "shortproductfactor", shortProduct, 0, 0 ) ; Tcl_CreateCommand( interp, "cacheproductfactor", cacheProduct, 0, 0 ) ; Tcl_CreateCommand( interp, "partialfill", setPartialFill, 0, 0 ) ; Tcl_CreateCommand( interp, "hybridfactor", hybrid_factor, 0, 0 ) ; Tcl_CreateCommand( interp, "rowscale", rowscale, 0, 0 ) ; } static int dump( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 1 ) { cout << spx ; Tcl_AppendResult( tcl, "dumped LP", 0 ) ; } else if( argc == 2 ) { ofstream file( argv[1] ) ; if( file ) { file.precision(16) ; file << spx ; Tcl_AppendResult( tcl, "dumped file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "cannot open file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: dump ", 0 ) ; return 0 ; } static int basis( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc > 2 ) { Tcl_AppendResult( tcl, "SYNTAX: basis ", 0 ) ; return 0 ; } ostream* out ; int i, n ; if( argc == 1 ) out = &cout ; else { out = new ofstream( argv[1] ) ; if( !out ) { Tcl_AppendResult( tcl, "cannot open file `", argv[1], "'", 0 ) ; return 0 ; } } for( i = n = 0 ; i < spx.dim() ; ++i ) n += spx.basis().baseVec(i).size() ; *out << "NAME soplexBasis\n" ; *out << "Dimension " << spx.dim() << " Nonzeros " << n << endl ; *out << " Column Row Entry\n" ; out->precision(16) ; for( i = 0 ; i < spx.dim() ; ++i ) { const SVector& vec = spx.basis().baseVec(i) ; for( int j = 0 ; j < vec.size() ; ++j ) *out << '\t' << i+1 << '\t' << vec.index(j)+1 << '\t' << vec.value(j) << endl ; } *out << "ENDATA\n" ; if( out != &cout ) delete out ; return 0 ; } static int load( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { ifstream file( argv[1] ) ; if( file ) { spx.read( file, &spx.rowNames, &spx.colNames ) ; Tcl_AppendResult( tcl, "loaded file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "cannot load file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: load ", 0 ) ; return 0 ; } static int loadBasis( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { ifstream file( argv[1] ) ; if( file ) { spx.readBasis( file, spx.rowNames, spx.colNames ) ; Tcl_AppendResult( tcl, "loaded basis file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "cannot load basis file `", argv[1], "'", 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: load ", 0 ) ; return 0 ; } static int reload( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 1 ) spx.reLoad() ; else Tcl_AppendResult( tcl, "SYNTAX: reload", 0 ) ; return 0 ; } static int primal( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc <= 2 ) { if( spx.basis().status() >= SPxBasis::REGULAR ) { int i ; char buf[32] ; DVector p( spx.nCols() ) ; ofstream *out ; if( argc > 1 ) { out = new ofstream( argv[1] ) ; out->precision(10) ; } spx.getPrimal( p ) ; for( i = 0 ; i < p.dim() ; ++i) { if( p[i] < -spx.epsilon() || p[i] > spx.epsilon() ) { if( argc > 1 ) *out << spx.colNames[i] << '\t' << p[i] << endl ; else { sprintf( buf, "%10s %.10g", spx.colNames[i], p[i] ) ; Tcl_AppendElement( tcl, buf ) ; } } } } } else Tcl_AppendResult( tcl, "SYNTAX: primal [file]", 0 ) ; return 0 ; } static int dual( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc <= 2 ) { if( spx.basis().status() >= SPxBasis::REGULAR ) { int i ; char buf[32] ; DVector p( spx.nRows() ) ; ofstream *out ; if( argc > 1 ) { out = new ofstream( argv[1] ) ; out->precision(10) ; } spx.getDual( p ) ; for( i = 0 ; i < p.dim() ; ++i) { if( p[i] < -spx.epsilon() || p[i] > spx.epsilon() ) { if( argc > 1 ) *out << spx.rowNames[i] << '\t' << p[i] << endl ; else { sprintf( buf, "%10s %.10g", spx.rowNames[i], p[i] ) ; Tcl_AppendElement( tcl, buf ) ; } } } } } else Tcl_AppendResult( tcl, "SYNTAX: dual [file]", 0 ) ; return 0 ; } static int solve( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc <= 1 ) { char buf[32] ; SPxTCL::cntrC = 0 ; spx.solve() ; switch( spx.basis().status() ) { case SPxBasis::SINGULAR: Tcl_AppendElement( tcl, "SINGULAR" ) ; break ; case SPxBasis::UNBOUNDED: Tcl_AppendElement( tcl, "UNBOUNDED" ) ; break ; case SPxBasis::INFEASIBLE: Tcl_AppendElement( tcl, "INFEASIBLE" ) ; break ; case SPxBasis::OPTIMAL: sprintf( buf, "%.16e", spx.value() ) ; Tcl_AppendElement( tcl, buf ) ; break ; default: Tcl_AppendElement( tcl, "ERROR" ) ; break ; } sprintf( buf, "%.2f", spx.time() ) ; Tcl_AppendElement( tcl, buf ) ; sprintf( buf, "%d", spx.basis().iteration() ) ; Tcl_AppendElement( tcl, buf ) ; sprintf( buf, "%d", spx.leaveCount() ) ; Tcl_AppendElement( tcl, buf ) ; sprintf( buf, "%d", spx.enterCount() ) ; Tcl_AppendElement( tcl, buf ) ; } else Tcl_AppendResult( tcl, "SYNTAX: solve [enter|leave]\n", "RESULT: value time iterations\n", 0 ) ; return 0 ; } static int starter( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc >= 2 ) { if( strcmp( argv[1], "default" ) == 0 ) { spx.load( (SPxStarter*)0 ) ; } else if( strcmp( argv[1], "sum" ) == 0 ) spx.load( &spx.sumST ) ; else if( strcmp( argv[1], "weight" ) == 0 ) spx.load( &spx.wgtST ) ; else if( strcmp( argv[1], "vector" ) == 0 ) { if( argc > 2 ) { static DVector vec ; spx.load( &spx.vecST ) ; ifstream vecFile( argv[2] ) ; vecFile >> vec ; spx.vecST.primal( vec ) ; } } } if( spx.starter() == &spx.sumST ) Tcl_AppendResult( tcl, "sum", 0 ) ; else if( spx.starter() == &spx.wgtST ) Tcl_AppendResult( tcl, "weight", 0 ) ; else if( spx.starter() == &spx.vecST ) Tcl_AppendResult( tcl, "vector", 0 ) ; else Tcl_AppendResult( tcl, "default", 0 ) ; return 0 ; } static int simplifier( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "none" ) == 0 ) { spx.load( (SPxSimplifier*)0 ) ; } else if( strcmp( argv[1], "scale" ) == 0 ) spx.load( &spx.scale ) ; else if( strcmp( argv[1], "rem1" ) == 0 ) spx.load( &spx.rem1 ) ; else if( strcmp( argv[1], "aggregate" ) == 0 ) spx.load( &spx.aggr ) ; else if( strcmp( argv[1], "redundant" ) == 0 ) spx.load( &spx.redu ) ; else if( strcmp( argv[1], "general" ) == 0 ) spx.load( &spx.general ) ; } if( spx.simplifier() == &spx.scale ) Tcl_AppendResult( tcl, "scale", 0 ) ; else if( spx.simplifier() == &spx.general ) Tcl_AppendResult( tcl, "general", 0 ) ; else if( spx.simplifier() == &spx.aggr ) Tcl_AppendResult( tcl, "aggregate", 0 ) ; else if( spx.simplifier() == &spx.redu ) Tcl_AppendResult( tcl, "redundant", 0 ) ; else if( spx.simplifier() == &spx.rem1 ) Tcl_AppendResult( tcl, "rem1", 0 ) ; else Tcl_AppendResult( tcl, "none", 0 ) ; return 0 ; } static int pricer( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "default" ) == 0 ) { spx.load( &spx.defPR ) ; spx.defPR.load( &spx ) ; } else if( strcmp( argv[1], "parmult" ) == 0 ) { spx.load( &spx.pmlPR ) ; spx.pmlPR.load( &spx ) ; } else if( strcmp( argv[1], "devex" ) == 0 ) { spx.load( &spx.dvxPR ) ; spx.dvxPR.load( &spx ) ; } else if( strcmp( argv[1], "hybrid" ) == 0 ) { spx.load( &spx.hbrPR ) ; spx.dvxPR.load( &spx ) ; } else if( strcmp( argv[1], "steep" ) == 0 ) { spx.load( &spx.stpPR ) ; spx.stpPR.load( &spx ) ; } else if( strcmp( argv[1], "weight" ) == 0 ) { spx.load( &spx.wgtPR ) ; spx.wgtPR.load( &spx ) ; } } if( spx.pricer() == &spx.defPR ) Tcl_AppendResult( tcl, "default", 0 ) ; else if( spx.pricer() == &spx.pmlPR ) Tcl_AppendResult( tcl, "parmult", 0 ) ; else if( spx.pricer() == &spx.wgtPR ) Tcl_AppendResult( tcl, "weight", 0 ) ; else if( spx.pricer() == &spx.stpPR ) Tcl_AppendResult( tcl, "steep", 0 ) ; else if( spx.pricer() == &spx.dvxPR ) Tcl_AppendResult( tcl, "devex", 0 ) ; else if( spx.pricer() == &spx.hbrPR ) Tcl_AppendResult( tcl, "hybrid", 0 ) ; return 0 ; } static int ratio( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "default" ) == 0 ) spx.load( &spx.defRT ) ; else if( strcmp( argv[1], "harris" ) == 0 ) spx.load( &spx.stbRT ) ; else if( strcmp( argv[1], "fast" ) == 0 ) spx.load( &spx.fstRT ) ; } if( spx.ratiotester() == &spx.defRT ) Tcl_AppendResult( tcl, "default", 0 ) ; else if( spx.ratiotester() == &spx.stbRT ) Tcl_AppendResult( tcl, "harris", 0 ) ; else if( spx.ratiotester() == &spx.fstRT ) Tcl_AppendResult( tcl, "fast", 0 ) ; return 0 ; } static int list( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "pricer" ) == 0 ) { Tcl_AppendElement( tcl, "default" ) ; Tcl_AppendElement( tcl, "sparse" ) ; Tcl_AppendElement( tcl, "steep" ) ; Tcl_AppendElement( tcl, "devex" ) ; Tcl_AppendElement( tcl, "weight" ) ; Tcl_AppendElement( tcl, "hybrid" ) ; } else if( strcmp( argv[1], "ratiotester" ) == 0 ) { Tcl_AppendElement( tcl, "default" ) ; Tcl_AppendElement( tcl, "harris" ) ; Tcl_AppendElement( tcl, "fast" ) ; } else if( strcmp( argv[1], "ratio" ) == 0 ) { Tcl_AppendElement( tcl, "default" ) ; Tcl_AppendElement( tcl, "harris" ) ; Tcl_AppendElement( tcl, "fast" ) ; } else if( strcmp( argv[1], "starter" ) == 0 ) { Tcl_AppendElement( tcl, "default" ) ; Tcl_AppendElement( tcl, "weight" ) ; Tcl_AppendElement( tcl, "vector " ) ; Tcl_AppendElement( tcl, "sum" ) ; } else if( strcmp( argv[1], "simplifier" ) == 0 ) { Tcl_AppendElement( tcl, "none" ) ; Tcl_AppendElement( tcl, "general" ) ; Tcl_AppendElement( tcl, "rem1" ) ; Tcl_AppendElement( tcl, "redundant" ) ; Tcl_AppendElement( tcl, "aggregate" ) ; Tcl_AppendElement( tcl, "scale" ) ; } } else if( argc == 1 ) { Tcl_AppendElement( tcl, "pricer" ) ; Tcl_AppendElement( tcl, "ratio" ) ; Tcl_AppendElement( tcl, "starter" ) ; Tcl_AppendElement( tcl, "simplifier" ) ; } else Tcl_AppendResult( tcl, "SYNTAX: list [pricer|ratio|starter|simplifier]\n", 0 ) ; return 0 ; } static int update( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "eta" ) == 0 ) spx.slu.setUtype( SLUFactor::ETA ) ; else if( strcmp( argv[1], "forest" ) == 0 ) spx.slu.setUtype( SLUFactor::FOREST_TOMLIN ) ; } if( spx.slu.utype() == SLUFactor::ETA ) Tcl_AppendResult( tcl, "eta", 0 ) ; else if( spx.slu.utype() == SLUFactor::FOREST_TOMLIN ) Tcl_AppendResult( tcl, "forest", 0 ) ; return 0 ; } static int rep( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "row" ) == 0 ) spx.setRep( SoPlex::ROW ) ; else if( strcmp( argv[1], "column" ) == 0 ) spx.setRep( SoPlex::COLUMN ) ; } if( spx.rep() == SoPlex::ROW ) Tcl_AppendResult( tcl, "row", 0 ) ; else if( spx.rep() == SoPlex::COLUMN ) Tcl_AppendResult( tcl, "column", 0 ) ; return 0 ; } static int type( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "enter" ) == 0 ) spx.setType( SoPlex::ENTER ) ; else if( strcmp( argv[1], "leave" ) == 0 ) spx.setType( SoPlex::LEAVE ) ; } if( spx.type() == SoPlex::ENTER ) Tcl_AppendResult( tcl, "enter", 0 ) ; else if( spx.type() == SoPlex::LEAVE ) Tcl_AppendResult( tcl, "leave", 0 ) ; return 0 ; } static int delta( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double delta = atof( argv[1] ) ; if( delta > spx.epsilon() ) spx.setDelta( delta ) ; } char buf[32] ; sprintf( buf, "%.10e", spx.delta() ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int eps( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double eps = atof( argv[1] ) ; if( eps > 0 && eps < spx.delta() ) spx.setEpsilon( eps ) ; } char buf[32] ; sprintf( buf, "%.10e", spx.epsilon() ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int nonzerofactor( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; spx.nzFac = x ; } char buf[32] ; sprintf( buf, "%g", spx.nzFac ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int maxtime( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { double x = atof( argv[1] ) ; spx.maxTime = x ; } char buf[32] ; sprintf( buf, "%f", spx.maxTime ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int maxcycle( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { int x = atoi( argv[1] ) ; if( x > 0 ) spx.maxCycle = x ; } char buf[32] ; sprintf( buf, "%d", spx.maxCycle ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int maxupdate( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { int x = atoi( argv[1] ) ; if( x > 0 ) spx.mxUpd = x ; } char buf[32] ; sprintf( buf, "%d", spx.mxUpd ) ; Tcl_AppendResult( tcl, buf, 0 ) ; return 0 ; } static int verbose( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "on" ) == 0 ) spx.verbose = 1 ; else if( strcmp( argv[1], "off" ) == 0 ) spx.verbose = 0 ; } if( spx.verbose ) Tcl_AppendResult( tcl, "on", 0 ) ; else Tcl_AppendResult( tcl, "off", 0 ) ; return 0 ; } static int shift( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 1 ) { char buf[32] ; sprintf( buf, "%.10e", spx.shift() ) ; Tcl_AppendResult( tcl, buf, 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: shift", 0 ) ; return 0 ; } static int rows( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 1 ) { char buf[32] ; sprintf( buf, "%d", spx.nRows() ) ; Tcl_AppendResult( tcl, buf, 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: rows", 0 ) ; return 0 ; } static int columns( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 1 ) { char buf[32] ; sprintf( buf, "%d", spx.nCols() ) ; Tcl_AppendResult( tcl, buf, 0 ) ; } else Tcl_AppendResult( tcl, "SYNTAX: columns", 0 ) ; return 0 ; } SPxTCL::SPxTCL() : SoPlex ( LEAVE, COLUMN ) , nzFac ( nonzeroFactor ) , mxUpd ( maxUpdates ) , minDim ( coVecDim ) , verbose( 1 ) , maxTime( -1 ) { load( &slu ) ; load( &fstRT ) ; load( &wgtST ) ; load( &scale ) ; stpPR.load( this ) ; load( &stpPR ) ; } int SPxTCL::cntrC = 0 ; static void sigFunc(int i) { if( SPxTCL::cntrC ) exit( -1 ) ; SPxTCL::cntrC = 1 ; signal( 2 , sigFunc ) ; } static int help( ClientData cd, Tcl_Interp* tcl, int argc, char** argv ) { if( argc == 2 ) { if( strcmp( argv[1], "pricer" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: pricer [name]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] used pricing method.\n", 0 ) ; Tcl_AppendResult( tcl, " Use 'list pricer' for a list of available pricing methods.\n", 0 ) ; } else if( strcmp( argv[1], "help" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: help [command]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display usage information about non-TCL commands.\n", 0 ) ; } else if( strcmp( argv[1], "dump" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: dump [file]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Output currently loaded LP on the screen of to the file.\n", 0 ) ; } else if( strcmp( argv[1], "load" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: load \n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Load LP form file in LP or MPS format.\n", 0 ) ; } else if( strcmp( argv[1], "reload" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: reload\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Reset solver as if current LP was just loaded.\n", 0 ) ; Tcl_AppendResult( tcl, " This will discard any information from a privious 'solve'.\n", 0 ) ; } else if( strcmp( argv[1], "solve" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: solve\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Solves the loaded LP using the currently setup\n", 0 ) ; Tcl_AppendResult( tcl, " 'pricer', 'ratiotester', 'starter'\n", 0 ) ; Tcl_AppendResult( tcl, " 'representation' and 'type'.\n", 0 ) ; Tcl_AppendResult( tcl, " If successfull 'solve' returns the\n", 0 ) ; Tcl_AppendResult( tcl, " objective value, solution time, total number of iterations,\n", 0 ) ; Tcl_AppendResult( tcl, " number of leave iterations and number of enter iterations.\n", 0 ) ; Tcl_AppendResult( tcl, " Otherwise the failiour reason is displayed.\n", 0 ) ; } else if( strcmp( argv[1], "primal" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: primal\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display the primal solution vector for the current basis.\n", 0 ) ; Tcl_AppendResult( tcl, " Unless the loaded LP has sucessfully been solved,\n", 0 ) ; Tcl_AppendResult( tcl, " this is not the optimal solution.\n", 0 ) ; } else if( strcmp( argv[1], "dual" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: dual\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display the dual variables for the current basis.\n", 0 ) ; Tcl_AppendResult( tcl, " Unless the loaded LP has sucessfully been solved,\n", 0 ) ; Tcl_AppendResult( tcl, " this is not the optimal solution.\n", 0 ) ; } else if( strcmp( argv[1], "ratiotester" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: ratiotester [name]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " \n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] used ratio test method.\n", 0 ) ; Tcl_AppendResult( tcl, " Use 'list ratiotester' for a list of available methods.\n", 0 ) ; } else if( strcmp( argv[1], "simplifier" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: simplifier [name]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] LP simplification method to be applied prior to solving the LP.\n", 0 ) ; Tcl_AppendResult( tcl, " Use 'list simplifier' for a list of available methods.\n", 0 ) ; } else if( strcmp( argv[1], "starter" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: starter [name]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] start basis generation method.\n", 0 ) ; Tcl_AppendResult( tcl, " Use 'list starter' for a list of available methods.\n", 0 ) ; } else if( strcmp( argv[1], "list" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: list \n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " List available methods for\n", 0 ) ; Tcl_AppendResult( tcl, " 'pricer', 'ratiotester', 'starter' and 'simplifier'.\n", 0 ) ; } else if( strcmp( argv[1], "type" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: type [type]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the algorithm type\n", 0 ) ; Tcl_AppendResult( tcl, " to start with the next time 'solve' is called.\n", 0 ) ; Tcl_AppendResult( tcl, " Allowed types are:\n", 0 ) ; Tcl_AppendResult( tcl, " - 'enter' (primal in row-, dual in column representation)\n", 0 ) ; Tcl_AppendResult( tcl, " - 'leave' (dual in row-, primal in column representation)\n", 0 ) ; } else if( strcmp( argv[1], "update" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: update [type]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the update type\n", 0 ) ; Tcl_AppendResult( tcl, " for the LU factorization of the basis matrix.\n", 0 ) ; Tcl_AppendResult( tcl, " Available types are:\n", 0 ) ; Tcl_AppendResult( tcl, " - 'eta' (postmultiplication with update matrices)\n", 0 ) ; Tcl_AppendResult( tcl, " - 'forest' (forest-tomlin updates)\n", 0 ) ; Tcl_AppendResult( tcl, " \n", 0 ) ; } else if( strcmp( argv[1], "represenation" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: represenation [type]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] representation of the basis matrix.\n", 0 ) ; Tcl_AppendResult( tcl, " Available types are:\n", 0 ) ; Tcl_AppendResult( tcl, " - 'row' (basis of row vectors)\n", 0 ) ; Tcl_AppendResult( tcl, " - 'column' (standard column basis) \n", 0 ) ; Tcl_AppendResult( tcl, " hint: select representation as to minimize the dimension of the basis matrix", 0 ) ; } else if( strcmp( argv[1], "delta" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: delta [value]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] tollerance parameter for the optimal solution.\n", 0 ) ; Tcl_AppendResult( tcl, " Infeasisbility and nonoptimality up to delta are accepted.\n", 0 ) ; Tcl_AppendResult( tcl, " Allways select epsilon << delta.\n", 0 ) ; } else if( strcmp( argv[1], "epsilon" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: epsilon [value]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] general accuracy parameter.\n", 0 ) ; Tcl_AppendResult( tcl, " Absolute values less than epsilon are treated as zero.\n", 0 ) ; Tcl_AppendResult( tcl, " Allways select epsilon << delta.\n", 0 ) ; } else if( strcmp( argv[1], "nonzerofactor" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: nonzerofactor [value]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the parameter controlling\n", 0 ) ; Tcl_AppendResult( tcl, " the refactorization of the basis matrix.\n", 0 ) ; Tcl_AppendResult( tcl, " The matrix is refactorized as the fill due to updates\n", 0 ) ; Tcl_AppendResult( tcl, " exceeds value * fill of the fresh factoriation.\n", 0 ) ; Tcl_AppendResult( tcl, " Hence, smaller values yield more frequent refactorizations.\n", 0 ) ; } else if( strcmp( argv[1], "maxtime" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: maxcycle [time]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the maximum time for solve\n", 0 ) ; Tcl_AppendResult( tcl, " Negative values indicate no restriction\n", 0 ) ; } else if( strcmp( argv[1], "maxcycle" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: maxcycle [num]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the number of degenerate simplex pivots\n", 0 ) ; Tcl_AppendResult( tcl, " before taking actions against cycling\n", 0 ) ; } else if( strcmp( argv[1], "maxupdates" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: maxupdates [num]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] the maximum number of updates to the\n", 0 ) ; Tcl_AppendResult( tcl, " basis matrix before refactorizing it.\n", 0 ) ; } else if( strcmp( argv[1], "rows" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: rows\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display number of constraints for the\n", 0 ) ; Tcl_AppendResult( tcl, " currently loaded LP.\n", 0 ) ; } else if( strcmp( argv[1], "columns" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: columns\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display number of variables for the\n", 0 ) ; Tcl_AppendResult( tcl, " currently loaded LP.\n", 0 ) ; } else if( strcmp( argv[1], "verbose" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: verbose [on/off]\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display [or set] verbosity for next 'solve'.\n", 0 ) ; Tcl_AppendResult( tcl, " If 'on', each time the basis matrix is refactorized\n", 0 ) ; Tcl_AppendResult( tcl, " a line is output displaying:\n", 0 ) ; Tcl_AppendResult( tcl, " - current algorithm type (L/E)\n", 0 ) ; Tcl_AppendResult( tcl, " - iteration number\n", 0 ) ; Tcl_AppendResult( tcl, " - current objective value\n", 0 ) ; Tcl_AppendResult( tcl, " - current shift value\n", 0 ) ; } else if( strcmp( argv[1], "shift" ) == 0 ) { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "SYNTAX: shift\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " Display current bound shifts.\n", 0 ) ; } } else { Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, "available SPxTCL commands:\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " help [command] - help on commands\n", 0 ) ; Tcl_AppendResult( tcl, " dump [file] - dump LP\n", 0 ) ; Tcl_AppendResult( tcl, " load - load LP from file\n", 0 ) ; Tcl_AppendResult( tcl, " reload - reload loaded LP\n", 0 ) ; Tcl_AppendResult( tcl, " rows - display # of rows of loaded LP\n", 0 ) ; Tcl_AppendResult( tcl, " columns - display # of columns of loaded LP\n", 0 ) ; Tcl_AppendResult( tcl, " solve - solve loaded LP\n", 0 ) ; Tcl_AppendResult( tcl, " verbose [on/off] - display/set set verbosity for solve\n", 0 ) ; Tcl_AppendResult( tcl, " primal - display current solution vector\n", 0 ) ; Tcl_AppendResult( tcl, " dual - display current dual variables\n", 0 ) ; Tcl_AppendResult( tcl, " ratiotester [name] - display/set ratio test method\n", 0 ) ; Tcl_AppendResult( tcl, " pricer [name] - display/set pricing method\n", 0 ) ; Tcl_AppendResult( tcl, " starter [name] - display/set start basis generation method\n", 0 ) ; Tcl_AppendResult( tcl, " simplifier [name] - display/set simplification method\n", 0 ) ; Tcl_AppendResult( tcl, " list - display available methods\n", 0 ) ; Tcl_AppendResult( tcl, " type [type] - display/set algorithm type\n", 0 ) ; Tcl_AppendResult( tcl, " representation [type] - display/set basis representation\n", 0 ) ; Tcl_AppendResult( tcl, " update [type] - display/set LU-factorization update type \n", 0 ) ; Tcl_AppendResult( tcl, " delta [value] - display/set allowed infeasibility/nonoptimality\n", 0 ) ; Tcl_AppendResult( tcl, " epsilon [value] - display/set general accuracy parameter\n", 0 ) ; Tcl_AppendResult( tcl, " nonzerofactor [value] - display/set refactorization frequency\n", 0 ) ; Tcl_AppendResult( tcl, " maxupdates [num] - display/set the maximum number of basis updates\n", 0 ) ; Tcl_AppendResult( tcl, " maxcycle [num] - display/set allowed cycling iteration\n", 0 ) ; Tcl_AppendResult( tcl, " maxtime [time] - display/set maximum solve time\n", 0 ) ; Tcl_AppendResult( tcl, " shift - display current shift value\n", 0 ) ; Tcl_AppendResult( tcl, "\n", 0 ) ; Tcl_AppendResult( tcl, " + the full command set provided by TCL\n", 0 ) ; } return 0 ; } void initSPxTCL( Tcl_Interp* interp ) { signal( 2 , sigFunc ) ; Tcl_CreateCommand( interp, "help", help, 0, 0 ) ; Tcl_CreateCommand( interp, "dump", dump, 0, 0 ) ; Tcl_CreateCommand( interp, "basis", basis, 0, 0 ) ; Tcl_CreateCommand( interp, "load", load, 0, 0 ) ; Tcl_CreateCommand( interp, "loadbasis", loadBasis, 0, 0 ) ; Tcl_CreateCommand( interp, "rows", rows, 0, 0 ) ; Tcl_CreateCommand( interp, "columns", columns, 0, 0 ) ; Tcl_CreateCommand( interp, "reload", reload, 0, 0 ) ; Tcl_CreateCommand( interp, "solve", solve, 0, 0 ) ; Tcl_CreateCommand( interp, "verbose", verbose, 0, 0 ) ; Tcl_CreateCommand( interp, "primal", primal, 0, 0 ) ; Tcl_CreateCommand( interp, "dual", dual, 0, 0 ) ; Tcl_CreateCommand( interp, "ratiotester", ratio, 0, 0 ) ; Tcl_CreateCommand( interp, "pricer", pricer, 0, 0 ) ; Tcl_CreateCommand( interp, "starter", starter, 0, 0 ) ; Tcl_CreateCommand( interp, "simplifier", simplifier, 0, 0 ) ; Tcl_CreateCommand( interp, "list", list, 0, 0 ) ; Tcl_CreateCommand( interp, "type", type, 0, 0 ) ; Tcl_CreateCommand( interp, "update", update, 0, 0 ) ; Tcl_CreateCommand( interp, "representation", rep, 0, 0 ) ; Tcl_CreateCommand( interp, "delta", delta, 0, 0 ) ; Tcl_CreateCommand( interp, "epsilon", eps, 0, 0 ) ; Tcl_CreateCommand( interp, "nonzerofactor", nonzerofactor, 0, 0 ) ; Tcl_CreateCommand( interp, "maxcycle", maxcycle, 0, 0 ) ; Tcl_CreateCommand( interp, "maxtime", maxtime, 0, 0 ) ; Tcl_CreateCommand( interp, "maxupdate", maxupdate, 0, 0 ) ; Tcl_CreateCommand( interp, "shift", shift, 0, 0 ) ; setupParameters( interp ) ; cout << endl ; cout << " ***********************************************\n" ; cout << " * *\n" ; cout << " * Welcome to *\n" ; cout << " * *\n" ; cout << " * SPxTCL - the TCL shell for SoPlex *\n" ; cout << " * *\n" ; cout << " * Version 1.0 *\n" ; cout << " * *\n" ; cout << " ***********************************************\n" ; cout << endl ; }