Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_TableColumn.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "Teuchos_TableColumn.hpp"
11 
12 using namespace Teuchos;
13 
14 
16  : data_(vals.size())
17 {
18  for (Array<std::string>::size_type i=0; i<vals.size(); i++)
19  {
20  data_[i] = rcp(new StringEntry(vals[i]));
21  }
22 }
23 
24 
26  int precision,
27  const std::ios_base::fmtflags& flags)
28  : data_(vals.size())
29 {
30  for (Array<double>::size_type i=0; i<vals.size(); i++)
31  {
32  data_[i] = rcp(new DoubleEntry(vals[i], precision, flags));
33  }
34 }
35 
36 
38  const Array<double>& second,
39  int precision,
40  const std::ios_base::fmtflags& flags,
41  bool spaceBeforeParentheses)
42  : data_(first.size())
43 {
44  std::ios_base::fmtflags fixedflags = flags;
45  fixedflags &= ~std::cout.scientific; // unset scientific
46  fixedflags &= ~std::cout.fixed; // unset fixed
47  for (Array<double>::size_type i=0; i<first.size(); i++)
48  {
49  RCP<DoubleEntry> x1 = rcp(new DoubleEntry(first[i], precision, flags));
50  RCP<DoubleEntry> x2 = rcp(new DoubleEntry(second[i], precision, fixedflags));
51  data_[i]
52  = rcp(new CompoundEntryWithParentheses(x1, x2,
53  spaceBeforeParentheses));
54  }
55 }
56 
58 {
59  data_.append(entry_in);
60 }
61 
62 
63 
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
A column of TableEntry objects.
A table entry that is a simple double-precision number.
A table entry that is a simple std::string.
An entry containing two subentries, with the second to be written in parentheses after the first...
void addEntry(const RCP< TableEntry > &entry)
size_type size() const
Array< RCP< TableEntry > > data_
Smart reference counting pointer class for automatic garbage collection.