Minsky
|
compute the reduction along the indicated dimension, ignoring any missing entry (NaNs) More...
#include <tensorOp.h>
Classes | |
struct | SOI |
Public Member Functions | |
template<class F > | |
ReductionOp (F f, double init, const TensorPtr &arg={}, const std::string &dimName="") | |
void | setArgument (const TensorPtr &a, const ITensor::Args &) override |
double | operator[] (std::size_t i) const override |
return or compute data at a location More... | |
![]() | |
template<class F > | |
ReduceAllOp (F f, double init, const std::shared_ptr< ITensor > &arg={}) | |
Timestamp | timestamp () const override |
timestamp indicating how old the dependendent data might be. Used in CachedTensorOp to determine when to invalidate the cache More... | |
![]() | |
CLASSDESC_ACCESS (ITensor) | |
ITensor () | |
ITensor (const Hypercube &hc) | |
ITensor (Hypercube &&hc) | |
ITensor (const std::vector< unsigned > &dims) | |
ITensor (const ITensor &)=default | |
ITensor (ITensor &&)=default | |
ITensor & | operator= (const ITensor &)=default |
ITensor & | operator= (ITensor &&)=default |
virtual | ~ITensor () |
virtual const Hypercube & | hypercube () const |
information describing the axes, types and labels of this tensor More... | |
virtual const Hypercube & | hypercube (const Hypercube &hc) |
virtual const Hypercube & | hypercube (Hypercube &&hc) |
std::size_t | rank () const |
std::vector< unsigned > | shape () const |
void | imposeDimensions (const Dimensions &dimensions) |
impose dimensions according to dimension map dimensions More... | |
virtual const Index & | index () const |
the index vector - assumed to be ordered and unique More... | |
virtual std::size_t | size () const |
return number of elements in tensor - maybe less than hypercube.numElements if sparse More... | |
double | atHCIndex (std::size_t hcIdx) const |
returns the data value at hypercube index hcIdx, or NaN if More... | |
template<class T > | |
std::size_t | hcIndex (const std::initializer_list< T > &indices) const |
template<class T > | |
double | operator() (const std::initializer_list< T > &indices) const |
virtual void | setArguments (const TensorPtr &, const TensorPtr &, const ITensor::Args &args={}) |
virtual void | setArguments (const std::vector< TensorPtr > &a, const ITensor::Args &args={"", 0}) |
virtual void | setArguments (const std::vector< TensorPtr > &a1, const std::vector< TensorPtr > &a2, const ITensor::Args &args={"", 0}) |
Private Attributes | |
std::size_t | dimension |
std::map< std::size_t, std::vector< SOI > > | sumOverIndices |
Additional Inherited Members | |
![]() | |
using | Timestamp = std::chrono::time_point< std::chrono::high_resolution_clock > |
![]() | |
std::function< void(double &, double, std::size_t)> | f |
double | init |
std::shared_ptr< ITensor > | arg |
![]() | |
void | notImpl () const |
![]() | |
Hypercube | m_hypercube |
Index | m_index |
compute the reduction along the indicated dimension, ignoring any missing entry (NaNs)
Definition at line 113 of file tensorOp.h.
|
inline |
Definition at line 121 of file tensorOp.h.
|
overridevirtual |
return or compute data at a location
Reimplemented from civita::ReduceAllOp.
Reimplemented in civita::StdDeviation, and civita::Average.
Definition at line 137 of file tensorOp.cc.
References f, TCLcmd::trap::init, and minsky::anonymous_namespace{userFunction.cc}::isnan().
Referenced by civita::Average::operator[](), civita::StdDeviation::operator[](), minsky::GeneralTensorOp< OperationType::median >::operator[](), and minsky::GeneralTensorOp< OperationType::moment >::operator[]().
|
overridevirtual |
Reimplemented from civita::ReduceAllOp.
Definition at line 101 of file tensorOp.cc.
References civita::ITensor::Args::dimension.
Referenced by minsky::GeneralTensorOp< OperationType::moment >::setArgument(), and minsky::GeneralTensorOp< OperationType::linearRegression >::setArguments().
|
private |
Definition at line 115 of file tensorOp.h.
|
private |
Definition at line 117 of file tensorOp.h.