19 #define TENSOR_LOAD_IMPL
20 #include <tensor/tensor.h>
30 template<
typename t1,
typename t2>
31 void doscale(t1 *p1,
const t2 *p20, index d1, index d2, index d3) {
36 for (i = d2, p2 = p20; i; i--, p1++, p2++) {
42 for (i = d2, p2 = p20; i; i--, p2++) {
44 for (j = d1; j; j--, p1++) {
52 template<
typename elt_t>
53 void scale_inplace(Tensor<elt_t> &t,
int ndx,
const Vector<double> &v)
56 surrounding_dimensions(t.get_dims(), t.normal_index(ndx), &d1, &d2, &d3);
58 std::cerr <<
"In scale() the dimension " << ndx <<
59 " of the tensor does not match the length " <<
60 v.size() <<
" of the scale vector" << std::endl;
63 doscale(t.begin(), v.begin_const(), d1, d2, d3);
70 template <
class t1,
class t2,
class t3>
71 void doscale(t1 *p1,
const t2 *p2,
const t3 *p30,
72 index d1, index d2, index d3)
78 for (i = d2, p3 = p30; i; i--, p1++, p2++, p3++) {
84 for (i = d2, p3 = p30; i; i--, p3++) {
86 for (j = d1; j; j--, p1++, p2++) {