dump.hpp
Go to the documentation of this file.
1 #ifndef STAN_IO_DUMP_HPP
2 #define STAN_IO_DUMP_HPP
3 
6 #include <stan/math/prim/mat.hpp>
7 #include <boost/lexical_cast.hpp>
8 #include <boost/throw_exception.hpp>
9 #include <boost/type_traits/is_floating_point.hpp>
10 #include <boost/type_traits/is_integral.hpp>
11 #include <boost/type_traits/is_arithmetic.hpp>
12 #include <boost/utility/enable_if.hpp>
13 #include <iostream>
14 #include <limits>
15 #include <map>
16 #include <sstream>
17 #include <stdexcept>
18 #include <string>
19 #include <utility>
20 #include <vector>
21 #include <cctype>
22 
23 namespace stan {
24  namespace io {
25 
26  using Eigen::Dynamic;
27  /**
28  * Reads data from S-plus dump format.
29  *
30  * A <code>dump_reader</code> parses data from the S-plus dump
31  * format, a human-readable ASCII representation of arbitrarily
32  * dimensioned arrays of integers and arrays of floating point
33  * values.
34  *
35  * <p>Stan's dump reader is limited to reading
36  * integers, scalars and arrays of arbitrary dimensionality of
37  * integers and scalars. It is able to read from a file
38  * consisting of a sequence of dumped variables.
39  *
40  * <p>There cannot be any <code>NA</code>
41  * (i.e., undefined) values, because these cannot be
42  * represented as <code>double</code> values.
43  *
44  * <p>The dump reader class follows a standard scanner pattern.
45  * The method <code>next()</code> is called to scan the next
46  * input. The type, dimensions, and values of the input is then
47  * available through method calls. Here, the type is either
48  * double or integer, and the values are the name of the variable
49  * and its array of values. If there is a single value, the
50  * dimension array is empty. For a list, the dimension
51  * array contains a single entry for the number of values.
52  * For an array, the dimensions are the dimensions of the array.
53  *
54  * <p>Reads are performed in an "S-compatible" mode whereby
55  * a string such as "1" or "-127" denotes and integer, whereas
56  * a string such as "1." or "0.9e-5" represents a floating
57  * point value.
58  *
59  * <p>The dump reader treats "integer(x)" as an array of zeros
60  * (type being integer and length x), where x any non-negative
61  * integers and x can be omitted to indicate zero-length.
62  * So the following are all legitimate: * "x <- integer()",
63  * "x <- integer(0) ", and "x <- integer(3)". For array of zeros
64  * of type double, we can replace the above "integer" with "double".
65  * This is mainly for the purpose of supporting zero-size arrays
66  * such as "x <- structure(integer(0), .Dim = c(2, 0))".
67  *
68  * <p>For dumping, arrays are indexed in last-index major fashion,
69  * which corresponds to column-major order for matrices
70  * represented as two-dimensional arrays. As a result, the first
71  * indices change fastest. For instance, if there is an
72  * three-dimensional array <code>x</code> with dimensions
73  * <code>[2,2,2]</code>, then there are 8 values, provided in the
74  * order
75  *
76  * <p><code>[0,0,0]</code>,
77  * <code>[1,0,0]</code>,
78  * <code>[0,1,0]</code>,
79  * <code>[1,1,0]</code>,
80  * <code>[0,0,1]</code>,
81  * <code>[1,0,1]</code>,
82  * <code>[0,1,1]</code>,
83  * <code>[1,1,1]</code>.
84  *
85  * definitions ::= definition+
86  *
87  * definition ::= name ("<-" | '=') value optional_semicolon
88  *
89  * name ::= char*
90  * | ''' char* '''
91  * | '"' char* '"'
92  *
93  * value ::= value<int> | value<double>
94  *
95  * value<T> ::= T
96  * | seq<T>
97  * | zero_array<T>
98  * | "structure" '(' seq<T> ',' ".Dim" '=' seq<int> ')'
99  * | "structure" '(' zero_array<T> ',' ".Dim" '=' seq<int> ')'
100  *
101  * seq<int> ::= int ':' int
102  * | cseq<int>
103  *
104  * seq<double> ::= cseq<double>
105  *
106  * cseq<T> ::= 'c' '(' vseq<T> ')'
107  *
108  * vseq<T> ::= T
109  * | T ',' vseq<T>
110  *
111  * zero_array<integer> ::= "integer"<non negative int?>
112  *
113  * zero_array<double> ::= "double"<non negative int?>
114  *
115  */
116  class dump_reader {
117  private:
120  std::vector<int> stack_i_;
121  std::vector<double> stack_r_;
122  std::vector<size_t> dims_;
123  std::istream& in_;
124 
125  bool scan_single_char(char c_expected) {
126  int c = in_.peek();
127  if (in_.fail()) return false;
128  if (c != c_expected)
129  return false;
130  char c_skip;
131  in_.get(c_skip);
132  return true;
133  }
134 
136  if (scan_single_char('l'))
137  return true;
138  else if (scan_single_char('L'))
139  return true;
140  else
141  return false;
142  }
143 
144  bool scan_char(char c_expected) {
145  char c;
146  in_ >> c;
147  if (in_.fail()) return false;
148  if (c != c_expected) {
149  in_.putback(c);
150  return false;
151  }
152  return true;
153  }
154 
156  char c;
157  in_ >> c;
158  if (in_.fail()) return false;
159  if (!std::isalpha(c)) return false;
160  name_.push_back(c);
161  while (in_.get(c)) { // get turns off auto space skip
162  if (std::isalpha(c) || std::isdigit(c) || c == '_' || c == '.') {
163  name_.push_back(c);
164  } else {
165  in_.putback(c);
166  return true;
167  }
168  }
169  return true; // but hit eos
170  }
171 
172  bool scan_name() {
173  if (scan_char('"')) {
174  if (!scan_name_unquoted()) return false;
175  if (!scan_char('"')) return false;
176  } else if (scan_char('\'')) {
177  if (!scan_name_unquoted()) return false;
178  if (!scan_char('\'')) return false;
179  } else {
180  if (!scan_name_unquoted()) return false;
181  }
182  return true;
183  }
184 
185 
186  bool scan_chars(const char *s, bool case_sensitive = true) {
187  for (size_t i = 0; s[i]; ++i) {
188  char c;
189  if (!(in_ >> c)) {
190  for (size_t j = 1; j < i; ++j)
191  in_.putback(s[i-j]);
192  return false;
193  }
194  // all ASCII, so toupper is OK
195  if ((case_sensitive && c != s[i])
196  || (!case_sensitive && ::toupper(c) != ::toupper(s[i]))) {
197  in_.putback(c);
198  for (size_t j = 1; j < i; ++j)
199  in_.putback(s[i-j]);
200  return false;
201  }
202  }
203  return true;
204  }
205 
206  bool scan_chars(std::string s, bool case_sensitive = true) {
207  for (size_t i = 0; i < s.size(); ++i) {
208  char c;
209  if (!(in_ >> c)) {
210  for (size_t j = 1; j < i; ++j)
211  in_.putback(s[i-j]);
212  return false;
213  }
214  // all ASCII, so toupper is OK
215  if ((case_sensitive && c != s[i])
216  || (!case_sensitive && ::toupper(c) != ::toupper(s[i]))) {
217  in_.putback(c);
218  for (size_t j = 1; j < i; ++j)
219  in_.putback(s[i-j]);
220  return false;
221  }
222  }
223  return true;
224  }
225 
226  size_t scan_dim() {
227  char c;
228  buf_.clear();
229  while (in_.get(c)) {
230  if (std::isspace(c)) continue;
231  if (std::isdigit(c)) {
232  buf_.push_back(c);
233  } else {
234  in_.putback(c);
235  break;
236  }
237  }
239  size_t d = 0;
240  try {
241  d = boost::lexical_cast<size_t>(buf_);
242  }
243  catch ( const boost::bad_lexical_cast &exc ) {
244  std::string msg = "value " + buf_ + " beyond array dimension range";
245  BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
246  }
247  return d;
248  }
249 
250  int scan_int() {
251  char c;
252  buf_.clear();
253  while (in_.get(c)) {
254  if (std::isspace(c)) continue;
255  if (std::isdigit(c)) {
256  buf_.push_back(c);
257  } else {
258  in_.putback(c);
259  break;
260  }
261  }
262  return(get_int());
263  }
264 
265  int get_int() {
266  int n = 0;
267  try {
268  n = boost::lexical_cast<int>(buf_);
269  }
270  catch ( const boost::bad_lexical_cast &exc ) {
271  std::string msg = "value " + buf_ + " beyond int range";
272  BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
273  }
274  return n;
275  }
276 
277  double scan_double() {
278  double x = 0;
279  try {
280  x = boost::lexical_cast<double>(buf_);
281  if (x == 0)
282  validate_zero_buf(buf_);
283  }
284  catch ( const boost::bad_lexical_cast &exc ) {
285  std::string msg = "value " + buf_ + " beyond numeric range";
286  BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
287  }
288  return x;
289  }
290 
291 
292 
293  // scan number stores number or throws bad lexical cast exception
294  void scan_number(bool negate_val) {
295  // must take longest first!
296  if (scan_chars("Inf")) {
297  scan_chars("inity"); // read past if there
298  stack_r_.push_back(negate_val
299  ? -std::numeric_limits<double>::infinity()
300  : std::numeric_limits<double>::infinity());
301  return;
302  }
303  if (scan_chars("NaN", false)) {
304  stack_r_.push_back(std::numeric_limits<double>::quiet_NaN());
305  return;
306  }
307 
308  char c;
309  bool is_double = false;
310  buf_.clear();
311  while (in_.get(c)) {
312  if (std::isdigit(c)) { // before pre-scan || c == '-' || c == '+') {
313  buf_.push_back(c);
314  } else if (c == '.'
315  || c == 'e'
316  || c == 'E'
317  || c == '-'
318  || c == '+') {
319  is_double = true;
320  buf_.push_back(c);
321  } else {
322  in_.putback(c);
323  break;
324  }
325  }
326  if (!is_double && stack_r_.size() == 0) {
327  int n = get_int();
328  stack_i_.push_back(negate_val ? -n : n);
330  } else {
331  for (size_t j = 0; j < stack_i_.size(); ++j)
332  stack_r_.push_back(static_cast<double>(stack_i_[j]));
333  stack_i_.clear();
334  double x = scan_double();
335  stack_r_.push_back(negate_val ? -x : x);
336  }
337  }
338 
339  void scan_number() {
340  char c;
341  while (in_.get(c)) {
342  if (std::isspace(c)) continue;
343  in_.putback(c);
344  break;
345  }
346  bool negate_val = scan_char('-');
347  if (!negate_val) scan_char('+'); // flush leading +
348  return scan_number(negate_val);
349  }
350 
352  if (!scan_char('(')) return false;
353  if (scan_char(')')) {
354  dims_.push_back(0U);
355  return true;
356  }
357  int s = scan_int();
358  if (s < 0) return false;
359  for (int i = 0; i < s; ++i) {
360  stack_i_.push_back(0);
361  }
362  if (!scan_char(')')) return false;
363  dims_.push_back(s);
364  return true;
365  }
366 
368  if (!scan_char('(')) return false;
369  if (scan_char(')')) {
370  dims_.push_back(0U);
371  return true;
372  }
373  int s = scan_int();
374  if (s < 0) return false;
375  for (int i = 0; i < s; ++i) {
376  stack_r_.push_back(0);
377  }
378  if (!scan_char(')')) return false;
379  dims_.push_back(s);
380  return true;
381  }
382 
383 
384  bool scan_seq_value() {
385  if (!scan_char('(')) return false;
386  if (scan_char(')')) {
387  dims_.push_back(0U);
388  return true;
389  }
390  scan_number(); // first entry
391  while (scan_char(',')) {
392  scan_number();
393  }
394  dims_.push_back(stack_r_.size() + stack_i_.size());
395  return scan_char(')');
396  }
397 
399  if (!scan_char('(')) return false;
400  if (scan_chars("integer")) {
402  } else if (scan_chars("double")) {
404  } else if (scan_char('c')) {
405  scan_seq_value();
406  } else {
407  int start = scan_int();
408  if (!scan_char(':'))
409  return false;
410  int end = scan_int();
411  if (start <= end) {
412  for (int i = start; i <= end; ++i)
413  stack_i_.push_back(i);
414  } else {
415  for (int i = start; i >= end; --i)
416  stack_i_.push_back(i);
417  }
418  }
419  dims_.clear();
420  if (!scan_char(',')) return false;
421  if (!scan_char('.')) return false;
422  if (!scan_chars("Dim")) return false;
423  if (!scan_char('=')) return false;
424  if (scan_char('c')) {
425  if (!scan_char('(')) return false;
426  size_t dim = scan_dim();
427  dims_.push_back(dim);
428  while (scan_char(',')) {
429  dim = scan_dim();
430  dims_.push_back(dim);
431  }
432  if (!scan_char(')')) return false;
433  } else {
434  size_t start = scan_dim();
435  if (!scan_char(':'))
436  return false;
437  size_t end = scan_dim();
438  if (start < end) {
439  for (size_t i = start; i <= end; ++i)
440  dims_.push_back(i);
441  } else {
442  for (size_t i = start; i >= end; --i)
443  dims_.push_back(i);
444  }
445  }
446  if (!scan_char(')')) return false;
447  return true;
448  }
449 
450  bool scan_value() {
451  if (scan_char('c'))
452  return scan_seq_value();
453  if (scan_chars("integer"))
454  return scan_zero_integers();
455  if (scan_chars("double"))
456  return scan_zero_doubles();
457  if (scan_chars("structure"))
458  return scan_struct_value();
459  scan_number();
460  if (!scan_char(':'))
461  return true;
462  if (stack_i_.size() != 1)
463  return false;
464  scan_number();
465  if (stack_i_.size() != 2)
466  return false;
467  int start = stack_i_[0];
468  int end = stack_i_[1];
469  stack_i_.clear();
470  if (start <= end) {
471  for (int i = start; i <= end; ++i)
472  stack_i_.push_back(i);
473  } else {
474  for (int i = start; i >= end; --i)
475  stack_i_.push_back(i);
476  }
477  dims_.push_back(stack_i_.size());
478  return true;
479  }
480 
481 
482  public:
483  /**
484  * Construct a reader for the specified input stream.
485  *
486  * @param in Input stream reference from which to read.
487  */
488  explicit dump_reader(std::istream& in) : in_(in) { }
489 
490  /**
491  * Destroy this reader.
492  */
494 
495 
496  /**
497  * Return the name of the most recently read variable.
498  *
499  * @return Name of most recently read variable.
500  */
502  return name_;
503  }
504 
505  /**
506  * Return the dimensions of the most recently
507  * read variable.
508  *
509  * @return Last dimensions.
510  */
511  std::vector<size_t> dims() {
512  return dims_;
513  }
514 
515  /**
516  * Checks if the last item read is integer.
517  *
518  * Return <code>true</code> if the value(s) in the most recently
519  * read item are integer values and <code>false</code> if
520  * they are floating point.
521  */
522  bool is_int() {
523  // return stack_i_.size() > 0;
524  return stack_r_.size() == 0;
525  }
526 
527  /**
528  * Returns the integer values from the last item if the
529  * last item read was an integer and the empty vector otherwise.
530  *
531  * @return Integer values of last item.
532  */
533  std::vector<int> int_values() {
534  return stack_i_;
535  }
536 
537  /**
538  * Returns the floating point values from the last item if the
539  * last item read contained floating point values and the empty
540  * vector otherwise.
541  *
542  * @return Floating point values of last item.
543  */
544  std::vector<double> double_values() {
545  return stack_r_;
546  }
547 
548  /**
549  * Read the next value from the input stream, returning
550  * <code>true</code> if successful and <code>false</code> if no
551  * further input may be read.
552  *
553  * @return Return <code>true</code> if a fresh variable was read.
554  * @throws bad_cast if bad number values encountered.
555  */
556  bool next() {
557  stack_r_.clear();
558  stack_i_.clear();
559  dims_.clear();
560  name_.erase();
561  if (!scan_name()) // set name
562  return false;
563  if (!scan_char('<')) // set <-
564  return false;
565  if (!scan_char('-'))
566  return false;
567  try {
568  bool okSyntax = scan_value(); // set stack_r_, stack_i_, dims_
569  if (!okSyntax) {
570  std::string msg = "syntax error";
571  BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
572  }
573  }
574  catch (const std::invalid_argument &e) {
575  std::string msg = "data " + name_ + " " + e.what();
576  BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
577  }
578  return true;
579  }
580  };
581 
582 
583 
584  /**
585  * Represents named arrays with dimensions.
586  *
587  * A dump object represents a dump of named arrays with dimensions.
588  * The arrays may have any dimensionality. The values for an array
589  * are typed to double or int.
590  *
591  * <p>See <code>dump_reader</code> for more information on the format.
592  *
593  * <p>Dump objects are created from reading dump files from an
594  * input stream.
595  *
596  * <p>The dimensions and values of variables
597  * may be accessed by name.
598  */
599  class dump : public stan::io::var_context {
600  private:
601  std::map<std::string,
602  std::pair<std::vector<double>,
603  std::vector<size_t> > > vars_r_;
604  std::map<std::string,
605  std::pair<std::vector<int>,
606  std::vector<size_t> > > vars_i_;
607  std::vector<double> const empty_vec_r_;
608  std::vector<int> const empty_vec_i_;
609  std::vector<size_t> const empty_vec_ui_;
610  /**
611  * Return <code>true</code> if this dump contains the specified
612  * variable name is defined in the real values. This method
613  * returns <code>false</code> if the values are all integers.
614  *
615  * @param name Variable name to test.
616  * @return <code>true</code> if the variable exists in the
617  * real values of the dump.
618  */
619  bool contains_r_only(const std::string& name) const {
620  return vars_r_.find(name) != vars_r_.end();
621  }
622 
623  public:
624  /**
625  * Construct a dump object from the specified input stream.
626  *
627  * <b>Warning:</b> This method does not close the input stream.
628  *
629  * @param in Input stream from which to read.
630  */
631  explicit dump(std::istream& in) {
632  dump_reader reader(in);
633  while (reader.next()) {
634  if (reader.is_int()) {
635  vars_i_[reader.name()]
636  = std::pair<std::vector<int>,
637  std::vector<size_t> >(reader.int_values(),
638  reader.dims());
639 
640  } else {
641  vars_r_[reader.name()]
642  = std::pair<std::vector<double>,
643  std::vector<size_t> >(reader.double_values(),
644  reader.dims());
645  }
646  }
647  }
648 
649  /**
650  * Return <code>true</code> if this dump contains the specified
651  * variable name is defined. This method returns <code>true</code>
652  * even if the values are all integers.
653  *
654  * @param name Variable name to test.
655  * @return <code>true</code> if the variable exists.
656  */
657  bool contains_r(const std::string& name) const {
658  return contains_r_only(name) || contains_i(name);
659  }
660 
661  /**
662  * Return <code>true</code> if this dump contains an integer
663  * valued array with the specified name.
664  *
665  * @param name Variable name to test.
666  * @return <code>true</code> if the variable name has an integer
667  * array value.
668  */
669  bool contains_i(const std::string& name) const {
670  return vars_i_.find(name) != vars_i_.end();
671  }
672 
673  /**
674  * Return the double values for the variable with the specified
675  * name or null.
676  *
677  * @param name Name of variable.
678  * @return Values of variable.
679  */
680  std::vector<double> vals_r(const std::string& name) const {
681  if (contains_r_only(name)) {
682  return (vars_r_.find(name)->second).first;
683  } else if (contains_i(name)) {
684  std::vector<int> vec_int = (vars_i_.find(name)->second).first;
685  std::vector<double> vec_r(vec_int.size());
686  for (size_t ii = 0; ii < vec_int.size(); ii++) {
687  vec_r[ii] = vec_int[ii];
688  }
689  return vec_r;
690  }
691  return empty_vec_r_;
692  }
693 
694  /**
695  * Return the dimensions for the double variable with the specified
696  * name.
697  *
698  * @param name Name of variable.
699  * @return Dimensions of variable.
700  */
701  std::vector<size_t> dims_r(const std::string& name) const {
702  if (contains_r_only(name)) {
703  return (vars_r_.find(name)->second).second;
704  } else if (contains_i(name)) {
705  return (vars_i_.find(name)->second).second;
706  }
707  return empty_vec_ui_;
708  }
709 
710  /**
711  * Return the integer values for the variable with the specified
712  * name.
713  *
714  * @param name Name of variable.
715  * @return Values.
716  */
717  std::vector<int> vals_i(const std::string& name) const {
718  if (contains_i(name)) {
719  return (vars_i_.find(name)->second).first;
720  }
721  return empty_vec_i_;
722  }
723 
724  /**
725  * Return the dimensions for the integer variable with the specified
726  * name.
727  *
728  * @param name Name of variable.
729  * @return Dimensions of variable.
730  */
731  std::vector<size_t> dims_i(const std::string& name) const {
732  if (contains_i(name)) {
733  return (vars_i_.find(name)->second).second;
734  }
735  return empty_vec_ui_;
736  }
737 
738  /**
739  * Return a list of the names of the floating point variables in
740  * the dump.
741  *
742  * @param names Vector to store the list of names in.
743  */
744  virtual void names_r(std::vector<std::string>& names) const {
745  names.resize(0);
746  for (std::map<std::string,
747  std::pair<std::vector<double>,
748  std::vector<size_t> > >
749  ::const_iterator it = vars_r_.begin();
750  it != vars_r_.end(); ++it)
751  names.push_back((*it).first);
752  }
753 
754  /**
755  * Return a list of the names of the integer variables in
756  * the dump.
757  *
758  * @param names Vector to store the list of names in.
759  */
760  virtual void names_i(std::vector<std::string>& names) const {
761  names.resize(0);
762  for (std::map<std::string,
763  std::pair<std::vector<int>,
764  std::vector<size_t> > >
765  ::const_iterator it = vars_i_.begin();
766  it != vars_i_.end(); ++it)
767  names.push_back((*it).first);
768  }
769 
770  /**
771  * Remove variable from the object.
772  *
773  * @param name Name of the variable to remove.
774  * @return If variable is removed returns <code>true</code>, else
775  * returns <code>false</code>.
776  */
777  bool remove(const std::string& name) {
778  return (vars_i_.erase(name) > 0)
779  || (vars_r_.erase(name) > 0);
780  }
781  };
782 
783  }
784 
785 }
786 #endif
dump(std::istream &in)
Definition: dump.hpp:631
const XML_Char * name
Definition: expat.h:151
std::vector< size_t > const empty_vec_ui_
Definition: dump.hpp:609
set< int >::iterator it
bool contains_r_only(const std::string &name) const
Definition: dump.hpp:619
virtual void names_r(std::vector< std::string > &names) const
Definition: dump.hpp:744
bool contains_r(const std::string &name) const
Definition: dump.hpp:657
bool scan_zero_doubles()
Definition: dump.hpp:367
bool scan_seq_value()
Definition: dump.hpp:384
std::vector< double > double_values()
Definition: dump.hpp:544
bool scan_char(char c_expected)
Definition: dump.hpp:144
virtual void names_i(std::vector< std::string > &names) const
Definition: dump.hpp:760
bool scan_chars(std::string s, bool case_sensitive=true)
Definition: dump.hpp:206
std::map< std::string, std::pair< std::vector< double >, std::vector< size_t > > > vars_r_
Definition: dump.hpp:603
const XML_Char * s
Definition: expat.h:262
std::string name_
Definition: dump.hpp:119
bool contains_i(const std::string &name) const
Definition: dump.hpp:669
bool scan_zero_integers()
Definition: dump.hpp:351
std::vector< double > const empty_vec_r_
Definition: dump.hpp:607
Float_t d
Definition: plot.C:236
std::istream & in_
Definition: dump.hpp:123
std::vector< size_t > dims_r(const std::string &name) const
Definition: dump.hpp:701
const double j
Definition: BetheBloch.cxx:29
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
size_t scan_dim()
Definition: dump.hpp:226
void validate_zero_buf(const B &buf)
std::map< std::string, std::pair< std::vector< int >, std::vector< size_t > > > vars_i_
Definition: dump.hpp:606
std::vector< double > stack_r_
Definition: dump.hpp:121
bool scan_chars(const char *s, bool case_sensitive=true)
Definition: dump.hpp:186
std::vector< int > int_values()
Definition: dump.hpp:533
std::string buf_
Definition: dump.hpp:118
void scan_number(bool negate_val)
Definition: dump.hpp:294
double scan_double()
Definition: dump.hpp:277
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
ifstream in
Definition: comparison.C:7
std::vector< double > vals_r(const std::string &name) const
Definition: dump.hpp:680
std::string name()
Definition: dump.hpp:501
std::vector< size_t > dims()
Definition: dump.hpp:511
bool scan_name_unquoted()
Definition: dump.hpp:155
bool scan_struct_value()
Definition: dump.hpp:398
std::vector< int > vals_i(const std::string &name) const
Definition: dump.hpp:717
bool scan_single_char(char c_expected)
Definition: dump.hpp:125
std::vector< int > stack_i_
Definition: dump.hpp:120
bool scan_optional_long()
Definition: dump.hpp:135
Float_t e
Definition: plot.C:35
dump_reader(std::istream &in)
Definition: dump.hpp:488
std::vector< int > const empty_vec_i_
Definition: dump.hpp:608
std::vector< size_t > dims_i(const std::string &name) const
Definition: dump.hpp:731
std::vector< size_t > dims_
Definition: dump.hpp:122