GPLIB++
cadiinter.cpp
Go to the documentation of this file.
1 #include "cadianiso.h"
2 extern "C" void initialize_(char* path, int* pathlenptr, int junk)
3 {
4 /* Do nothing */
5 }
6 
7 /* Set up the bounds of the parameter space
8 * After being called, this function must have
9 * a) set nd to be equal to the dimension of the
10 * parameter space being searched
11 * b) set ranges[i][0] to be the lower bound on parameter i
12 * c) set ranges[i][1] must hold the upper bound on parameter i
13 *
14 * Currently, the scales argument is ignored. You neednt do
15 * anything to it.
16 */
17 extern "C" void user_init_(int* nd, float* ranges, float* scales) {
18 init(nd,ranges);
19 }
20 
21 
22 /* nd (in) is the number of dimensions of the parameter space
23 * model (in) is a point in that parameter space
24 * mfitval (out) is the misfit that is assigned to 'model'
25 *
26 * In this simple example, we define our misfit to be a simple
27 * polynomial. In real examples, you need to put your own code in
28 * here.
29 *
30 * calculate misfit = x^3 + y^2 + 10z
31 */
32 extern "C" void forward_(int* nd, float* model, float* mfitval) {
33 misfit(model,mfitval,nd);
34 }
void forward_(int *nd, float *model, float *mfitval)
Definition: cadiinter.cpp:32
void initialize_(char *path, int *pathlenptr, int junk)
Definition: cadiinter.cpp:2
void misfit(float *p, float *misfit, int *m)
These two functions provide the interface between the C++ implementation and the C interfacea of CADI...
Definition: cadianiso.cpp:19
void init(int *nd, float *ranges)
Definition: cadianiso.cpp:37
void user_init_(int *nd, float *ranges, float *scales)
Definition: cadiinter.cpp:17