  __global__ void interpolation_kernel1d( 
          const int num_rows, 
          const int n, 
-         const int* celln, const double* xn, 
+         const int* cellx, const double* xn, 
          const int pitch, int* Aj, double* Av, 
          const double* forward)
 {

    double * Av = thrust::raw_pointer_cast(&A.values(0,0));

    //compute normalized x and y values and cell numbers
    thrust::device_vector<double> xn(x.size()), yn(y.size()), cellnh(x.size()), cellmh(x.size());
    dg::blas1::transform( x, xn, dg::PLUS<double>( -g.x0()));
    dg::blas1::transform( y, yn, dg::PLUS<double>( -g.y0()));
    dg::blas1::scal( xn, 1./g.hx());

        detail::legendre( px, xn[row], n, forward);
        
        int offset = row;
        for(int k=0; k<n; k++)
        {
            Aj[offset] = cellx[row]*n + k
            Av[offset] = px[k];
            offset +=pitch;
        }
