Minsky
|
#include <tensorInterface.h>
Classes | |
struct | Args |
arguments relevant for tensor expressions, not always meaningful. Exception thrown if not. More... | |
Public Types | |
using | Timestamp = std::chrono::time_point< std::chrono::high_resolution_clock > |
Public Member Functions | |
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 double | operator[] (std::size_t) const =0 |
return or compute data at a location 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 Timestamp | timestamp () const =0 |
timestamp indicating how old the dependendent data might be. Used in CachedTensorOp to determine when to invalidate the cache More... | |
virtual void | setArgument (const TensorPtr &, const ITensor::Args &args={"", 0}) |
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}) |
Protected Member Functions | |
void | notImpl () const |
Protected Attributes | |
Hypercube | m_hypercube |
Index | m_index |
Definition at line 36 of file tensorInterface.h.
using civita::ITensor::Timestamp = std::chrono::time_point<std::chrono::high_resolution_clock> |
Definition at line 103 of file tensorInterface.h.
|
inline |
Definition at line 40 of file tensorInterface.h.
|
inline |
Definition at line 41 of file tensorInterface.h.
|
inline |
Definition at line 42 of file tensorInterface.h.
|
inline |
|
default |
|
default |
|
inlinevirtual |
Definition at line 48 of file tensorInterface.h.
|
inline |
returns the data value at hypercube index hcIdx, or NaN if
Definition at line 82 of file tensorInterface.h.
References index(), and size().
Referenced by operator()().
civita::ITensor::CLASSDESC_ACCESS | ( | ITensor | ) |
|
inline |
Definition at line 96 of file tensorInterface.h.
References hypercube().
Referenced by operator()(), civita::BinOp::operator[](), and civita::InterpolateHC::splitAndRotate().
|
inlinevirtual |
information describing the axes, types and labels of this tensor
Reimplemented in minsky::RavelTensor, civita::SortByValue, civita::CachedTensorOp, and civita::ElementWiseOp.
Definition at line 50 of file tensorInterface.h.
References m_hypercube.
Referenced by hcIndex(), imposeDimensions(), minsky::TensorVarVal::operator=(), minsky::VariableValue::operator=(), rank(), civita::InterpolateHC::setArgument(), minsky::GeneralTensorOp< OperationType::linearRegression >::setArguments(), shape(), size(), and civita::InterpolateHC::splitAndRotate().
|
inlinevirtual |
Reimplemented in civita::CachedTensorOp.
Definition at line 51 of file tensorInterface.h.
References m_hypercube.
|
inlinevirtual |
Reimplemented in civita::CachedTensorOp.
Definition at line 52 of file tensorInterface.h.
References m_hypercube.
|
inline |
impose dimensions according to dimension map dimensions
Definition at line 57 of file tensorInterface.h.
References hypercube().
|
inlinevirtual |
the index vector - assumed to be ordered and unique
Reimplemented in minsky::RavelTensor, civita::CachedTensorOp, and civita::ElementWiseOp.
Definition at line 72 of file tensorInterface.h.
References m_index.
Referenced by atHCIndex(), civita::InterpolateHC::bodyCentredNeighbourhood(), minsky::TensorVarVal::operator=(), minsky::VariableValue::operator=(), civita::BinOp::operator[](), civita::InterpolateHC::setArgument(), minsky::GeneralTensorOp< OperationType::linearRegression >::setArguments(), and size().
|
inlineprotected |
Definition at line 129 of file tensorInterface.h.
|
inline |
Definition at line 100 of file tensorInterface.h.
References atHCIndex(), and hcIndex().
|
pure virtual |
return or compute data at a location
Implemented in minsky::GeneralTensorOp< OperationType::shape >, minsky::GeneralTensorOp< OperationType::size >, minsky::GeneralTensorOp< OperationType::differencePlus >, civita::SpreadLast, civita::SpreadFirst, civita::PermuteAxis, civita::Pivot, civita::Slice, civita::StdDeviation, civita::Average, civita::CachedTensorOp, civita::ReductionOp, civita::ReduceAllOp, civita::ReduceArguments, civita::InterpolateHC, civita::BinOp, and civita::ElementWiseOp.
|
inline |
Definition at line 53 of file tensorInterface.h.
References hypercube().
Referenced by civita::InterpolateHC::bodyCentredNeighbourhood(), civita::InterpolateHC::setArgument(), and civita::InterpolateHC::splitAndRotate().
|
inlinevirtual |
Reimplemented in minsky::RavelTensor, minsky::GeneralTensorOp< OperationType::slice >, minsky::GeneralTensorOp< OperationType::histogram >, minsky::GeneralTensorOp< OperationType::moment >, minsky::GeneralTensorOp< OperationType::shape >, minsky::GeneralTensorOp< OperationType::size >, minsky::GeneralTensorOp< OperationType::index >, minsky::GeneralTensorOp< OperationType::differencePlus >, minsky::GeneralTensorOp< OperationType::difference >, civita::SpreadBase, civita::SortByValue, civita::PermuteAxis, civita::Pivot, civita::Slice, civita::Scan, civita::DimensionedArgCachedOp, civita::ReductionOp, civita::ReduceAllOp, civita::InterpolateHC, and civita::ElementWiseOp.
Definition at line 115 of file tensorInterface.h.
Referenced by minsky::TensorEval::TensorEval().
|
inlinevirtual |
Reimplemented in minsky::GeneralTensorOp< OperationType::linearRegression >, minsky::Correlation, minsky::GeneralTensorOp< OperationType::gather >, minsky::GeneralTensorOp< OperationType::outerProduct >, minsky::GeneralTensorOp< OperationType::innerProduct >, minsky::TensorBinOp< op >, minsky::TensorBinOp< OperationType::add >, and civita::BinOp.
Definition at line 116 of file tensorInterface.h.
|
inlinevirtual |
Reimplemented in minsky::SwitchTensor, civita::ReduceArguments, and minsky::MinskyTensorOp< op >.
Definition at line 118 of file tensorInterface.h.
|
inlinevirtual |
Reimplemented in minsky::MultiWireBinOp< op >.
Definition at line 121 of file tensorInterface.h.
|
inline |
Definition at line 54 of file tensorInterface.h.
References hypercube().
|
inlinevirtual |
return number of elements in tensor - maybe less than hypercube.numElements if sparse
Reimplemented in minsky::RavelTensor, minsky::SwitchTensor, civita::SortByValue, civita::CachedTensorOp, minsky::TimeOp, and civita::ElementWiseOp.
Definition at line 76 of file tensorInterface.h.
References hypercube(), and index().
Referenced by atHCIndex(), minsky::VariableValue::operator=(), civita::BinOp::operator[](), and civita::InterpolateHC::setArgument().
|
pure virtual |
timestamp indicating how old the dependendent data might be. Used in CachedTensorOp to determine when to invalidate the cache
Implemented in minsky::RavelTensor, minsky::SwitchTensor, minsky::GeneralTensorOp< OperationType::linearRegression >, minsky::Correlation, minsky::GeneralTensorOp< OperationType::shape >, minsky::GeneralTensorOp< OperationType::size >, minsky::GeneralTensorOp< OperationType::gather >, minsky::GeneralTensorOp< OperationType::index >, minsky::GeneralTensorOp< OperationType::outerProduct >, minsky::GeneralTensorOp< OperationType::innerProduct >, civita::SpreadBase, civita::SortByValue, civita::PermuteAxis, civita::Pivot, civita::Slice, civita::DimensionedArgCachedOp, civita::ReduceAllOp, civita::ReduceArguments, civita::BinOp, civita::InterpolateHC, minsky::TimeOp, and civita::ElementWiseOp.
|
protected |
Definition at line 127 of file tensorInterface.h.
Referenced by civita::ElementWiseOp::hypercube(), hypercube(), ITensor(), civita::SpreadFirst::setSpreadDimensions(), and civita::SpreadLast::setSpreadDimensions().
|
protected |
Definition at line 128 of file tensorInterface.h.
Referenced by civita::ElementWiseOp::index(), index(), civita::SpreadFirst::setSpreadDimensions(), and civita::SpreadLast::setSpreadDimensions().