v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FTensor::One< T > Class Template Reference

Stateless vector whose components are all equal to one. More...

#include "src/ftensor/src/FTensor/One.hpp"

Public Member Functions

constexpr T operator() (const int) const
 
template<char i, int Dim>
Tensor1_Expr< One< T >, T, Dim, ioperator() (const Index< i, Dim > &) const
 

Detailed Description

template<class T = int>
class FTensor::One< T >

Stateless vector whose components are all equal to one.

Contracting this expression with a Tensor1 sums its components:

Index<'i', 3> i;
One<> t_one;
const auto sum = t_v(i) * t_one(i);
Stateless vector whose components are all equal to one.
Definition One.hpp:22
FTensor::Index< 'i', SPACE_DIM > i
Template Parameters
TComponent type

Definition at line 22 of file One.hpp.

Member Function Documentation

◆ operator()() [1/2]

template<class T = int>
template<char i, int Dim>
Tensor1_Expr< One< T >, T, Dim, i > FTensor::One< T >::operator() ( const Index< i, Dim > &  ) const
inline

Definition at line 28 of file One.hpp.

28 {
29 return Tensor1_Expr<One<T>, T, Dim, i>(*this);
30 }

◆ operator()() [2/2]

template<class T = int>
constexpr T FTensor::One< T >::operator() ( const int  ) const
inlineconstexpr

Definition at line 24 of file One.hpp.

24{ return T(1); }

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