Programming Projects in C
for students of
Engineering, Sciences and Mathematics
Rouben Rostamian
2014

Resources for Project Nelder-Mead

Rank vertices

Read the book's chapter on Nelder-Mead. In particular, read about the rank_vertices() function and learn what it is expected to do. Code the function accordingly, then test it. Here is how.

The file rank-vertices-test.c is a stand-alone C program which has a placeholder for the rank_vertices() function. Insert your code for the function there. Don't change anything else. Compile the program, as in

    cc -Wall -pedantic -std=c99 rank-vertices.c
and execute. If your rank_vertices() works correctly, the program will exit silently. Otherwise it will print diagnostics about what went wrong.

Demo-energy.c

Here is a sketch of the file demo-energy.c from Project 18.2 on page 207. The book's description of that file is perhaps too terse. Comments in this online sketch provide a little more of the details to help you along with completing the project.

Notes and errata

  1. Page 200, last line, “next to best” should be “next to worst”.
  2. Page 203, toward the end of the page, we have:
    static inline void replace_row(double **s, int i, double *r)
    That i should be iz.
  3. Page 206, Listing 18.5: Lines 20–62 should be shifted to the right by one tabstop.



Programming Projects in C Valid HTML 5 Valid CSS