Last change
on this file since 4000 was 2414, checked in by cmv, 22 years ago |
Exemple pour interface cfortan (CERN) cmv 21/07/2003
|
File size:
484 bytes
|
Rev | Line | |
---|
[2414] | 1 | #include <math.h>
|
---|
| 2 | #include <string.h>
|
---|
| 3 |
|
---|
| 4 | void fcn(int npar, double grad[3], double * fcnval,
|
---|
| 5 | double xval[2],int iflag, void (*Dummy)())
|
---|
| 6 | {
|
---|
| 7 | double Xc=1.11,Yc=3.14;
|
---|
| 8 | /*
|
---|
| 9 | * demo FCN
|
---|
| 10 | * Gunter Folger, May 95
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | switch(iflag) {
|
---|
| 14 | case 1:
|
---|
| 15 | /*
|
---|
| 16 | * Initialaise.
|
---|
| 17 | */
|
---|
| 18 | printf(" fcn_c called to initialise\n");
|
---|
| 19 | break;
|
---|
| 20 | case 2:
|
---|
| 21 | /*
|
---|
| 22 | * derivatives...
|
---|
| 23 | */
|
---|
| 24 | break;
|
---|
| 25 |
|
---|
| 26 | default:
|
---|
| 27 | *fcnval = pow(xval[0]-Xc,2.) + pow((xval[1]-Yc),3.)*xval[1];
|
---|
| 28 | break;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.