% interpolates the value vector v at grid points x;
% the information on the grid is contained in fspace,
% which was generated by linapprox.m
% the interpolation is simplicial linear or multilinear,
% depending on the information in fspace;
%
function val = lininterp(v,fspace,x);
  g = fspace.grid';
  gi = fspace.gridInvDist';
  val = linint(x,v,fspace.n,fspace.nCumul,g,gi,fspace.iML);
