BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
fn_AR_dot.hpp
Go to the documentation of this file.
1
/*
2
* BELFEM -- The Berkeley Lab Finite Element Framework
3
* Copyright (c) 2026, The Regents of the University of California,
4
* through Lawrence Berkeley National Laboratory (subject to receipt of any required
5
* approvals from the U.S. Dept. of Energy). All rights reserved.
6
*
7
* Developers: Christian Messe, Gregory Giard
8
*
9
* See the top-level LICENSE file for the complete license and disclaimer.
10
*/
11
12
#ifndef BELFEM_FN_AR_DOT_HPP
13
#define BELFEM_FN_AR_DOT_HPP
14
15
#include "
cl_AR_Vector.hpp
"
16
#include "
cl_AR_Matrix.hpp
"
17
18
namespace
belfem
19
{
20
//------------------------------------------------------------------------------
21
22
template
<
typename
T >
23
auto
24
dot
(
const
Vector< T >
& aA,
const
Vector< T >
& aB )
25
->
decltype
( arma::dot( aA.vector_data() , aB.vector_data() ) )
26
{
27
return
arma::dot( aA.vector_data() , aB.vector_data() );
28
}
29
30
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
31
32
template
<
typename
T >
33
auto
34
dot
(
const
Matrix< T >
& aA,
const
Vector< T >
& aB )
35
->
decltype
( arma::dot( aA.matrix_data() , aB.vector_data() ) )
36
{
37
return
arma::dot( aA.matrix_data() , aB.vector_data() );
38
}
39
40
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
41
42
template
<
typename
T >
43
auto
44
dot
(
const
Vector< T >
& aA,
const
Matrix< T >
& aB )
45
->
decltype
( arma::dot( aA.vector_data() , aB.matrix_data() ) )
46
{
47
return
arma::dot( aA.vector_data() , aB.matrix_data() );
48
}
49
50
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51
52
template
<
typename
ET >
53
auto
54
dot
(
const
ET & aA,
const
ET & aB )
55
->
decltype
( arma::dot( aA , aB ) )
56
{
57
return
arma::dot( aA , aB );
58
}
59
60
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
61
62
template
<
typename
T,
typename
ET >
63
auto
64
dot
(
Vector< T >
& aA,
const
ET & aB)
65
->decltype( arma::dot( aA.vector_data(), aB) )
66
{
67
return
arma::dot( aA.vector_data(), aB );
68
}
69
70
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
71
72
template
<
typename
ET,
typename
T >
73
auto
74
dot
(
const
ET & aA,
const
Vector< T >
& aB )
75
->decltype( arma::dot( aA, aB.vector_data() ) )
76
{
77
return
arma::dot( aA, aB.vector_data() );
78
}
79
80
//------------------------------------------------------------------------------
81
}
82
#endif
//BELFEM_FN_AR_DOT_HPP
cl_AR_Matrix.hpp
cl_AR_Vector.hpp
belfem::Matrix
Dense column-major matrix.
Definition
cl_BZ_Matrix.hpp:28
belfem::Vector
Column vector.
Definition
cl_BZ_Vector.hpp:41
belfem::dot
auto dot(const Vector< T > &aA, const Vector< T > &aB) -> decltype(arma::dot(aA.vector_data(), aB.vector_data()))
Scalar product of two vectors.
Definition
fn_AR_dot.hpp:24
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
src
linalg
armadillo
fn_AR_dot.hpp
Generated by
1.18.0