complexity of numerical software(2)



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).
.



Relevant Pages

  • Re: Fuzzy Union in C++
    ... algorithms implemented in terms of double? ... but ranges of doubles were different on different ... Now If you want to be sure you can use int16, ... only functionla languages fits to Fuzzy Reasonning. ...
    (comp.ai.fuzzy)
  • Re: Avoiding random trial and error
    ... dungeon generation algorithms -- it certainly got out of hand a little. ... void shuffle(int *array, int len) ... int mySampleCount; ...
    (rec.games.roguelike.development)
  • Re: C or C++
    ... The C++ Standard Library has algorithms. ... static int largest_of ... proponents claim to use it to model the problem domain more ... they build abstraction that correspond to ...
    (comp.os.linux.development.apps)
  • Re: for loop problem
    ... "I know what I am doing" casts causing so much trouble in another ... const int *intchr ... I am rather stuffy about "coding tricks". ... reserve their ingenuity for algorithms. ...
    (comp.lang.c)
  • Re: Sorting Array of Structures
    ... char author; ... int hold; ... I believe comp.programming does algorithms, so if you need to implement a sort algorithm (I'm guessing that is your assignment and your reason for not using qsort) then that is the place to ask. ...
    (comp.lang.c)

Loading