Intrepid2
Static Public Member Functions | List of all members
Intrepid2::ZeroView< DataScalar, DeviceType > Class Template Reference

A singleton class for a DynRankView containing exactly one zero entry. (Technically, the entry is DataScalar(), the default value for the scalar type.) This allows View-wrapping classes to return a reference to zero, even when that zero is not explicitly stored in the wrapped views. More...

#include <Intrepid2_Data.hpp>

Static Public Member Functions

static ScalarView< DataScalar,
DeviceType > 
zeroView ()
 

Detailed Description

template<class DataScalar, typename DeviceType>
class Intrepid2::ZeroView< DataScalar, DeviceType >

A singleton class for a DynRankView containing exactly one zero entry. (Technically, the entry is DataScalar(), the default value for the scalar type.) This allows View-wrapping classes to return a reference to zero, even when that zero is not explicitly stored in the wrapped views.

This is used by Interpid2::Data for its getEntry() and getWritableEntry() methods.

Note
There is no protection against the zero value being overwritten; perhaps we should add some (i.e., const-qualify DataScalar). Because of implementation details in Intrepid2::Data, we don't do so yet.

Definition at line 34 of file Intrepid2_Data.hpp.


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