The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Machine tolerance function in curve fitting routin
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ddecotiis

6 Posts

Posted - 09/01/2009 :  5:30:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8 and Service Release 6(Select Help-->About Origin):
Operating System: Xp

I'm trying to use the NAG x01ajc function via. the X01AJC constant in the code of a curve fitting routine. When I try to compile the code I get the following error:
"Error, Function x02ajc@LAAAAAAA was called, but its body could not be located during linking."
I presume that I need to add the .c or .dll file containing the function body to the workspace, but I'm not sure which file to add. Can anyone shed some light on the problem?
-Thanks

Iris_Bai

China
Posts

Posted - 09/01/2009 :  10:33:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please include header file and compile again.
#include <\NAG8\nagx02.h>

Iris
Go to Top of Page

ddecotiis

6 Posts

Posted - 09/01/2009 :  10:44:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Iris,
Thanks for the quick response. I'm getting a new crops of errors:

"C:\Program Files\OriginLab\Origin8\OriginC\system\NAG8\nagx02.h(113) :Error, illegal function argument type"
"C:\Program Files\OriginLab\Origin8\OriginC\system\NAG8\nagx02.h(113) :Error, syntax error in variable declaration."
"C:\Documents and Settings\Dan\My Documents\OriginLab\Origin8\User Files\OriginC\NLSF\_nlfLigand_Binding_MR_Solver.fit(4) :Error, include file compilation error"

Any other ideas?

Thanks again
Go to Top of Page

Iris_Bai

China
Posts

Posted - 09/02/2009 :  01:50:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, should include this one:
#include <OC_nag8.h>
OC_nag8.h is a header file including all nag header files.

By the way there are many useful NAG function calling examples under http://ocwiki.originlab.com/index.php?title=Category:Calling_NAG_Functions%28Examples%29.

Edited by - Iris_Bai on 09/02/2009 01:51:36 AM
Go to Top of Page

ddecotiis

6 Posts

Posted - 09/02/2009 :  4:50:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Iris,
I've already got that include in my .c source file. Any other ideas?

Thanks
Go to Top of Page

Iris_Bai

China
Posts

Posted - 09/02/2009 :  10:33:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please send me your FDF file according to the intruction in this page http://www.originlab.com/index.aspx?s=1&lm=123&pid=752

Iris
Go to Top of Page

ddecotiis

6 Posts

Posted - 09/16/2009 :  2:03:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Iris,
Sorry about the delay. Thanks again for agreeing to take a look at this. I've uploaded the function .FDF file to the originlab /incoming directory. The filename is Ligand_Binding_MR_Solver_.FDF. I'm still getting the same error on compilation. Let me know what you think.

Thanks again,
Go to Top of Page

ddecotiis

6 Posts

Posted - 09/16/2009 :  3:52:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Iris,
There was some issue with the code. I've uploaded a file with correct syntax to UPDATED_Ligand_Binding_MR_Solver_.FDF.

Thanks
Go to Top of Page

larry_lan

China
Posts

Posted - 09/16/2009 :  11:42:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

We cannot reproduce your compiling error in UPDATED_Ligand_Binding_MR_Solver_.FDF. I wonder if you updated to SR6 from other patches? Say from SR5 to SR6? If you keep your licence, how about download the demo installation file and repair Origin with your licence? Please let us know whether it works after repair.

Thanks
Larry
Go to Top of Page

ddecotiis

6 Posts

Posted - 09/22/2009 :  8:32:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
All,
I think there is a bigger problem with my function.
1. Compiling the function in the demo version of origin still results in the following error:
Function x02ajc@LAAAAAAA was called, but its body could not be located during linking.
I wrote a smaller example copying the NAG documentation code to demonstrate my point. The sample test.c code (shown below) will generate this error if the comment line is removed.

2. Any call to the NAG function for finding the root of system of transcendental functions (thread safe), nag_zero_nonlin_eqns_1 (C05tbc) generates the following error "External call execution error". I reproduced the sample code from the NAG documentation as test.c below. I am unable to reproduce the program output shown in the NAG documentation because of the repeated error.

test.c/
#include <Origin.h>
#include <OC_nag8.h>
#define NMAX 9

static void f(Integer n, double x[], double fvec[], Integer *userFlag, Nag_User *comm)
{
Integer k;
for (k=0; k<n; ++k)
{
fvec[k]=(3.0-x[k]*2.0)*x[k]+1.0;
if (k>0)
fvec[k] -= x[k-1];
if (k<n-1)
fvec[k] -= x[k+1]*2.0;
}
}

main()
{
double ffvec[NMAX];
double fx[NMAX];
Integer i,j;
double xtol;
static NagError fail;
Nag_User comm;

Integer n= NMAX;

printf("Program Results:\n");
for (j=0;j<n;j++)
x[j]=-1.0;
//xtol= sqrt(X02AJC); Commented till I can fix this problem
xtol = 0.00001;
c05tbc(n,x,fvec,f,xtol,&comm,&fail);
if (fail.code == NE_NOERROR)
{
printf("Final Approximate Solutions\n\n");
for(j=0;j<n;j++)
printf("%12.4f%s",x[j], (j%3==2 || j==n-1) ? "\n" : " ");
}else
{
printf("error occured: %s", fail.message);
}
}

/test.c

Any input would be great

Thanks
Go to Top of Page

Iris_Bai

China
Posts

Posted - 09/25/2009 :  02:02:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Send email to your mailbox, please check.

Iris

Edited by - Iris_Bai on 09/25/2009 02:20:46 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000