ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dmat_io3.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
7 #ifdef __TURBOC__
8  #pragma hdrstop
9  #include <iostream.h>
10  #include <iomanip.h>
11  #include <fstream.h>
12 #endif
13 
14 #ifdef __ZTC__
15  #include <iostream.hpp>
16  #include <iomanip.hpp>
17  #include <fstream.hpp>
18 #endif
19 
26 uistream& operator>>(const uistream& input, const dmatrix& values)
27 {
28  return const_cast<dmatrix&>(values).read_from(input);
29 }
36 {
37  uistream& uis = const_cast<uistream&>(input);
38  for (int i = rowmin(); i <= rowmax(); ++i)
39  {
40  uis >> elem(i);
41  }
42  if (uis.bad() || uis.fail())
43  {
44  cerr << " Error in dmatrix::read_from.\n";
45  ad_exit(1);
46  }
47  return uis;
48 }
56 {
57  return values.write_on(output);
58 }
65 {
66  uostream& uos = const_cast<uostream&>(output);
67  for (int i = rowmin(); i <= rowmax(); ++i)
68  {
69  uos << elem(i);
70  }
71  if (uos.bad() || uos.fail())
72  {
73  cerr << " Error in dmatrix::write_on\n";
74  ad_exit(1);
75  }
76  return uos;
77 }
void write_on(const ostream &) const
Description not yet available.
Definition: dmat_io.cpp:46
exitptr ad_exit
Definition: gradstrc.cpp:53
int rowmax() const
Definition: fvar.hpp:2929
Description not yet available.
Definition: fvar.hpp:3398
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Definition: fvar.hpp:2819
dvector & elem(int i)
Definition: fvar.hpp:3011
values
Definition: adjson.h:22
const int output
Definition: fvar.hpp:9505
istream & operator>>(const istream &input, const d3_array &arr3)
Read values from input stream into arr3.
Definition: d3_io.cpp:60
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
Definition: admanip.cpp:48
void read_from(const istream &)
Description not yet available.
Definition: dmat_io.cpp:91
Description not yet available.
Definition: fvar.hpp:3516
int rowmin() const
Definition: fvar.hpp:2925