51 double at(
const std::vector<size_t>& indices)
const;
54 double&
at(
const std::vector<size_t>& indices);
std::vector< size_t > shape
Definition NTensor.hh:85
NTensor & apply(double(*fun)(double))
Apply a scalar function fun to all elements, return a reference to itself.
Definition NTensor.cc:144
std::vector< double > values
Definition NTensor.hh:86
NTensor & operator+=(const NTensor &)
Addition operator. This requires the shapes to match.
Definition NTensor.cc:152
NTensor broadcast(std::vector< size_t > new_shape, size_t pos) const
Expand the shape of the tensor to the specified shape by broadcasting to the other dimensions.
Definition NTensor.cc:259
NTensor & operator=(const NTensor &)
Assignment operator.
Definition NTensor.cc:50
NTensor & operator*=(const NTensor &)
Element-wise multiplication operator. This requires the shapes to match.
Definition NTensor.cc:182
friend std::ostream & operator<<(std::ostream &, const NTensor &)
NTensor & pow(const NTensor &)
Element-wise pow operator (self**b, or pow(self,b)). Requires the shapes to match.
Definition NTensor.cc:212
double at() const
Get the value of a scalar NTensor.
Definition NTensor.cc:57
static NTensor linspace(double from, double to, size_t steps)
Create equally spaced values in a range.
Definition NTensor.cc:39
static NTensor outer_product(const NTensor &a, const NTensor &b)
Outer product of two NTensors.
Definition NTensor.cc:237
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
std::ostream & operator<<(std::ostream &, const NTensor &)
Definition NTensor.cc:110
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1064
void fun(int *&p)
Definition passing.cc:6