Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
table_handler.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
17 
18 #include <boost/io/ios_state.hpp>
19 
20 #include <iomanip>
21 #include <iostream>
22 #include <sstream>
23 
24 
26 
27 
28 /*---------------------------------------------------------------------*/
29 
30 // inline and template functions
31 namespace internal
32 {
33  double
35  {
36  // we don't quite know the data type in 'value', but
37  // it must be one of the ones in the type list of the
38  // boost::variant. Go through this list and return
39  // the value if this happens to be a number
40  //
41  // first try with int
42  try
43  {
44  return boost::get<int>(value);
45  }
46  catch (...)
47  {}
48 
49 
50  // ... then with unsigned int...
51  try
52  {
53  return boost::get<unsigned int>(value);
54  }
55  catch (...)
56  {}
57 
58  // ... then with std::uint64_t...
59  try
60  {
61  return boost::get<std::uint64_t>(value);
62  }
63  catch (...)
64  {}
65 
66  // ...and finally with double precision:
67  try
68  {
69  return boost::get<double>(value);
70  }
71  catch (...)
72  {
73  Assert(false,
74  ExcMessage("The number stored by this element of the "
75  "table is not a number."))
76  }
77 
78  return 0;
79  }
80 
81  void
82  TableEntry::cache_string(bool scientific, unsigned int precision) const
83  {
84  std::ostringstream ss;
85 
86  ss << std::setprecision(precision);
87 
88  if (scientific)
89  ss.setf(std::ios::scientific, std::ios::floatfield);
90  else
91  ss.setf(std::ios::fixed, std::ios::floatfield);
92 
93  ss << value;
94 
95  cached_value = ss.str();
96  if (cached_value.size() == 0)
97  cached_value = "\"\"";
98  }
99 
100  const std::string &
102  {
103  return cached_value;
104  }
105 
106 
107  namespace Local
108  {
109  // see which type we can cast to, then use this type to create
110  // a default constructed object
111  struct GetDefaultValue : public boost::static_visitor<>
112  {
113  template <typename T>
114  void
115  operator()(T &operand) const
116  {
117  operand = T();
118  }
119  };
120  } // namespace Local
121 
122  TableEntry
124  {
125  TableEntry new_entry = *this;
126  boost::apply_visitor(Local::GetDefaultValue(), new_entry.value);
127 
128  return new_entry;
129  }
130 
131 
132 } // namespace internal
133 
134 /* ------------------------------------------------ */
135 
136 TableHandler::Column::Column(const std::string &tex_caption)
137  : tex_caption(tex_caption)
138  , tex_format("c")
139  , precision(4)
140  , scientific(false)
141  , flag(0)
142  , max_length(0)
143 {}
144 
145 
146 
148  : tex_caption()
149  , tex_format("c")
150  , precision(4)
151  , scientific(false)
152  , flag(0)
153  , max_length(0)
154 {}
155 
156 
157 
158 void
160 {
161  // we should never have a column that is completely
162  // empty and that needs to be padded
163  Assert(entries.size() > 0, ExcInternalError());
164 
165  // add as many elements as necessary
166  while (entries.size() < size)
167  {
168  entries.push_back(entries.back().get_default_constructed_copy());
169  internal::TableEntry &entry = entries.back();
170  entry.cache_string(scientific, precision);
171  max_length =
172  std::max(max_length,
173  static_cast<unsigned int>(entry.get_cached_string().length()));
174  }
175 }
176 
177 
178 void
180 {
181  max_length = 0;
182 
183  for (const auto &entry : entries)
184  {
185  entry.cache_string(this->scientific, this->precision);
186  max_length =
187  std::max(max_length,
188  static_cast<unsigned int>(entry.get_cached_string().length()));
189  }
190 }
191 
192 
193 /*---------------------------------------------------------------------*/
194 
195 
197  : auto_fill_mode(false)
198 {}
199 
200 
201 
202 void
203 TableHandler::declare_column(const std::string &key)
204 {
205  // see if the column already exists; insert it if not
206  Assert(columns.find(key) == columns.end(),
207  ExcMessage("You are trying to declare a column with key <" + key +
208  "> but such a column already exists."));
209 
210  columns.insert(std::make_pair(key, Column(key)));
211  column_order.push_back(key);
212 }
213 
214 
215 
216 void
218 {
219  // figure out the longest current column
220  unsigned int max_col_length = 0;
221  for (const auto &column : columns)
222  max_col_length =
223  std::max(max_col_length,
224  static_cast<unsigned int>(column.second.entries.size()));
225 
226 
227  // then pad all columns to that length with empty strings
228  for (auto &column : columns)
229  while (column.second.entries.size() < max_col_length)
230  {
231  column.second.entries.emplace_back("");
232  internal::TableEntry &entry = column.second.entries.back();
233  entry.cache_string(column.second.scientific, column.second.precision);
234  column.second.max_length =
235  std::max(column.second.max_length,
236  static_cast<unsigned int>(
237  entry.get_cached_string().length()));
238  }
239 }
240 
241 
242 
243 void
245 {
246  auto_fill_mode = state;
247 }
248 
249 
250 void
252  const std::string &superkey)
253 {
254  Assert(columns.count(key), ExcColumnNotExistent(key));
255 
256  if (!supercolumns.count(superkey))
257  {
258  std::pair<std::string, std::vector<std::string>> new_column(
259  superkey, std::vector<std::string>());
260  supercolumns.insert(new_column);
261  // replace key in column_order
262  // by superkey
263  for (auto &column : column_order)
264  if (column == key)
265  {
266  column = superkey;
267  break;
268  }
269  }
270  else
271  {
272  // remove key from column_order
273  const auto order_iter =
274  std::find(column_order.begin(), column_order.end(), key);
275  if (order_iter != column_order.end())
276  column_order.erase(order_iter);
277  }
278 
279  if (supercolumns.count(superkey))
280  {
281  supercolumns[superkey].push_back(key);
282  // By default set the
283  // tex_supercaption to superkey
284  std::pair<std::string, std::string> new_tex_supercaption(superkey,
285  superkey);
286  tex_supercaptions.insert(new_tex_supercaption);
287  }
288  else
289  Assert(false, ExcInternalError());
290 }
291 
292 
293 
294 void
295 TableHandler::set_column_order(const std::vector<std::string> &new_order)
296 {
297  for (const auto &new_column : new_order)
298  {
299  (void)new_column;
300  Assert(supercolumns.count(new_column) || columns.count(new_column),
302  }
303 
304  column_order = new_order;
305 }
306 
307 
308 void
309 TableHandler::set_tex_caption(const std::string &key,
310  const std::string &tex_caption)
311 {
312  Assert(columns.count(key), ExcColumnNotExistent(key));
313  columns[key].tex_caption = tex_caption;
314 }
315 
316 
317 
318 void
319 TableHandler::set_tex_table_caption(const std::string &table_caption)
320 {
321  tex_table_caption = table_caption;
322 }
323 
324 
325 
326 void
327 TableHandler::set_tex_table_label(const std::string &table_label)
328 {
329  tex_table_label = table_label;
330 }
331 
332 
333 
334 void
335 TableHandler::set_tex_supercaption(const std::string &superkey,
336  const std::string &tex_supercaption)
337 {
338  Assert(supercolumns.count(superkey), ExcSuperColumnNotExistent(superkey));
339  Assert(tex_supercaptions.count(superkey), ExcInternalError());
340  tex_supercaptions[superkey] = tex_supercaption;
341 }
342 
343 
344 
345 void
346 TableHandler::set_tex_format(const std::string &key,
347  const std::string &tex_format)
348 {
349  Assert(columns.count(key), ExcColumnNotExistent(key));
350  Assert(tex_format == "l" || tex_format == "c" || tex_format == "r",
351  ExcUndefinedTexFormat(tex_format));
352  columns[key].tex_format = tex_format;
353 }
354 
355 
356 
357 void
358 TableHandler::set_precision(const std::string &key,
359  const unsigned int precision)
360 {
361  Assert(columns.count(key), ExcColumnNotExistent(key));
362  if (columns[key].precision != precision)
363  {
364  columns[key].precision = precision;
365  columns[key].invalidate_cache();
366  }
367 }
368 
369 
370 void
371 TableHandler::set_scientific(const std::string &key, const bool scientific)
372 {
373  Assert(columns.count(key), ExcColumnNotExistent(key));
374  if (columns[key].scientific != scientific)
375  {
376  columns[key].scientific = scientific;
377  columns[key].invalidate_cache();
378  }
379 }
380 
381 
382 void
383 TableHandler::write_text(std::ostream &out, const TextOutputFormat format) const
384 {
385  AssertThrow(out, ExcIO());
386  boost::io::ios_flags_saver restore_flags(out);
387 
388  // first pad the table from below if necessary
389  if (auto_fill_mode == true)
390  {
391  unsigned int max_rows = 0;
392  for (std::map<std::string, Column>::const_iterator p = columns.begin();
393  p != columns.end();
394  ++p)
395  max_rows = std::max<unsigned int>(max_rows, p->second.entries.size());
396 
397  for (auto &column : columns)
398  column.second.pad_column_below(max_rows);
399  }
400 
401  std::vector<std::string> sel_columns;
402  get_selected_columns(sel_columns);
403 
404  const unsigned int nrows = n_rows();
405  const unsigned int n_cols = sel_columns.size();
406 
407  // cache the columns and compute the widths of each column for alignment
408  std::vector<const Column *> cols;
409  std::vector<unsigned int> column_widths(n_cols, 0);
410  for (unsigned int j = 0; j < n_cols; ++j)
411  {
412  std::string key = sel_columns[j];
413  const std::map<std::string, Column>::const_iterator col_iter =
414  columns.find(key);
415  Assert(col_iter != columns.end(), ExcInternalError());
416  cols.push_back(&(col_iter->second));
417 
418  column_widths[j] = col_iter->second.max_length;
419  }
420 
421  switch (format)
422  {
423  case org_mode_table:
424  {
425  // write the captions
426  out << "| " << std::left;
427  for (unsigned int j = 0; j < n_cols; ++j)
428  {
429  const std::string &key = sel_columns[j];
430  column_widths[j] =
431  std::max(column_widths[j],
432  static_cast<unsigned int>(key.length()));
433  out << std::setw(column_widths[j]);
434  out << key << " | ";
435  }
436  out << '\n';
437 
438  // write the body
439  for (unsigned int i = 0; i < nrows; ++i)
440  {
441  out << "| ";
442  for (unsigned int j = 0; j < n_cols; ++j)
443  {
444  const Column &column = *(cols[j]);
445 
446  out << std::setw(column_widths[j]);
447  out << column.entries[i].get_cached_string();
448  out << " | ";
449  }
450  out << '\n';
451  }
452 
453  out << std::flush;
454  return;
455  }
456 
458  {
459  // write the captions
460  for (unsigned int j = 0; j < n_cols; ++j)
461  {
462  const std::string &key = sel_columns[j];
463  out << "# " << j + 1 << ": " << key << '\n';
464  }
465 
466  // write the body
467  for (unsigned int i = 0; i < nrows; ++i)
468  {
469  for (unsigned int j = 0; j < n_cols; ++j)
470  {
471  const Column &column = *(cols[j]);
472 
473  out << column.entries[i].get_cached_string();
474  out << ' ';
475  }
476  out << '\n';
477  }
478 
479  out << std::flush;
480  return;
481  }
482 
484  {
485  // writing the captions for table_with_separate_column_description
486  // means that we ignore supercolumns and output the column
487  // header for each column. enumerate columns starting with 1
488  for (unsigned int j = 0; j < n_cols; ++j)
489  {
490  std::string key = sel_columns[j];
491  out << "# " << j + 1 << ": " << key << '\n';
492  }
493  break;
494  }
495 
496  case table_with_headers:
497  {
498  // This format output supercolumn headers and aligns them centered
499  // over all the columns that belong to it.
500  for (const auto &key : column_order)
501  {
502  unsigned int width = 0;
503  {
504  // compute the width of this column or supercolumn
505  const std::map<std::string,
506  std::vector<std::string>>::const_iterator
507  super_iter = supercolumns.find(key);
508  if (super_iter != supercolumns.end())
509  {
510  const unsigned int n_subcolumns = super_iter->second.size();
511  for (unsigned int k = 0; k < n_subcolumns; ++k)
512  {
513  const std::map<std::string, Column>::const_iterator
514  col_iter = columns.find(super_iter->second[k]);
515  Assert(col_iter != columns.end(), ExcInternalError());
516 
517  width += col_iter->second.max_length;
518  }
519  width += n_subcolumns - 1; // separators between subcolumns
520  }
521  else
522  {
523  const std::map<std::string, Column>::const_iterator
524  col_iter = columns.find(key);
525 
526  width = col_iter->second.max_length;
527  }
528  }
529 
530  // header is longer than the column(s) under it
531  if (width < key.length())
532  {
533  // make the column or the last column in this
534  // supercolumn wide enough
535  std::string colname;
536 
537  const std::map<std::string,
538  std::vector<std::string>>::const_iterator
539  super_iter = supercolumns.find(key);
540  if (super_iter != supercolumns.end())
541  colname = super_iter->second.back();
542  else
543  colname = key;
544 
545  // find column and change output width
546  for (unsigned int i = 0; i < n_cols; ++i)
547  {
548  if (sel_columns[i] == colname)
549  {
550  column_widths[i] += key.length() - width;
551  break;
552  }
553  }
554 
555  width = key.length();
556  }
557 
558  // now write key. try to center it somehow
559  const unsigned int front_padding = (width - key.length()) / 2,
560  rear_padding =
561  (width - key.length()) - front_padding;
562  for (unsigned int i = 0; i < front_padding; ++i)
563  out << ' ';
564  out << key;
565  for (unsigned int i = 0; i < rear_padding; ++i)
566  out << ' ';
567 
568  out << ' ';
569  }
570  out << '\n';
571  break;
572  }
573 
574  default:
575  Assert(false, ExcInternalError());
576  }
577 
578 
579  // finally output the data itself for
580  // table_with_headers or table_with_separate_column_description:
581  for (unsigned int i = 0; i < nrows; ++i)
582  {
583  for (unsigned int j = 0; j < n_cols; ++j)
584  {
585  const Column &column = *(cols[j]);
586  out << std::setw(column_widths[j]);
587  out << column.entries[i].get_cached_string();
588 
589  // pad after this column
590  out << ' ';
591  }
592  out << '\n';
593  }
594  out << std::flush;
595 }
596 
597 
598 void
599 TableHandler::write_tex(std::ostream &out, const bool with_header) const
600 {
601  // TODO[TH]: update code similar to
602  // write_text() to use the cache
603  AssertThrow(out, ExcIO());
604  if (with_header)
605  out << "\\documentclass[10pt]{report}" << '\n'
606  << "\\usepackage{float}" << '\n'
607  << '\n'
608  << '\n'
609  << "\\begin{document}" << '\n';
610 
611  out << "\\begin{table}[H]" << '\n'
612  << "\\begin{center}" << '\n'
613  << "\\begin{tabular}{|";
614 
615  // first pad the table from below if necessary
616  if (auto_fill_mode == true)
617  {
618  unsigned int max_rows = 0;
619  for (std::map<std::string, Column>::const_iterator p = columns.begin();
620  p != columns.end();
621  ++p)
622  max_rows = std::max<unsigned int>(max_rows, p->second.entries.size());
623 
624  for (auto &column : columns)
625  column.second.pad_column_below(max_rows);
626  }
627 
628  std::vector<std::string> sel_columns;
629  get_selected_columns(sel_columns);
630 
631  // write the column formats
632  for (const auto &key : column_order)
633  {
634  // avoid `supercolumns[key]'
635  const std::map<std::string, std::vector<std::string>>::const_iterator
636  super_iter = supercolumns.find(key);
637 
638  if (super_iter != supercolumns.end())
639  {
640  const unsigned int n_subcolumns = super_iter->second.size();
641  for (unsigned int k = 0; k < n_subcolumns; ++k)
642  {
643  // avoid `columns[supercolumns[key]]'
644  const std::map<std::string, Column>::const_iterator col_iter =
645  columns.find(super_iter->second[k]);
646  Assert(col_iter != columns.end(), ExcInternalError());
647 
648  out << col_iter->second.tex_format << "|";
649  }
650  }
651  else
652  {
653  // avoid `columns[key]';
654  const std::map<std::string, Column>::const_iterator col_iter =
655  columns.find(key);
656  Assert(col_iter != columns.end(), ExcInternalError());
657  out << col_iter->second.tex_format << "|";
658  }
659  }
660  out << "} \\hline" << '\n';
661 
662  // write the caption line of the table
663 
664  for (unsigned int j = 0; j < column_order.size(); ++j)
665  {
666  std::string key = column_order[j];
667  const std::map<std::string, std::vector<std::string>>::const_iterator
668  super_iter = supercolumns.find(key);
669 
670  if (super_iter != supercolumns.end())
671  {
672  const unsigned int n_subcolumns = super_iter->second.size();
673  // avoid use of `tex_supercaptions[key]'
674  std::map<std::string, std::string>::const_iterator
675  tex_super_cap_iter = tex_supercaptions.find(key);
676  out << '\n'
677  << "\\multicolumn{" << n_subcolumns << "}{|c|}{"
678  << tex_super_cap_iter->second << "}";
679  }
680  else
681  {
682  // col_iter->second=columns[col];
683  const std::map<std::string, Column>::const_iterator col_iter =
684  columns.find(key);
685  Assert(col_iter != columns.end(), ExcInternalError());
686  out << col_iter->second.tex_caption;
687  }
688  if (j < column_order.size() - 1)
689  out << " & ";
690  }
691  out << "\\\\ \\hline" << '\n';
692 
693  // write the n rows
694  const unsigned int nrows = n_rows();
695  for (unsigned int i = 0; i < nrows; ++i)
696  {
697  const unsigned int n_cols = sel_columns.size();
698 
699  for (unsigned int j = 0; j < n_cols; ++j)
700  {
701  std::string key = sel_columns[j];
702  // avoid `column[key]'
703  const std::map<std::string, Column>::const_iterator col_iter =
704  columns.find(key);
705  Assert(col_iter != columns.end(), ExcInternalError());
706 
707  const Column &column = col_iter->second;
708 
709  out << std::setprecision(column.precision);
710 
711  if (col_iter->second.scientific)
712  out.setf(std::ios::scientific, std::ios::floatfield);
713  else
714  out.setf(std::ios::fixed, std::ios::floatfield);
715 
716  out << column.entries[i].value;
717 
718  if (j < n_cols - 1)
719  out << " & ";
720  }
721  out << "\\\\ \\hline" << '\n';
722  }
723 
724  out << "\\end{tabular}" << '\n' << "\\end{center}" << '\n';
725  if (!tex_table_caption.empty())
726  out << "\\caption{" << tex_table_caption << "}" << '\n';
727  if (!tex_table_label.empty())
728  out << "\\label{" << tex_table_label << "}" << '\n';
729  out << "\\end{table}" << '\n';
730  if (with_header)
731  out << "\\end{document}" << '\n';
732 
733  // Now flush all of the data we've put into the stream to make it
734  // sure it really gets written.
735  out << std::flush;
736 }
737 
738 
739 
740 void
742 {
743  columns.clear();
744  supercolumns.clear();
745  column_order.clear();
746  tex_supercaptions.clear();
747 
748  tex_table_label.clear();
749  tex_table_caption.clear();
750 }
751 
752 
753 unsigned int
755 {
756  if (columns.size() == 0)
757  return 0;
758 
759  std::map<std::string, Column>::const_iterator col_iter = columns.begin();
760  unsigned int n = col_iter->second.entries.size();
761 
762 #ifdef DEBUG
763  std::string first_name = col_iter->first;
764  for (++col_iter; col_iter != columns.end(); ++col_iter)
765  Assert(col_iter->second.entries.size() == n,
767  col_iter->first, col_iter->second.entries.size(), first_name, n));
768 #endif
769 
770  return n;
771 }
772 
773 
774 void
775 TableHandler::get_selected_columns(std::vector<std::string> &sel_columns) const
776 {
777  sel_columns.clear();
778 
779  for (const auto &key : column_order)
780  {
781  const std::map<std::string, std::vector<std::string>>::const_iterator
782  super_iter = supercolumns.find(key);
783 
784  if (super_iter != supercolumns.end())
785  {
786  // i.e. key is a supercolumn key
787  const unsigned int n_subcolumns = super_iter->second.size();
788  for (unsigned int k = 0; k < n_subcolumns; ++k)
789  {
790  const std::string subkey = super_iter->second[k];
791  Assert(columns.count(subkey), ExcInternalError());
792  sel_columns.push_back(subkey);
793  }
794  }
795  else
796  {
797  Assert(columns.count(key), ExcInternalError());
798  // i.e. key is a column key
799  sel_columns.push_back(key);
800  }
801  }
802 }
803 
804 
805 void
807 {
808  // Figure out what is the correct (max) length of the columns
809  // so that we "shave" one off.
811  for (const auto &column : columns)
812  n = std::max(n, column.second.entries.size());
813 
814  // shave the top most element
815  if (n != 0)
816  for (auto &column : columns)
817  if (column.second.entries.size() == n)
818  column.second.entries.pop_back();
819 }
820 
821 
TableHandler::set_tex_supercaption
void set_tex_supercaption(const std::string &superkey, const std::string &tex_supercaption)
Definition: table_handler.cc:335
TableHandler::ExcSuperColumnNotExistent
static ::ExceptionBase & ExcSuperColumnNotExistent(std::string arg1)
TableHandler::set_tex_caption
void set_tex_caption(const std::string &key, const std::string &tex_caption)
Definition: table_handler.cc:309
TableHandler::Column
Definition: table_handler.h:626
TableHandler::set_scientific
void set_scientific(const std::string &key, const bool scientific)
Definition: table_handler.cc:371
StandardExceptions::ExcIO
static ::ExceptionBase & ExcIO()
TableHandler::set_tex_table_label
void set_tex_table_label(const std::string &table_label)
Definition: table_handler.cc:327
internal::Local::GetDefaultValue::operator()
void operator()(T &operand) const
Definition: table_handler.cc:115
TableHandler::set_column_order
void set_column_order(const std::vector< std::string > &new_order)
Definition: table_handler.cc:295
TableHandler::Column::pad_column_below
void pad_column_below(const unsigned int length)
Definition: table_handler.cc:159
TableHandler::set_tex_table_caption
void set_tex_table_caption(const std::string &table_caption)
Definition: table_handler.cc:319
TableHandler::Column::invalidate_cache
void invalidate_cache()
Definition: table_handler.cc:179
TableHandler::ExcColumnOrSuperColumnNotExistent
static ::ExceptionBase & ExcColumnOrSuperColumnNotExistent(std::string arg1)
internal::TableEntry::cache_string
void cache_string(bool scientific, unsigned int precision) const
Definition: table_handler.cc:82
TableHandler::tex_table_caption
std::string tex_table_caption
Definition: table_handler.h:790
internal::TableEntry::get_cached_string
const std::string & get_cached_string() const
Definition: table_handler.cc:101
TableHandler::ExcWrongNumberOfDataEntries
static ::ExceptionBase & ExcWrongNumberOfDataEntries(std::string arg1, int arg2, std::string arg3, int arg4)
TableHandler::auto_fill_mode
bool auto_fill_mode
Definition: table_handler.h:799
internal::TableEntry::get_default_constructed_copy
TableEntry get_default_constructed_copy() const
Definition: table_handler.cc:123
TableHandler::clear
void clear()
Definition: table_handler.cc:741
LAPACKSupport::T
static const char T
Definition: lapack_support.h:163
TableHandler::Column::entries
std::vector< internal::TableEntry > entries
Definition: table_handler.h:687
TableHandler::tex_table_label
std::string tex_table_label
Definition: table_handler.h:794
StandardExceptions::ExcMessage
static ::ExceptionBase & ExcMessage(std::string arg1)
TableHandler::start_new_row
void start_new_row()
Definition: table_handler.cc:217
TableHandler::org_mode_table
@ org_mode_table
Definition: table_handler.h:372
TableHandler::ExcUndefinedTexFormat
static ::ExceptionBase & ExcUndefinedTexFormat(std::string arg1)
internal::TableEntry::value
value_type value
Definition: table_handler.h:156
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
TableHandler::n_rows
unsigned int n_rows() const
Definition: table_handler.cc:754
internal::TableEntry::cached_value
std::string cached_value
Definition: table_handler.h:161
internal::TableEntry::get_numeric_value
double get_numeric_value() const
Definition: table_handler.cc:34
TableHandler::supercolumns
std::map< std::string, std::vector< std::string > > supercolumns
Definition: table_handler.h:776
TableHandler::Column::Column
Column()
Definition: table_handler.cc:147
TableHandler::table_with_headers
@ table_with_headers
Definition: table_handler.h:359
TableHandler::TableHandler
TableHandler()
Definition: table_handler.cc:196
TableHandler::set_auto_fill_mode
void set_auto_fill_mode(const bool state)
Definition: table_handler.cc:244
table_handler.h
TableHandler::table_with_separate_column_description
@ table_with_separate_column_description
Definition: table_handler.h:363
StandardExceptions::ExcInternalError
static ::ExceptionBase & ExcInternalError()
LinearAlgebra::CUDAWrappers::kernel::size_type
types::global_dof_index size_type
Definition: cuda_kernels.h:45
Assert
#define Assert(cond, exc)
Definition: exceptions.h:1419
TableHandler::tex_supercaptions
std::map< std::string, std::string > tex_supercaptions
Definition: table_handler.h:785
TableHandler::columns
std::map< std::string, Column > columns
Definition: table_handler.h:766
TableHandler::simple_table_with_separate_column_description
@ simple_table_with_separate_column_description
Definition: table_handler.h:368
TableHandler::clear_current_row
void clear_current_row()
Definition: table_handler.cc:806
TableHandler::add_column_to_supercolumn
void add_column_to_supercolumn(const std::string &key, const std::string &superkey)
Definition: table_handler.cc:251
TableHandler::set_tex_format
void set_tex_format(const std::string &key, const std::string &format="c")
Definition: table_handler.cc:346
internal
Definition: aligned_vector.h:369
TableHandler::declare_column
void declare_column(const std::string &key)
Definition: table_handler.cc:203
TableHandler::ExcColumnNotExistent
static ::ExceptionBase & ExcColumnNotExistent(std::string arg1)
internal::TableEntry
Definition: table_handler.h:56
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
internal::Local::GetDefaultValue
Definition: table_handler.cc:111
TableHandler::get_selected_columns
void get_selected_columns(std::vector< std::string > &sel_columns) const
Definition: table_handler.cc:775
AssertThrow
#define AssertThrow(cond, exc)
Definition: exceptions.h:1531
TableHandler::Column::precision
unsigned int precision
Definition: table_handler.h:710
TableHandler::write_tex
void write_tex(std::ostream &file, const bool with_header=true) const
Definition: table_handler.cc:599
Utilities::MPI::max
T max(const T &t, const MPI_Comm &mpi_communicator)
TableHandler::write_text
void write_text(std::ostream &out, const TextOutputFormat format=table_with_headers) const
Definition: table_handler.cc:383
TableHandler::column_order
std::vector< std::string > column_order
Definition: table_handler.h:757
TableHandler::set_precision
void set_precision(const std::string &key, const unsigned int precision)
Definition: table_handler.cc:358
TableHandler::TextOutputFormat
TextOutputFormat
Definition: table_handler.h:354