v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim > Class Template Reference

#include "src/ftensor/src/FTensor/Tensor1/Tensor1_pointer.hpp"

Collaboration diagram for FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >:
[legend]

Public Member Functions

 Tensor1 (T *d)
 
 Tensor1 ()=delete
 
Tensor1< T, Tensor_Dim > normalize ()
 
T l2 () const
 
template<int Current_Dim>
T l2_squared (const Number< Current_Dim > &) const
 
T l2_squared (const Number< 1 > &) const
 
T & operator() (const int N)
 
T operator() (const int N) const
 
T * ptr (const int N) const
 
template<char i, int Dim>
Tensor1_Expr< Self, T, Dim, i > operator() (const Index< i, Dim > &index)
 
template<char i, int Dim>
Tensor1_Expr< const Self, T, Dim, i > operator() (const Index< i, Dim > &index) const
 
const Tensor1 & operator++ () const
 

Private Types

using Self = Tensor1< CursorPtr< T *, G >, Tensor_Dim >
 

Private Attributes

T *restrict data
 

Detailed Description

template<class T, int Tensor_Dim, int G>
class FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >

Definition at line 199 of file Tensor1_pointer.hpp.

Member Typedef Documentation

◆ Self

template<class T , int Tensor_Dim, int G>
using FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::Self = Tensor1<CursorPtr<T *, G>, Tensor_Dim>
private

Definition at line 201 of file Tensor1_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/2]

template<class T , int Tensor_Dim, int G>
FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::Tensor1 ( T *  d)
inlineexplicit

Definition at line 206 of file Tensor1_pointer.hpp.

206: data(d) {}
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition dTensor0.hpp:27

◆ Tensor1() [2/2]

template<class T , int Tensor_Dim, int G>
FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::Tensor1 ( )
delete

Member Function Documentation

◆ l2()

template<class T , int Tensor_Dim, int G>
T FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::l2 ( ) const
inline

Definition at line 216 of file Tensor1_pointer.hpp.

216{ return sqrt(l2_squared(Number<Tensor_Dim>())); }
T l2_squared(const Number< Current_Dim > &) const

◆ l2_squared() [1/2]

template<class T , int Tensor_Dim, int G>
T FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::l2_squared ( const Number< 1 > &  ) const
inline

Definition at line 222 of file Tensor1_pointer.hpp.

222{ return (*data) * (*data); }

◆ l2_squared() [2/2]

template<class T , int Tensor_Dim, int G>
template<int Current_Dim>
T FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::l2_squared ( const Number< Current_Dim > &  ) const
inline

Definition at line 218 of file Tensor1_pointer.hpp.

218 {
219 return (*(data + Current_Dim - 1)) * (*(data + Current_Dim - 1)) +
220 l2_squared(Number<Current_Dim - 1>());
221 }

◆ normalize()

template<class T , int Tensor_Dim, int G>
Tensor1< T, Tensor_Dim > FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::normalize ( )
inline

Definition at line 210 of file Tensor1_pointer.hpp.

210 {
211 const Index<'a', Tensor_Dim> a;
212 (*this)(a) /= l2();
213 return *this;
214 }
constexpr double a

◆ operator()() [1/4]

template<class T , int Tensor_Dim, int G>
template<char i, int Dim>
Tensor1_Expr< Self, T, Dim, i > FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::operator() ( const Index< i, Dim > &  index)
inline

Definition at line 261 of file Tensor1_pointer.hpp.

261 {
262 return Tensor1_Expr<Self, T, Dim, i>(*this);
263 }

◆ operator()() [2/4]

template<class T , int Tensor_Dim, int G>
template<char i, int Dim>
Tensor1_Expr< const Self, T, Dim, i > FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::operator() ( const Index< i, Dim > &  index) const
inline

Definition at line 267 of file Tensor1_pointer.hpp.

267 {
269 }

◆ operator()() [3/4]

template<class T , int Tensor_Dim, int G>
T & FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::operator() ( const int  N)
inline

Definition at line 224 of file Tensor1_pointer.hpp.

224 {
225#ifdef FTENSOR_DEBUG
226 if (N >= Tensor_Dim || N < 0) {
227 std::stringstream s;
228 s << "Bad index in Tensor1<CursorPtr<T*," << G << ">," << Tensor_Dim
229 << ">.operator(" << N << ")" << std::endl;
230 throw std::out_of_range(s.str());
231 }
232#endif
233 return *(data + N);
234 }
constexpr IntegrationType G
Definition level_set.cpp:33
const int N
Definition speed_test.cpp:3

◆ operator()() [4/4]

template<class T , int Tensor_Dim, int G>
T FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::operator() ( const int  N) const
inline

Definition at line 236 of file Tensor1_pointer.hpp.

236 {
237#ifdef FTENSOR_DEBUG
238 if (N >= Tensor_Dim || N < 0) {
239 std::stringstream s;
240 s << "Bad index in Tensor1<CursorPtr<T*," << G << ">," << Tensor_Dim
241 << ">.operator(" << N << ") const" << std::endl;
242 throw std::out_of_range(s.str());
243 }
244#endif
245 return *(data + N);
246 }

◆ operator++()

template<class T , int Tensor_Dim, int G>
const Tensor1 & FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::operator++ ( ) const
inline

Definition at line 271 of file Tensor1_pointer.hpp.

271 {
272 data += G;
273 return *this;
274 }

◆ ptr()

template<class T , int Tensor_Dim, int G>
T * FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::ptr ( const int  N) const
inline

Definition at line 248 of file Tensor1_pointer.hpp.

248 {
249#ifdef FTENSOR_DEBUG
250 if (N >= Tensor_Dim || N < 0) {
251 std::stringstream s;
252 s << "Bad index in Tensor1<CursorPtr<T*," << G << ">," << Tensor_Dim
253 << ">.ptr(" << N << ")" << std::endl;
254 throw std::out_of_range(s.str());
255 }
256#endif
257 return data + N;
258 }

Member Data Documentation

◆ data

template<class T , int Tensor_Dim, int G>
T* restrict FTensor::Tensor1< CursorPtr< T *, G >, Tensor_Dim >::data
mutableprivate

Definition at line 203 of file Tensor1_pointer.hpp.


The documentation for this class was generated from the following file: