xtensor
Loading...
Searching...
No Matches
xt::squared_norm_type< T > Struct Template Reference

Traits class for the result type of the norm_sq() function. More...

#include <xnorm.hpp>

Inheritance diagram for xt::squared_norm_type< T >:
xt::traits_detail::norm_type_base< T >

Public Types

using base_type = traits_detail::norm_type_base<T>
 
using type
 
- Public Types inherited from xt::traits_detail::norm_type_base< T >
using T
 
using norm_of_scalar
 
using norm_of_vector
 

Additional Inherited Members

- Static Public Attributes inherited from xt::traits_detail::norm_type_base< T >
static const bool value
 

Detailed Description

template<class T>
struct xt::squared_norm_type< T >

Traits class for the result type of the norm_sq() function.

Member 'type' defines the result of norm_sq(t), where t is of type

Template Parameters
T.It implements the following rules designed to minimize the potential for overflow:
Tis an arithmetic type: 'type' is the result type of t*t.
Tis a container of 'long double' elements: 'type' is long double.
Tis a container of another floating-point type: 'type' is double.
Tis a container of integer elements: 'type' is uint64_t.
Tis a container of some other type: 'type' is the element's squared norm type,

Containers are recognized by having an embedded typedef 'value_type'. To change the behavior for a case not covered here, specialize the traits_detail::norm_type_base template.

Definition at line 186 of file xnorm.hpp.

Member Typedef Documentation

◆ base_type

Definition at line 188 of file xnorm.hpp.

◆ type

template<class T >
using xt::squared_norm_type< T >::type
Initial value:
typename std::conditional<
base_type::norm_of_vector::value,
typename base_type::norm_of_vector::squared_norm_type,
typename base_type::norm_of_scalar::squared_norm_type>::type

Definition at line 190 of file xnorm.hpp.


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