Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
numerics
src
Teuchos_PolynomialTraits.hpp
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
#ifndef TEUCHOS_POLYNOMIAL_TRAITS_HPP
11
#define TEUCHOS_POLYNOMIAL_TRAITS_HPP
12
13
#include "
Teuchos_RCP.hpp
"
14
15
namespace
Teuchos
{
16
18
25
template
<
typename
Scalar>
26
class
PolynomialTraits
{
27
public
:
28
30
typedef
Scalar
coeff_type
;
31
33
typedef
Scalar
scalar_type
;
34
36
static
inline
Teuchos::RCP<coeff_type>
clone
(
const
coeff_type
& c) {
37
return
Teuchos::rcp
(
new
coeff_type
(c));
38
}
39
41
static
inline
void
copy
(
const
coeff_type
& x,
coeff_type
* y) {
42
*y = x;
43
}
44
46
static
inline
void
assign
(
coeff_type
* y,
const
scalar_type
& alpha) {
47
*y = alpha;
48
}
49
51
static
inline
void
update
(
coeff_type
* y,
const
coeff_type
& x,
52
const
scalar_type
& beta) {
53
*y = x + beta*(*y);
54
}
55
56
};
// class PolynomialTraits
57
58
}
// end namespace Teuchos
59
60
#endif
// TEUCHOS_POLYNOMIAL_TRAITS_HPP
Teuchos_RCP.hpp
Reference-counted pointer class and non-member templated function implementations.
Teuchos::PolynomialTraits
Traits class for polynomial coefficients in Teuchos::Polynomial.
Definition
Teuchos_PolynomialTraits.hpp:26
Teuchos::scalar_type::coeff_type
coeff_type coeff_type
Definition
Teuchos_PolynomialTraits.hpp:30
Teuchos::PolynomialTraits::assign
static void assign(coeff_type *y, const scalar_type &alpha)
Assign a scalar to a coefficient.
Definition
Teuchos_PolynomialTraits.hpp:46
Teuchos::PolynomialTraits::update
static void update(coeff_type *y, const coeff_type &x, const scalar_type &beta)
y = x + beta*y
Definition
Teuchos_PolynomialTraits.hpp:51
Teuchos::scalar_type::scalar_type
coeff_type scalar_type
Definition
Teuchos_PolynomialTraits.hpp:33
Teuchos::PolynomialTraits::copy
static void copy(const coeff_type &x, coeff_type *y)
Copy a coefficient.
Definition
Teuchos_PolynomialTraits.hpp:41
Teuchos::PolynomialTraits::clone
static Teuchos::RCP< coeff_type > clone(const coeff_type &c)
Clone a coefficient.
Definition
Teuchos_PolynomialTraits.hpp:36
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Teuchos::rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Definition
Teuchos_RCPDecl.hpp:1234
Generated by
1.17.0