
# author:  N. Matloff

rthconv <- function(x,y,gpu=F) {
   if (gpu) {
      dyn.load("rthconvgpu.so")
      asfunction <- as.single
      vecfunction <- single
      dupval <- T
   } else {
      dyn.load("rthconv.so")
      asfunction <- as.double
      vecfunction <- double
      dupval <- F
   }

   nx <- length(x)
   ny <- length(y)
   tmp <- .C("rthconv",asfunction(x),as.integer(nx),asfunction(y),
             as.integer(ny), tmpres=vecfunction(nx+ny-1),DUP=dupval)
   return(tmp$tmpres)
}


