xtensor
Loading...
Searching...
No Matches
xt::xfiltration< ECT, CCT > Class Template Reference

Filter of a xexpression for fast scalar assign. More...

#include <xindex_view.hpp>

Public Types

using self_type = xfiltration<ECT, CCT>
 
using xexpression_type = std::decay_t<ECT>
 
using const_reference = typename xexpression_type::const_reference
 

Public Member Functions

template<class E >
disable_xexpression< E, self_type & > operator= (const E &)
 
template<class E >
disable_xexpression< E, self_type & > operator+= (const E &)
 
template<class E >
disable_xexpression< E, self_type & > operator-= (const E &)
 
template<class E >
disable_xexpression< E, self_type & > operator*= (const E &)
 
template<class E >
disable_xexpression< E, self_type & > operator/= (const E &)
 
template<class E >
disable_xexpression< E, self_type & > operator%= (const E &)
 
Constructor
template<class ECTA , class CCTA >
 xfiltration (ECTA &&e, CCTA &&condition)
 Constructs a xfiltration on the given expression e, selecting the elements matching the specified condition.
 
Extended copy semantic
template<class E >
auto operator= (const E &e) -> disable_xexpression< E, self_type & >
 Assigns the scalar e to *this.
 
Computed assignement
template<class E >
auto operator+= (const E &e) -> disable_xexpression< E, self_type & >
 Adds the scalar e to *this.
 
template<class E >
auto operator-= (const E &e) -> disable_xexpression< E, self_type & >
 Subtracts the scalar e from *this.
 
template<class E >
auto operator*= (const E &e) -> disable_xexpression< E, self_type & >
 Multiplies *this with the scalar e.
 
template<class E >
auto operator/= (const E &e) -> disable_xexpression< E, self_type & >
 Divides *this by the scalar e.
 
template<class E >
auto operator%= (const E &e) -> disable_xexpression< E, self_type & >
 Computes the remainder of *this after division by the scalar e.
 
template<class F >
auto apply (F &&func) -> self_type &
 

Detailed Description

template<class ECT, class CCT>
class xt::xfiltration< ECT, CCT >

Filter of a xexpression for fast scalar assign.

The xfiltration class implements a lazy filtration of a multidimentional xexpression, optimized for scalar and computed scalar assignments. Actually, the xfiltration class IS NOT an xexpression and the scalar and computed scalar assignments are the only method it provides. The filtering condition is not evaluated until the filtration is assigned.

xfiltration is not meant to be used directly, but only with the filtration helper function.

Template Parameters
ECTthe closure type of the xexpression type underlying this filtration
CCRthe closure type of the filtering xexpression type
See also
filtration

Definition at line 233 of file xindex_view.hpp.

Member Typedef Documentation

◆ const_reference

template<class ECT , class CCT >
using xt::xfiltration< ECT, CCT >::const_reference = typename xexpression_type::const_reference

Definition at line 239 of file xindex_view.hpp.

◆ self_type

template<class ECT , class CCT >
using xt::xfiltration< ECT, CCT >::self_type = xfiltration<ECT, CCT>

Definition at line 237 of file xindex_view.hpp.

◆ xexpression_type

template<class ECT , class CCT >
using xt::xfiltration< ECT, CCT >::xexpression_type = std::decay_t<ECT>

Definition at line 238 of file xindex_view.hpp.

Constructor & Destructor Documentation

◆ xfiltration()

template<class ECT , class CCT >
template<class ECTA , class CCTA >
xt::xfiltration< ECT, CCT >::xfiltration ( ECTA && e,
CCTA && condition )
inline

Constructs a xfiltration on the given expression e, selecting the elements matching the specified condition.

Parameters
ethe xexpression to filter.
conditionthe filtering xexpression to apply.

Definition at line 640 of file xindex_view.hpp.

Member Function Documentation

◆ apply()

template<class ECT , class CCT >
template<class F >
auto xt::xfiltration< ECT, CCT >::apply ( F && func) -> self_type&
inline

Definition at line 762 of file xindex_view.hpp.

◆ operator%=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator%= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Computes the remainder of *this after division by the scalar e.

Parameters
ethe scalar involved in the operation.
Returns
a reference to *this.

Definition at line 750 of file xindex_view.hpp.

◆ operator*=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator*= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Multiplies *this with the scalar e.

Parameters
ethe scalar involved in the operation.
Returns
a reference to *this.

Definition at line 716 of file xindex_view.hpp.

◆ operator+=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator+= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Adds the scalar e to *this.

Parameters
ethe scalar to add.
Returns
a reference to *this.

Definition at line 682 of file xindex_view.hpp.

◆ operator-=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator-= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Subtracts the scalar e from *this.

Parameters
ethe scalar to subtract.
Returns
a reference to *this.

Definition at line 699 of file xindex_view.hpp.

◆ operator/=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator/= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Divides *this by the scalar e.

Parameters
ethe scalar involved in the operation.
Returns
a reference to *this.

Definition at line 733 of file xindex_view.hpp.

◆ operator=()

template<class ECT , class CCT >
template<class E >
auto xt::xfiltration< ECT, CCT >::operator= ( const E & e) -> disable_xexpression<E, self_type&>
inline

Assigns the scalar e to *this.

Parameters
ethe scalar to assign.
Returns
a reference to \ *this.

Definition at line 659 of file xindex_view.hpp.


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