Minsky
civita::DimensionedArgCachedOp Struct Reference

#include <tensorOp.h>

Inheritance diagram for civita::DimensionedArgCachedOp:
Inheritance graph
Collaboration diagram for civita::DimensionedArgCachedOp:
Collaboration graph

Public Member Functions

void setArgument (const TensorPtr &a, const ITensor::Args &) override
 
Timestamp timestamp () const override
 timestamp indicating how old the dependendent data might be. Used in CachedTensorOp to determine when to invalidate the cache More...
 
- Public Member Functions inherited from civita::CachedTensorOp
const Index & index () const override
 the index vector - assumed to be ordered and unique More...
 
std::size_t size () const override
 return number of elements in tensor - maybe less than hypercube.numElements if sparse More...
 
double operator[] (std::size_t i) const override
 return or compute data at a location More...
 
const Hypercube & hypercube () const override
 information describing the axes, types and labels of this tensor More...
 
const Hypercube & hypercube (const Hypercube &hc) override
 
const Hypercube & hypercube (Hypercube &&hc) override
 
- Public Member Functions inherited from civita::ITensor
 CLASSDESC_ACCESS (ITensor)
 
 ITensor ()
 
 ITensor (const Hypercube &hc)
 
 ITensor (Hypercube &&hc)
 
 ITensor (const std::vector< unsigned > &dims)
 
 ITensor (const ITensor &)=default
 
 ITensor (ITensor &&)=default
 
ITensoroperator= (const ITensor &)=default
 
ITensoroperator= (ITensor &&)=default
 
virtual ~ITensor ()
 
std::size_t rank () const
 
std::vector< unsigned > shape () const
 
void imposeDimensions (const Dimensions &dimensions)
 impose dimensions according to dimension map dimensions 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})
 

Public Attributes

std::size_t dimension =std::numeric_limits<std::size_t>::max()
 dimension to apply operation over. >rank = all dims More...
 
double argVal =0
 op arg value, eg binsize or delta in difference op More...
 
TensorPtr arg
 

Additional Inherited Members

- Public Types inherited from civita::ITensor
using Timestamp = std::chrono::time_point< std::chrono::high_resolution_clock >
 
- Protected Member Functions inherited from civita::CachedTensorOp
virtual void computeTensor () const =0
 computeTensor updates the above two mutable fields, but is logically const More...
 
- Protected Member Functions inherited from civita::ITensor
void notImpl () const
 
- Protected Attributes inherited from civita::CachedTensorOp
TensorVal cachedResult
 
Timestamp m_timestamp
 
- Protected Attributes inherited from civita::ITensor
Hypercube m_hypercube
 
Index m_index
 

Detailed Description

Definition at line 197 of file tensorOp.h.

Member Function Documentation

◆ setArgument()

void civita::DimensionedArgCachedOp::setArgument ( const TensorPtr a,
const ITensor::Args args 
)
overridevirtual

Reimplemented from civita::ITensor.

Reimplemented in civita::Scan.

Definition at line 184 of file tensorOp.cc.

References civita::ITensor::Args::dimension, and civita::ITensor::Args::val.

Referenced by civita::Scan::setArgument(), minsky::GeneralTensorOp< OperationType::difference >::setArgument(), and minsky::GeneralTensorOp< OperationType::histogram >::setArgument().

185  {
186  arg=a;
187  argVal=args.val;
188  if (!arg) {m_hypercube.xvectors.clear(); return;}
189  dimension=std::numeric_limits<size_t>::max();
190  auto hc=arg->hypercube();
191  auto& xv=hc.xvectors;
192  for (auto i=xv.begin(); i!=xv.end(); ++i)
193  if (i->name==args.dimension)
194  dimension=i-xv.begin();
195  hypercube(move(hc));
196  }
double argVal
op arg value, eg binsize or delta in difference op
Definition: tensorOp.h:202
const Hypercube & hypercube() const override
information describing the axes, types and labels of this tensor
Definition: tensorOp.h:141
std::size_t dimension
dimension to apply operation over. >rank = all dims
Definition: tensorOp.h:200
Hypercube m_hypercube
Here is the caller graph for this function:

◆ timestamp()

Timestamp civita::DimensionedArgCachedOp::timestamp ( ) const
inlineoverridevirtual

timestamp indicating how old the dependendent data might be. Used in CachedTensorOp to determine when to invalidate the cache

Implements civita::ITensor.

Definition at line 205 of file tensorOp.h.

References arg.

205 {return arg? arg->timestamp(): Timestamp();}
std::chrono::time_point< std::chrono::high_resolution_clock > Timestamp

Member Data Documentation

◆ arg

TensorPtr civita::DimensionedArgCachedOp::arg

Definition at line 203 of file tensorOp.h.

Referenced by civita::Scan::setArgument(), and timestamp().

◆ argVal

double civita::DimensionedArgCachedOp::argVal =0

op arg value, eg binsize or delta in difference op

Definition at line 202 of file tensorOp.h.

◆ dimension

std::size_t civita::DimensionedArgCachedOp::dimension =std::numeric_limits<std::size_t>::max()

dimension to apply operation over. >rank = all dims

Definition at line 200 of file tensorOp.h.


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