35 size_t len = strlen(s);
36 assert(len <= INT_MAX);
37 int n =
static_cast<int>(len);
51 for (
int k = 0; k < n; k++)
58 cerr <<
"Unbalanced braces in dmatrix::fill(const char * s)\n";
59 cerr <<
"at character " << k <<
"\n";
70 cerr <<
"Unbalanced braces in dmatrix::dmatrix(const char * s)\n";
71 cerr <<
"at character " << k <<
"\n";
78 cerr <<
"Too many rows in dmatrix::dmatrix(const char * s)\n";
94 cerr <<
"Unbalanced braces in dmatrix::dmatrix(const char * s)\n";
100 unsigned int _nrow =
static_cast<unsigned int>(nrow);
101 unsigned int _rowsize =
rowsize();
102 if (_nrow < _rowsize)
104 cerr <<
" Not enough rows in the data for dmatrix::fill(const char *) \n";
107 else if (_nrow > _rowsize)
109 cerr <<
" Too many rows in the data for dmatrix::fill(const char *) \n";
114 for (
int i=1; i<=nrow; i++)
116 int index =
rowmin() + i - 1;
117 unsigned int size = ((*this)[index]).size();
118 unsigned int cols =
static_cast<unsigned int>(columns[i]);
119 cout <<
"row " << i <<
" matrix " << size <<
" colvector " << cols <<
"\n";
123 cerr <<
" Not enough columns in the data in row "
124 << i <<
" for dmatrix::fill(const char *) \n";
127 else if (size < cols)
129 cerr <<
" Too many columns in the data in row "
130 << i <<
" for dmatrix::fill(const char *) \n";
137 char *t =
new char[strlen(s)+1];
140 for (
int k = k1[i]; k <= k2[i]; k++)
144 t[k2[i]-k1[i]+1] =
'\0';
void myheapcheck(char *msg)
Does nothing.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Vector of double precision numbers.
Array of integers(int) with indexes from index_min to indexmax.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector & shift(int min)
Shift valid range of subscripts.
void rowshift(int min)
Changes the range of valid indices for the rows.
void colshift(int min)
Description not yet available.
unsigned int rowsize() const
void fill(const char *)
Fill allocated dmatrix with values from input parameter s.