Re: complexity of numerical software



Jaap Spies wrote:
David N. Williams wrote in a reaction to carlos@xxxxxxxxxxxx:

I'm really puzzled by your classification of numerical software.
I would have put it in the truly challenging category!?

-- David


Numerical software? What kind of numerical software you are talking
about?

There is a lot of well known algorithms you can find in Knuth's bible
TAOCP or elsewhere. You do not have to invent the wheel again and again.

Testing and debugging of numeric algorithms is easy. Just check the
results.

For example a 'difficult (according to my former students)' problem for
the average programmer:

Do something to proces alle n-subsets of a m-set.


problem(int n, int m)
{
    int i, j;
    int *c;

// this algorithm generates all possible n-subsets of the set {1,2,...m)
// it is based on algorithm L from Knuth's taocp part 4: 7.2.1.3 p. 4
// to be publiced (see his homepage)
// Lexicographic combinations
c = (int *) malloc((n+3)*sizeof(int));
// L1. Initialize
for(j=1; j<=n;j++)
c[j] = j-1;
c[n+1] = m;
c[n+2] = 0;
j = 1;


    while(j <= n)
    {
    // L2. Visit
        proces(c, n, m);
    // L3. Find j
        j = 1;
        while(c[j]+1 == c[j+1])
        {
            c[j] = j-1;
            j++;
        }
    // L5. Increase c[j]
        c[j] += 1;
    }
}


Difficult? It's trivial with the right education.

Maybe it would be intersting to know your definition of "numerical software"...



Jaap Spies



'Jaap' is pronounced (in Dutch) as 'ya' from 'yard' followed by a 'p'
from'cap' (phonetic: ja.p).
'Spies' sounds like an 's' followed by the word 'peace' (spi:s).
.



Relevant Pages

  • Re: complexity of numerical software
    ... I would have put it in the truly challenging category!? ... What kind of numerical software you are talking ... They have nothing to do with algorithms to find subsets, ...
    (sci.math.symbolic)
  • complexity of numerical software
    ... I would have put it in the truly challenging category!? ... Testing and debugging of numeric algorithms is easy. ... c= j-1; ...
    (sci.math.symbolic)