function A=sumdims(A,dims)
% sumdims - Sum over multiple dimensions
%
% sumdims :: 
%    [Size:[[1,E]]->A] ~'E dimensional array',
%    Dims:[[K]->1..E]  ~'dims to sum over'
% -> [Size1->A]        :- Size1=arrset(Size,Dims,1). 
%
% Result is same size as input except for summed dimensions
% which are collapsed to a size of 1.

for i=dims, A=sum(A,i); end
