%-------------------------------------------------------------------------%
%
% File: getTestF23(type)
%
% Goal: returns the specified test function
%
% Inputs:  type:    the type of function
%
% Outputs: f:   the specified function
%
%-------------------------------------------------------------------------%
function f = getTestF23(type)
switch type
    case 'franke',
        f = @(x) 0.75*exp(-((9*x(:,1)-2).^2+(9*x(:,2)-2).^2)/4) ...
            + 0.75*exp(-((9*x(:,1)+1).^2/49+(9*x(:,2)+1)/10)) ...
            + 0.5*exp(-((9*x(:,1)-7).^2+(9*x(:,2)-3).^2)/4) ...
            - 0.2*exp(-((9*x(:,1)-4).^2+(9*x(:,2)-7).^2));
    case 'oscill',
        f = @(x) cos(10*(x(:,1)+x(:,2)));
    case 'poly',
        f = @(x) (x(:,1)+x(:,2)-1).^9;
    case 'exp',
        ff = @(x,xx,ep) exp(-ep^2*((x(:,1)-xx(:,1)).^2 + ...
            (x(:,2)-xx(:,2)) .^2));
        f = @(x) ff(x, [0,-0.9],0.5) + ff(x,[0,1.1],0.5) ...
            + ff(x,[-0.4,0],0.5) + ff(x,[0.2,0],0.6);
    case 'natgauss',
        ff = @(x,xx,ep) exp(-ep^2*((x(:,1)-xx(:,1)).^2+...
            (x(:,2)-xx(:,2)).^2));
        f = @(x) ff(x,[0,-1.2],1) + 2*ff(x,[-0.4,0.5],1) ...
            - 2*ff(x,[-0.4,1.1],1) + 3*ff(x,[1.2,1.3],1);
    case 'pacman',
        f = @(x) exp(abs(x(:,1)-x(:,2))) - 1;
    case 'trig',
        f = @(x) sin(x(:,1))+cos(x(:,2));
end
end