function A=proddims(A,dims)
% proddims - Product over multiple dimensions
%
% proddims :: 
%    [Size:[[1,E]]->A] ~'E dimensional array',
%    Dims:[[K]->1..E]  ~'dims to prod 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=prod(A,i); end
