20 #include "tensor_scale.cc"
36 ndx = normalize_index(ndx, t.
rank());
37 surrounding_dimensions(t.
dimensions(), ndx, &d1, &d2, &d3);
39 std::cerr <<
"In scale() the dimension " << ndx <<
40 " of the tensor does not match the length " <<
41 v.
size() <<
" of the scale vector" << std::endl;
48 void scale_inplace(Tensor<double> &t,
int ndx,
const Tensor<double> &v)
51 surrounding_dimensions(t.dimensions(), normalize_index(ndx, t.rank()),
54 std::cerr <<
"In scale() the dimension " << ndx <<
55 " of the tensor does not match the length " <<
56 v.size() <<
" of the scale vector" << std::endl;
59 doscale(t.begin(), v.begin_const(), d1, d2, d3);
int rank() const
Number of Tensor indices.
const Tensor< double > scale(const Tensor< double > &t, int ndx, const Tensor< double > &v)
Hadamard product of a tensor times a vector.
const_iterator begin_const() const
Iterator at the beginning for const objects.
index size() const
Returns total number of elements in Tensor.
const Indices & dimensions() const
Return Tensor dimensions.