13 #if defined(__TURBOC__)
20 #include <iostream.hpp>
22 #include <sstream.hpp>
24 #include <strstream.h>
35 #include <strstream.h>
36 #define __USE_IOSTREAM__
43 using std::istringstream;
61 char* t =
new char[n];
63 for (
size_t k = 0; k < n; k++)
86 if (lbraces != rbraces)
88 cerr <<
"Unbalanced braces in dvector::dvector(const char * s)\n";
95 cerr <<
"Only one level of braces allowed in "
96 "dvector::dvector(const char * s)\n";
104 int nch = commas + 1;
109 for (
int k = ncl; k <= nch; k++)
117 const char* filename = s;
118 ifstream infile(filename);
121 cerr <<
"Error opening file " << filename <<
" in dvector constructor "
122 <<
"dvector::dvector(char * filename)\n";
134 while (!infile.eof())
150 }
while (!isspace(c) && c !=
',');
155 infile.seekg(0,ios::beg);
160 cout <<
"Created a ncopies with address " << _farptr_tolong(&(
shape->
ncopies))<<
"\n";
161 cout <<
"Created a dvector with address " << _farptr_tolong(
va) <<
"\n";
169 cerr <<
"Error: instance of gradient_structure is a nullptr.\n";
174 cerr <<
" Error trying to allocate memory for dvector\n";
179 for (i=1;i<=count;i++)
184 while (!infile.eof())
202 }
while (!isspace(c) && c !=
',');
207 elem(i)=strtod(field,&err_ptr);
209 if (isalpha((
unsigned char)err_ptr[0]))
211 cerr <<
"Error decoding field " << filename
212 <<
" in dmatrix::dmatrix(char * filename) " <<
"\n";
213 cerr <<
"Error occurred at element " << count <<
"\n";
214 cerr <<
"Offending characters start with "
218 << err_ptr[3] <<
"\n";
223 cerr <<
"Overflow Error decoding field " << filename
224 <<
" in dmatrix::dmatrix(char * filename) " <<
"\n";
225 cerr <<
"Error occurred at element " << count <<
"\n";
dvar_vector()
Default constructor.
double_and_int * arr_new(unsigned int sz)
const int MAX_FIELD_LENGTH
friend dvector value(const dvar_vector &v1)
Description not yet available.
void allocate(void)
Does not allocate, but initializes dvar_vector to empty.
unsigned int size() const
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static _THREAD gradient_structure * _instance
unsigned int ncopies
Copy counter to enable shallow copies.
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.