41 #ifndef __ADMB_IMATRIX_H__
42 #define __ADMB_IMATRIX_H__
80 return (
shape == NULL);
114 void allocate(
int nrl,
int nrh,
int ncl,
int nch);
167 return static_cast<unsigned int>(
rowmax() -
rowmin() + 1);
172 return static_cast<unsigned int>(
colmax() -
colmin() + 1);
181 return (*((*(
m + i)).v + j));
183 inline const int &
elem(
int i,
int j)
const
185 return (*((*(
m + i)).v + j));
188 void write_on(
const ostream &)
const;
211 return (*((*(
m + i)).v + j));
216 throw std::bad_alloc();
226 return (*((*(
m + i)).v + j));
237 cerr <<
"matrix bound exceeded -- row index too low in "
238 "imatrix::operator[i] value was \"" << i <<
"\".\n";
243 cerr <<
"matrix bound exceeded -- row index too high in "
244 "imatrix::operator[i] value was \"" << i <<
"\".\n";
253 cerr <<
"matrix bound exceeded -- row index too low in "
254 "imatrix::operator[i] value was \"" << i <<
"\".\n";
259 cerr <<
"matrix bound exceeded -- row index too high in "
260 "imatrix::operator[i] value was \"" << i <<
"\".\n";
Uses polymorphism to get index information from various data types to be used in constructing and all...
void allocate(void)
Does not allocate, but initializes imatrix members.
void colfill_seqadd(int, int, int)
Fills column of a matrix with a sequence of the form base, base+offset, base+2*offset,...
Description not yet available.
Description not yet available.
int operator!(void) const
Description not yet available.
void deallocate()
Deallocate imatrix memory.
ivector_position operator()(int i)
Description not yet available.
ivector & operator[](int)
imatrix restore_imatrix_value(const imatrix_position &mpos)
Description not yet available.
imatrix_position(const imatrix &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
imatrix_position restore_imatrix_position(void)
unsigned int colsize() const
Returns the number of columns.
friend char * fform(const char *, const dmatrix &)
void shallow_copy(const imatrix &)
Shallow copy other data structure pointers.
ivector & operator()(int)
Array of integers(int) with indexes from index_min to indexmax.
void initialize(void)
Description not yet available.
Description not yet available.
unsigned int rowsize() const
Returns the number of rows.
Description not yet available.
imatrix restore_imatrix_value(const imatrix_position &mpos)
void fill_seqadd(int, int)
Fill imatrix with sequence of integers from start and adding with increment.
Description not yet available.
imatrix_position restore_imatrix_position()
Reads and restores back the size and address information for a imatrix.
void write_on(const ostream &) const
imatrix(void)
Default constructor.
void save_imatrix_position()
Saves the size and address information for a imatrix.
Description not yet available.
const int & elem(int i, int j) const
void save_imatrix_value()
Saves the size, address, and value information for a imatrix.
Description not yet available.
void read_from(const istream &)
imatrix sub(int, int)
Description not yet available.
imatrix & operator=(const imatrix &t)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
bool is_valid_row(const int i) const
Check index i is in matrix row bounds [index_min, index_max].
unsigned int get_ncopies() const
void rowshift(int min)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.