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

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

Added original make3d

File size: 675 bytes
Line 
1function f = flops_solve(a,b,c)
2% FLOPS_SOLVE    Flops for matrix left division.
3% FLOPS_SOLVE(a,b) returns the number of flops for a\b.
4% FLOPS_SOLVE(n,m,c) returns the number of flops for ones(n,m)\ones(m,c).
5
6if nargin == 2
7  f = flops_solve(rows(a),cols(a),cols(b));
8  return;
9end
10if a == b
11  if a == 1
12    % scalar division
13    f = c*flops_div;
14    return;
15  end
16  f = flops_chol(a) + 2*flops_solve_tri(a,b,c);
17elseif a > b
18  % this comes from Ax=b, x = (A'*A)\(A'*b)
19  f = flops_mul(b,a,b) + flops_mul(b,a,c) + flops_solve(b,b,c);
20else
21  % this comes from Ax=b, x = A'*(A*A')\b
22  f = flops_mul(a,b,a) + flops_mul(b,a,c) + flops_solve(a,a,c);
23end
Note: See TracBrowser for help on using the repository browser.