Rev | Line | |
---|
[37] | 1 | function f = flops_solve_tri(T,b,c)
|
---|
| 2 | % FLOPS_SOLVE_TRI Flops for triangular left division.
|
---|
| 3 | % FLOPS_SOLVE_TRI(T,b) returns the number of flops for solve_tri(T,b).
|
---|
| 4 | % FLOPS_SOLVE_TRI(n,n,m) returns the number of flops for
|
---|
| 5 | % solve_tri(eye(n),ones(n,m)).
|
---|
| 6 |
|
---|
| 7 | if nargin == 2
|
---|
| 8 | f = flops_solve_tri(rows(T),cols(T),cols(b));
|
---|
| 9 | return;
|
---|
| 10 | end
|
---|
| 11 | % number of multiplies+adds is
|
---|
| 12 | % sum(i=1..n) sum(k=i-1..1) 2 = sum(i=1..n) 2*(i-1) = n^2-n
|
---|
| 13 | % number of divides is n
|
---|
| 14 | f = (T*b + b*(flops_div-1))*c;
|
---|
Note: See
TracBrowser
for help on using the repository browser.