function [f,J,domerr]=cpfunjac(z,jacflag) 
global cpfname wsvec

if jacflag == 1
  [f,J,domerr] = cpjac(z);
else
  [f,domerr] = cpfun(z);
end

return;
