source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/ndlogsumexp.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 512 bytes
Line 
1function x = ndlogsumexp(x,dim)
2% NDLOGSUMEXP    Sum over multiple dimensions in the log domain.
3% ndlogsumexp(X,DIM) sums out the dimensions in DIM (using logsumexp),
4% and squeezes the result.
5
6% Written by Tom Minka
7% (c) Microsoft Corporation. All rights reserved.
8
9sz = size(x);
10for i=1:length(dim)
11  x = logsumexp(x, dim(i));
12end
13nbig = prod(sz);
14nsmall = prod(size(x));
15addflops((nbig-nsmall)*(1+flops_exp) + nsmall*flops_log);
16%x = mysqueeze(x);
17sz(dim) = [];
18x = reshape(x,[sz 1 1]);
Note: See TracBrowser for help on using the repository browser.