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<cdouble> &t,
int ndx,
const Tensor<cdouble> &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);
62 const Tensor<cdouble>
scale(
const Tensor<cdouble> &t,
int ndx,
63 const Tensor<double> &v)
65 return scale(t, ndx, to_complex(v));
68 void scale_inplace(Tensor<cdouble> &t,
int ndx,
const Tensor<double> &v)
70 scale_inplace(t, ndx, to_complex(v));
int rank() const
Number of Tensor indices.
const_iterator begin_const() const
Iterator at the beginning for const objects.
const Tensor< cdouble > scale(const Tensor< cdouble > &t, int ndx, const Tensor< cdouble > &v)
Hadamard product of a tensor times a vector.
index size() const
Returns total number of elements in Tensor.
const Indices & dimensions() const
Return Tensor dimensions.