Teuchos - Trilinos Tools Package
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
comm
src
Teuchos_TableColumn.cpp
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
15
TableColumn::TableColumn
(
const
Array<std::string>
& vals)
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
25
TableColumn::TableColumn
(
const
Array<double>
& vals,
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
37
TableColumn::TableColumn
(
const
Array<double>
& first,
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
57
void
TableColumn::addEntry(
const
RCP<TableEntry>
& entry_in)
58
{
59
data_.append(entry_in);
60
}
61
62
63
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Definition:
Teuchos_RCPDecl.hpp:1234
Teuchos_TableColumn.hpp
A column of TableEntry objects.
Teuchos::DoubleEntry
A table entry that is a simple double-precision number.
Definition:
Teuchos_TableEntry.hpp:65
Teuchos::StringEntry
A table entry that is a simple std::string.
Definition:
Teuchos_TableEntry.hpp:103
Teuchos::CompoundEntryWithParentheses
An entry containing two subentries, with the second to be written in parentheses after the first...
Definition:
Teuchos_TableEntry.hpp:125
Teuchos::Array::size
size_type size() const
Definition:
Teuchos_Array.hpp:1006
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:397
Teuchos::TableColumn::TableColumn
TableColumn()
Empty ctor.
Definition:
Teuchos_TableColumn.hpp:33
Teuchos::Array< std::string >
Generated on Thu Nov 21 2024 09:21:50 for Teuchos - Trilinos Tools Package by
1.8.5