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

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

Added original make3d

File size: 912 bytes
Line 
1function f = flops_normpdfln(x, m, S, V)
2% FLOPS_NORMPDFLN   Flops for normpdfln.
3% Arguments are same as normpdf.
4
5f = 0;
6if nargin == 1
7  [d,n] = size(x);
8elseif isempty(m)
9  [d,n] = size(x);
10else
11  s = max(size(x),size(m));
12  d = s(1);
13  n = s(2);
14  f = f + d*n;
15end
16if nargin < 3
17  f = f + d*n + (d-1)*n + 2*n;
18  return
19end
20have_inv = 0;
21if nargin == 3
22  if d == 1
23    f = f + (3+flops_div)*n + cols(S) + (1+flops_log)*cols(S);
24    return;
25  end
26else
27  if ischar(V)
28    if strcmp(V,'inv')
29      have_inv = 1;
30    end
31  elseif ischar(S)
32    if strcmp(S,'inv')
33      f = f + flops_chol(d);
34      have_inv = 1;
35    end
36  else
37    f = f + flops_chol(d);
38  end
39end
40if have_inv
41  % count flops for log(prod) instead of sum(log)
42  f = f + flops_mul(d,d,n) + d-1 + flops_log;
43else
44  f = f + flops_solve_tri(d,d,n) + d-1 + flops_log;
45end
46f = f + 1 + d*n + (d-1)*n + 2*n;
Note: See TracBrowser for help on using the repository browser.