Tenncor
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eteq::Variable< T > Struct Template Referencefinal

Leaf node implementation containing mutable Eigen data. More...

#include <variable.hpp>

Inheritance diagram for eteq::Variable< T >:
Inheritance graph
[legend]
Collaboration diagram for eteq::Variable< T >:
Collaboration graph
[legend]

Public Member Functions

Variable< T > & operator= (const Variable< T > &other)=default
 
Variable< T > & operator= (Variable< T > &&other)=default
 
Variable< T > & operator= (std::vector< T > input)
 Assign vectorized data to data source. More...
 
Variable< T > & operator= (const TensorT< T > &input)
 Assign Eigen tensor to internal data object. More...
 
void assign (const void *input, egen::_GENERATED_DTYPE dtype, teq::Shape shape)
 Assign void pointer of specified data type enum and shape. More...
 
std::string to_string (void) const override
 Implementation of iTensor. More...
 
bool is_const (void) const override
 Implementation of iLeaf. More...
 
- Public Member Functions inherited from eteq::iLeaf< T >
virtual ~iLeaf (void)=default
 
const teq::Shapeshape (void) const override
 Implementation of iTensor. More...
 
void * data (void) override
 Implementation of iData. More...
 
const void * data (void) const override
 Implementation of iData. More...
 
size_t type_code (void) const override
 Implementation of iData. More...
 
std::string type_label (void) const override
 Implementation of iData. More...
 
size_t nbytes (void) const override
 Implementation of iData. More...
 
- Public Member Functions inherited from teq::iLeaf
void accept (iTraveler &visiter) override
 Implementation of iTensor. More...
 
- Public Member Functions inherited from teq::iTensor
virtual ~iTensor (void)=default
 
- Public Member Functions inherited from teq::iData
virtual ~iData (void)=default
 

Static Public Member Functions

static Variable< T > * get (T *ptr, teq::Shape shape, std::string label="")
 Return Variable given raw pointer array whose size is denoted by shape. More...
 
static Variable< T > * get (teq::Shape shape, std::string label="")
 Return zero-initialized Variable of specified shape. More...
 
static Variable< T > * get (T scalar, teq::Shape shape, std::string label="")
 Return scalar-initialized Variable of specified shape. More...
 
static Variable< T > * get (std::vector< T > data, teq::Shape shape, std::string label="")
 Return Variable whose data is initialized by vector data. More...
 
static Variable< T > * get (const Variable< T > &other)
 Return deep copy of other Variable. More...
 
static Variable< T > * get (Variable< T > &&other)
 Return move of other Variable. More...
 

Public Attributes

std::string label_
 Label for distinguishing variable nodes. More...
 

Private Member Functions

 Variable (T *data, teq::Shape shape, std::string label)
 
 Variable (const Variable< T > &other)=default
 
 Variable (Variable< T > &&other)=default
 

Additional Inherited Members

- Protected Member Functions inherited from eteq::iLeaf< T >
 iLeaf (T *data, teq::Shape shape)
 
- Protected Attributes inherited from eteq::iLeaf< T >
TensorT< T > data_
 Data Source. More...
 
teq::Shape shape_
 Shape utility to avoid excessive conversion between data_.dimensions() More...
 

Detailed Description

template<typename T>
struct eteq::Variable< T >

Leaf node implementation containing mutable Eigen data.

Constructor & Destructor Documentation

◆ Variable() [1/3]

template<typename T>
eteq::Variable< T >::Variable ( T *  data,
teq::Shape  shape,
std::string  label 
)
inlineprivate

◆ Variable() [2/3]

template<typename T>
eteq::Variable< T >::Variable ( const Variable< T > &  other)
privatedefault

◆ Variable() [3/3]

template<typename T>
eteq::Variable< T >::Variable ( Variable< T > &&  other)
privatedefault

Member Function Documentation

◆ assign()

template<typename T>
void eteq::Variable< T >::assign ( const void *  input,
egen::_GENERATED_DTYPE  dtype,
teq::Shape  shape 
)
inline

Assign void pointer of specified data type enum and shape.

◆ get() [1/6]

template<typename T >
Variable< T > * eteq::Variable< T >::get ( T *  ptr,
teq::Shape  shape,
std::string  label = "" 
)
static

Return Variable given raw pointer array whose size is denoted by shape.

◆ get() [2/6]

template<typename T>
static Variable<T>* eteq::Variable< T >::get ( teq::Shape  shape,
std::string  label = "" 
)
inlinestatic

Return zero-initialized Variable of specified shape.

◆ get() [3/6]

template<typename T>
static Variable<T>* eteq::Variable< T >::get ( scalar,
teq::Shape  shape,
std::string  label = "" 
)
inlinestatic

Return scalar-initialized Variable of specified shape.

◆ get() [4/6]

template<typename T>
static Variable<T>* eteq::Variable< T >::get ( std::vector< T >  data,
teq::Shape  shape,
std::string  label = "" 
)
inlinestatic

Return Variable whose data is initialized by vector data.

◆ get() [5/6]

template<typename T>
static Variable<T>* eteq::Variable< T >::get ( const Variable< T > &  other)
inlinestatic

Return deep copy of other Variable.

◆ get() [6/6]

template<typename T>
static Variable<T>* eteq::Variable< T >::get ( Variable< T > &&  other)
inlinestatic

Return move of other Variable.

◆ is_const()

template<typename T>
bool eteq::Variable< T >::is_const ( void  ) const
inlineoverridevirtual

Implementation of iLeaf.

Implements teq::iLeaf.

◆ operator=() [1/4]

template<typename T>
Variable<T>& eteq::Variable< T >::operator= ( const Variable< T > &  other)
default

◆ operator=() [2/4]

template<typename T>
Variable<T>& eteq::Variable< T >::operator= ( Variable< T > &&  other)
default

◆ operator=() [3/4]

template<typename T>
Variable<T>& eteq::Variable< T >::operator= ( std::vector< T >  input)
inline

Assign vectorized data to data source.

◆ operator=() [4/4]

template<typename T>
Variable<T>& eteq::Variable< T >::operator= ( const TensorT< T > &  input)
inline

Assign Eigen tensor to internal data object.

◆ to_string()

template<typename T>
std::string eteq::Variable< T >::to_string ( void  ) const
inlineoverridevirtual

Implementation of iTensor.

Implements teq::iTensor.

Member Data Documentation

◆ label_

template<typename T>
std::string eteq::Variable< T >::label_

Label for distinguishing variable nodes.


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