@@ -29,40 +29,40 @@ Array<T> multiplyIndexed(const Array<T> &lhs, const Array<T> &rhs, std::vector<a
2929}
3030
3131template <typename T>
32- static af_array transform_coordinates (const af_array& tf , const float d0 , const float d1 )
32+ static af_array transform_coordinates (const af_array& tf_ , const float d0_ , const float d1_ )
3333{
3434 af::dim4 h_dims (4 , 3 );
35- T h_in[4 *3 ] = { (T)0 , (T)0 , (T)d1 , (T)d1 ,
36- (T)0 , (T)d0 , (T)d0 , (T)0 ,
35+ T h_in[4 *3 ] = { (T)0 , (T)0 , (T)d1_ , (T)d1_ ,
36+ (T)0 , (T)d0_ , (T)d0_ , (T)0 ,
3737 (T)1 , (T)1 , (T)1 , (T)1 };
3838
39- const Array<T> TF = getArray<T>(tf );
40- Array<T> IN = createHostDataArray<T>(h_dims, h_in);
39+ const Array<T> tf = getArray<T>(tf_ );
40+ Array<T> in = createHostDataArray<T>(h_dims, h_in);
4141
4242 std::vector<af_seq> idx (2 );
4343 idx[0 ] = af_make_seq (0 , 2 , 1 );
4444
45- // w = 1.0 / matmul(TF, IN (span, 2));
46- // iw = matmul(TF, IN (span, 2));
45+ // w = 1.0 / matmul(tf, in (span, 2));
46+ // iw = matmul(tf, in (span, 2));
4747 idx[1 ] = af_make_seq (2 , 2 , 1 );
48- Array<T> IW = multiplyIndexed (IN, TF , idx);
48+ Array<T> iw = multiplyIndexed (in, tf , idx);
4949
50- // xt = w * matmul(TF, IN (span, 0));
51- // xt = matmul(TF, IN (span, 0)) / iw;
50+ // xt = w * matmul(tf, in (span, 0));
51+ // xt = matmul(tf, in (span, 0)) / iw;
5252 idx[1 ] = af_make_seq (0 , 0 , 1 );
53- Array<T> XT = arithOp<T, af_div_t >(multiplyIndexed (IN, TF , idx), IW, IW .dims ());
53+ Array<T> xt = arithOp<T, af_div_t >(multiplyIndexed (in, tf , idx), iw, iw .dims ());
5454
55- // yt = w * matmul(TF, IN (span, 1));
56- // yt = matmul(TF, IN (span, 1)) / iw;
55+ // yt = w * matmul(tf, in (span, 1));
56+ // yt = matmul(tf, in (span, 1)) / iw;
5757 idx[1 ] = af_make_seq (1 , 1 , 1 );
58- Array<T> YT = arithOp<T, af_div_t >(multiplyIndexed (IN, TF , idx), IW, IW .dims ());
58+ Array<T> yw = arithOp<T, af_div_t >(multiplyIndexed (in, tf , idx), iw, iw .dims ());
5959
6060 // return join(1, xt, yt)
61- Array<T> R = join (1 , XT, YT );
62- return getHandle (R );
61+ Array<T> r = join (1 , xt, yw );
62+ return getHandle (r );
6363}
6464
65- af_err af_transform_coordinates (af_array *out, const af_array tf, const float d0 , const float d1 )
65+ af_err af_transform_coordinates (af_array *out, const af_array tf, const float d0_ , const float d1_ )
6666{
6767 try {
6868 const ArrayInfo& tfInfo = getInfo (tf);
@@ -72,8 +72,8 @@ af_err af_transform_coordinates(af_array *out, const af_array tf, const float d0
7272 af_array output;
7373 af_dtype type = tfInfo.getType ();
7474 switch (type) {
75- case f32 : output = transform_coordinates<float >(tf, d0, d1 ); break ;
76- case f64 : output = transform_coordinates<double >(tf, d0, d1 ); break ;
75+ case f32 : output = transform_coordinates<float >(tf, d0_, d1_ ); break ;
76+ case f64 : output = transform_coordinates<double >(tf, d0_, d1_ ); break ;
7777 default : TYPE_ERROR (1 , type);
7878 }
7979 std::swap (*out, output);
0 commit comments