function [pts,V_leb] = init(deg,domain)

%%%%%
% Helper function init :
% common operations to execute
% before the main optimization.
% Initial guess and WAM setup
%
% Parameters
% deg : polynomial degree
% domain : 1 for square, 2 for disk, 3 for interval
%
% Output
% pts : initial guess
% V_leb : Vandermonde matrix of the WAM
%
%%%%%


	switch domain
		case 1
        [pts, stats]=set_square_leb(deg);
        pts_leb=tens_cub_sq(250);
        V_leb = vand(deg,pts_leb,domain);		

        case 2
        [pts, stats]=set_disk_leb(deg);
        pts_leb=disk_wam(250);
        V_leb = vand(deg,pts_leb,domain);		

        case 3
        [pts]=expanded_chebyshev(deg);
        pts_leb=linspace(-1,1,10000)';
        V_leb = vand(deg,pts_leb,domain);		
	end

end
