19 #include <iostream.hpp>
52 const size_t len = strlen(s);
54 assert(len <= INT_MAX);
56 int n =
static_cast<int>(len);
65 for (
int k = 0; k < n; k++)
72 cerr <<
"Unbalanced braces in dvar_matrix::fill(const char * s)\n";
73 cerr <<
"at character " << k <<
"\n";
84 cerr <<
"Unbalanced braces in dvar_matrix::fill(const char * s)\n";
85 cerr <<
"at character " << k <<
"\n";
92 cerr <<
"Too many rows in dvar_matrix::fill(const char * s)\n";
108 cerr <<
"Unbalanced braces in dvar_matrix::fill(const char * s)\n";
113 #if defined(__cplusplus) && (__cplusplus >= 201103L)
114 [](
unsigned int nrow,
unsigned int rowsize)
120 cerr <<
" Not enough rows in the data for "
121 "dvar_matrix::fill(const char*)\n";
126 cerr <<
" Too many rows in the data for "
127 "dvar_matrix::fill(const char*)\n";
131 } (
static_cast<unsigned int>(nrow),
rowsize());
135 for (i=1; i<=nrow; i++)
137 unsigned int size = ((*this)[
rowmin()+i-1]).size();
138 unsigned int column =
static_cast<unsigned int>(columns[i]);
141 cerr <<
" Not enough columns in the data in row "
142 << i <<
" for dvar_matrix::fill(const char *) \n";
145 else if (size < column)
147 cerr <<
" Too many columns in the data in row "
148 << i <<
" for dvar_matrix::fill(const char *) \n";
157 t =
new char[strlen(s)+1];
159 for (
int k = k1[i]; k <= k2[i]; k++)
163 t[k2[i]-k1[i]+1] =
'\0';
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.
unsigned int rowsize() const
dvector column(const dmatrix &matrix, int j)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void fill(const char *)
Fill values of dvar_matrix with text input from s with format rowmin...rowmax where ith row is {colmi...