function A = laplacian1d_dense(m)
% LAPLACIAN1D_DENSE : discrete Laplacian matrix in 1 dimension
%
% A = laplacian1d_dense(m) returns an m-by-m matrix

A = zeros(m,m);  % preallocate A for efficiency
for i = 1:m
    if i > 1
        A(i,i-1) = -1;
    end;
    A(i,i) = 2;
    if i < m
        A(i,i+1) = -1;
    end;
end;
