comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Another MPFIT question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Another MPFIT question [message #62828 is a reply to message #62827] Sun, 12 October 2008 01:29 Go to previous messageGo to previous message
MichaelT is currently offline  MichaelT
Messages: 52
Registered: May 2006
Member
On Oct 12, 4:02 am, Vince Hradil <vincehra...@gmail.com> wrote:
> How's this
> re-parameterize our problem to -
> p[0]=c1, p[1]=c1+c2, p[2]=c1+c2+c3 and p[3]=c1+c2+c3+c4
> then limit all these to [0,1]

Many thanks Vince! That gave me the right idea!

I had to implement it a tiny little bit differently, though. It turned
out that in your suggested case c1...4 would not have been limited to
[0, 1] but [-1, 1].
So I had to do it like this:

p[0]=1-c1, p[1]=1-c1-c2, p[2]=1-c1-c2-c3 and p[3]=1-c1-c2-c3-c4

function myfunc, x, p
c1 = 1 - p[0]
c2 = p[0]-p[1]
c3 = p[1]-p[2]
c4 = p[2]-p[3]
return, somefunctionof(c1,c2,c3,c4)
end

Have a good Sunday!
Michael
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to obtain pixel location
Next Topic: Re: Transpose(A)*P*A

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:57:25 PDT 2025

Total time taken to generate the page: 0.16346 seconds