Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
expressions
DenseVector.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_EXPRESSIONS_DENSEVECTOR_H_
36
#define _BLAZE_MATH_EXPRESSIONS_DENSEVECTOR_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/expressions/Vector.h
>
44
#include <
blaze/math/typetraits/HasConstDataAccess.h
>
45
#include <
blaze/math/typetraits/HasMutableDataAccess.h
>
46
#include <
blaze/system/Inline.h
>
47
#include <
blaze/util/EnableIf.h
>
48
#include <
blaze/util/MaybeUnused.h
>
49
50
51
namespace
blaze {
52
53
//=================================================================================================
54
//
55
// CLASS DEFINITION
56
//
57
//=================================================================================================
58
59
//*************************************************************************************************
73
template
<
typename
VT
// Type of the dense vector
74
,
bool
TF >
// Transpose flag
75
class
DenseVector
76
:
public
Vector<VT,TF>
77
{
78
protected
:
79
//**Special member functions********************************************************************
82
DenseVector() =
default
;
83
DenseVector(
const
DenseVector& ) =
default
;
84
DenseVector( DenseVector&& ) =
default
;
85
~DenseVector() =
default
;
86
DenseVector& operator=(
const
DenseVector& ) =
default
;
87
DenseVector& operator=( DenseVector&& ) =
default
;
89
//**********************************************************************************************
90
};
91
//*************************************************************************************************
92
93
94
95
96
//=================================================================================================
97
//
98
// GLOBAL FUNCTIONS
99
//
100
//=================================================================================================
101
102
//*************************************************************************************************
105
template
<
typename
VT,
bool
TF >
106
typename
VT::ElementType*
data
(
DenseVector<VT,TF>
& dv )
noexcept
;
107
108
template
<
typename
VT,
bool
TF >
109
const
typename
VT::ElementType*
data
(
const
DenseVector<VT,TF>
& dv )
noexcept
;
111
//*************************************************************************************************
112
113
114
//*************************************************************************************************
125
template
<
typename
VT
// Type of the vector
126
,
bool
TF >
// Transpose flag of the vector
127
BLAZE_ALWAYS_INLINE
auto
data_backend(
DenseVector<VT,TF>
& dv )
noexcept
128
->
DisableIf_t< HasMutableDataAccess_v<VT>
,
typename
VT::ElementType* >
129
{
130
MAYBE_UNUSED
( dv );
131
132
return
nullptr
;
133
}
135
//*************************************************************************************************
136
137
138
//*************************************************************************************************
148
template
<
typename
VT
// Type of the vector
149
,
bool
TF >
// Transpose flag of the vector
150
BLAZE_ALWAYS_INLINE
auto
data_backend( DenseVector<VT,TF>& dv )
noexcept
151
->
EnableIf_t< HasMutableDataAccess_v<VT>
,
typename
VT::ElementType* >
152
{
153
return
(*dv).data();
154
}
156
//*************************************************************************************************
157
158
159
//*************************************************************************************************
172
template
<
typename
VT
// Type of the vector
173
,
bool
TF >
// Transpose flag of the vector
174
BLAZE_ALWAYS_INLINE
typename
VT::ElementType*
data
(
DenseVector<VT,TF>
& dv )
noexcept
175
{
176
return
data_backend( *dv );
177
}
178
//*************************************************************************************************
179
180
181
//*************************************************************************************************
192
template
<
typename
VT
// Type of the vector
193
,
bool
TF >
// Transpose flag of the vector
194
BLAZE_ALWAYS_INLINE
auto
data_backend(
const
DenseVector<VT,TF>& dv )
noexcept
195
->
DisableIf_t< HasConstDataAccess_v<VT>
,
const
typename
VT::ElementType* >
196
{
197
MAYBE_UNUSED
( dv );
198
199
return
nullptr
;
200
}
202
//*************************************************************************************************
203
204
205
//*************************************************************************************************
215
template
<
typename
VT
// Type of the vector
216
,
bool
TF >
// Transpose flag of the vector
217
BLAZE_ALWAYS_INLINE
auto
data_backend(
const
DenseVector<VT,TF>
& dv )
noexcept
218
->
EnableIf_t< HasConstDataAccess_v<VT>
,
const
typename
VT::ElementType* >
219
{
220
return
(*dv).data();
221
}
223
//*************************************************************************************************
224
225
226
//*************************************************************************************************
239
template
<
typename
VT
// Type of the vector
240
,
bool
TF >
// Transpose flag of the vector
241
BLAZE_ALWAYS_INLINE
const
typename
VT::ElementType*
data
(
const
DenseVector<VT,TF>
& dv )
noexcept
242
{
243
return
data_backend( *dv );
244
}
245
//*************************************************************************************************
246
247
}
// namespace blaze
248
249
#endif
EnableIf.h
Header file for the EnableIf class template.
HasConstDataAccess.h
Header file for the HasConstDataAccess type trait.
HasMutableDataAccess.h
Header file for the HasMutableDataAccess type trait.
MaybeUnused.h
Header file for the MAYBE_UNUSED function template.
blaze::DenseVector
Base class for N-dimensional dense vectors.
Definition
DenseVector.h:77
Vector.h
Header file for the Vector CRTP base class.
blaze::data
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition
DenseMatrix.h:182
BLAZE_ALWAYS_INLINE
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition
Inline.h:85
blaze::MAYBE_UNUSED
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition
MaybeUnused.h:81
blaze::EnableIf_t
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:138
blaze::DisableIf_t
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:175
Inline.h
System settings for the inline keywords.
Generated by
1.18.0