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

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

Added original make3d

File size: 479 bytes
Line 
1function s = logmulexp(a,b)
2%LOGMULEXP        Matrix multiply in the log domain.
3% logmulexp(a,b) returns log(exp(a)*exp(b)) while avoiding numerical underflow.
4% The * is matrix multiplication.
5
6% Written by Tom Minka
7% (c) Microsoft Corporation. All rights reserved.
8
9s = repmat(a,cols(b),1) + kron(b',ones(rows(a),1));
10s = reshape(logsumexp(s,2),rows(a),cols(b));
11
12%s = kron(a',ones(1,cols(b))) + repmat(b,1,rows(a));
13%s = reshape(logsumexp(s),cols(b),rows(a))';
Note: See TracBrowser for help on using the repository browser.