complexity of numerical software(2)
- From: Jaap Spies <j.spies@xxxxxxxxx>
- Date: Fri, 09 Dec 2005 00:02:56 +0100
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.
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). .
- Follow-Ups:
- Re: complexity of numerical software(2)
- From: Richard Fateman
- Re: complexity of numerical software(2)
- Prev by Date: Re: complexity of numerical software
- Next by Date: Re: Maple Vs Mathematica debugging / cost to write a system
- Previous by thread: Access control on webMathematica
- Next by thread: Re: complexity of numerical software(2)
- Index(es):
Relevant Pages
|
Loading