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
 Pass by value parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jfrorigin

USA
1 Posts

Posted - 12/29/2010 :  12:54:07 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 7.5 SR2 on XP.

Hi,

I use the NonLinear Curve Fitting with a user defined C function.
This function is defined via the code builder.

myfun(double P1, double P2, double x, double & y)
{

P1=P1*1.0e-9;

// Here is the body of the function itself
//
}

I fit with P2 by keeping P1 constant to a value val0 in the graphical interface. However the fit does not converge properly.

If I remove the line P1=P1*1.0e-9; in the program and fit by keeping P1 constant to val0*1e-9, the fit works perfectly.

Is it forbidden to change the value of one parameter in the body of the fit function? I thought it would be ok, since parameters are passed by value and not by reference.

Hope you can help.

Thanks
  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