I'm trying to using the MKL routine in a code.
In fact i'm interested in evaluating the gradient of a certain function.
Previously, when i had at disposal the IMSL libraries, i used the IMSL function CDGRD.
Now i need to use the MKL. As i understand there is not a similar function in the MKL library, but the gradient can be obtained by using the MKL routine evaluating the jacobian of a one value function.
Regarding this point i haven't understand which function i have to use between djacobi_solve and djacobi.
I tried to use both by following the examples reported in the manual.
1) Djacobi :
I used the following command:
where FCN_2 is the external function having one value and depending on NUNK variables
gnew is the gradient
xnB is the vector containing the variables at the current stage
epsjac is the precision
I did not get the same results as with the function CDGRD. I get a very big number for the first components and zero for the other gradient components, while the res is a very big negative number.
I tried to compile the example shown at http://www.intel.com/software/products/mkl/docs/WebHelp/osr/osr_djacobi_...
Unfortunately I cannot find the mkl_opt_tr.f, so i removed the "include" line.
Then I get some error messages saying that it does not recognize the djacobi_init, djacobi_solve and so on. So i suppose i do not link correctly to the MKL libraries.
HELP AND SUGGESTIONS???