Stokhos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
Stokhos_Dense3TensorImp.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Stokhos Package
4
//
5
// Copyright 2009 NTESS and the Stokhos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
template
<
typename
ordinal_type,
typename
value_type>
11
Stokhos::Dense3Tensor<ordinal_type, value_type>::
12
Dense3Tensor
(
ordinal_type
sz) :
13
l(sz),
14
Cijk_values(l*l*l)
15
{
16
}
17
18
template
<
typename
ordinal_type,
typename
value_type>
19
Stokhos::Dense3Tensor<ordinal_type, value_type>::
20
~Dense3Tensor
()
21
{
22
}
23
24
template
<
typename
ordinal_type,
typename
value_type>
25
ordinal_type
26
Stokhos::Dense3Tensor<ordinal_type, value_type>::
27
size
()
const
28
{
29
return
l;
30
}
31
32
template
<
typename
ordinal_type,
typename
value_type>
33
const
value_type
&
34
Stokhos::Dense3Tensor<ordinal_type, value_type>::
35
operator()
(
ordinal_type
i,
ordinal_type
j
,
ordinal_type
k)
const
36
{
37
return
Cijk_values[ l*(l*k +
j
) + i ];
38
}
39
40
template
<
typename
ordinal_type,
typename
value_type>
41
value_type
&
42
Stokhos::Dense3Tensor<ordinal_type, value_type>::
43
operator()
(
ordinal_type
i,
ordinal_type
j
,
ordinal_type
k)
44
{
45
return
Cijk_values[ l*(l*k +
j
) + i ];
46
}
47
48
template
<
typename
ordinal_type,
typename
value_type>
49
ordinal_type
50
Stokhos::Dense3Tensor<ordinal_type, value_type>::
51
num_values
(
ordinal_type
k)
const
52
{
53
return
l*l;
54
}
55
56
template
<
typename
ordinal_type,
typename
value_type>
57
void
58
Stokhos::Dense3Tensor<ordinal_type, value_type>::
59
value
(
ordinal_type
k,
ordinal_type
ll,
60
ordinal_type
& i,
ordinal_type
&
j
,
value_type
& c)
const
61
{
62
j = ll/l;
63
i = ll-j*l;
64
c = triple_value(i,j,k);
65
}
66
67
template
<
typename
ordinal_type,
typename
value_type>
68
void
69
Stokhos::Dense3Tensor<ordinal_type, value_type>::
70
print
(std::ostream& os)
const
71
{
72
for
(
ordinal_type
i=0; i<l; i++)
73
for
(
ordinal_type
j
=0;
j
<l;
j
++)
74
for
(
ordinal_type
k=0; k<l; k++)
75
os <<
"i = "
<< i <<
", j = "
<<
j
<<
", k = "
<< k <<
", Dijk = "
76
<<
operator
()(i,
j
,k) << std::endl;
77
}
Stokhos::Dense3Tensor::print
void print(std::ostream &os) const
Print tensor.
Definition:
Stokhos_Dense3TensorImp.hpp:70
Stokhos::Dense3Tensor::size
ordinal_type size() const
Return size.
Definition:
Stokhos_Dense3TensorImp.hpp:27
Stokhos::Dense3Tensor::num_values
ordinal_type num_values(ordinal_type k) const
Return number of non-zero's in Cijk for a given k.
Definition:
Stokhos_Dense3TensorImp.hpp:51
j
j
Definition:
Sacado_Fad_Exp_MP_Vector.hpp:495
TotalOrderBasisUnitTest::value_type
double value_type
Definition:
Stokhos_LexicographicTreeBasisUnitTest.cpp:38
Stokhos::Dense3Tensor::~Dense3Tensor
~Dense3Tensor()
Destructor.
Definition:
Stokhos_Dense3TensorImp.hpp:20
Stokhos::Dense3Tensor::operator()
const value_type & operator()(ordinal_type i, ordinal_type j, ordinal_type k) const
Get value (i,j,k)
Definition:
Stokhos_Dense3TensorImp.hpp:35
Stokhos::Dense3Tensor::Dense3Tensor
Dense3Tensor(ordinal_type sz)
Constructor.
Definition:
Stokhos_Dense3TensorImp.hpp:12
Stokhos::Dense3Tensor::value
void value(ordinal_type k, ordinal_type l, ordinal_type &i, ordinal_type &j, value_type &c) const
Get value (i,j,k) using sparse access.
Definition:
Stokhos_Dense3TensorImp.hpp:59
TotalOrderBasisUnitTest::ordinal_type
int ordinal_type
Definition:
Stokhos_LexicographicTreeBasisUnitTest.cpp:37
Generated on Fri May 30 2025 09:19:56 for Stokhos Package Browser (Single Doxygen Collection) by
1.8.5