65 explicit Tensor(
const std::vector<size_t> &dimensions);
75 Tensor(
const std::vector<std::vector<std::vector<double>>> &data);
107 double get(
const std::vector<size_t> &indices)
const;
116 void set(
const std::vector<size_t> &indices,
double value);
125 std::vector<std::vector<std::vector<double>>>
data_;
Represents a 3D tensor with basic operations.
void set(const std::vector< size_t > &indices, double value)
Sets the value at the specified indices.
Tensor add(const Tensor &other) const
Adds another tensor to the current tensor.
double get(const std::vector< size_t > &indices) const
Gets the value at the specified indices.
void display() const
Displays the tensor.
Tensor multiply(double scalar) const
Multiplies the tensor by a scalar value.
Tensor()
Default constructor Creates an empty tensor.
std::vector< std::vector< std::vector< double > > > data_
< 3D vector representing the tensor data
The source C++ openGPMP namespace.