<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use Nonlinear Least Squares Problem without Constraints in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807785#M3558</link>
    <description>- Ubuntu 10.10&lt;BR /&gt;- MKL 10.3.2.137&lt;BR /&gt;- 32 Bit&lt;BR /&gt;- what you are asking for with linking line? - All the LIBS? If yes see the provided makefile..</description>
    <pubDate>Thu, 10 Feb 2011 10:29:08 GMT</pubDate>
    <dc:creator>jeremy_74</dc:creator>
    <dc:date>2011-02-10T10:29:08Z</dc:date>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807761#M3534</link>
      <description>Hi together,&lt;BR /&gt;&lt;BR /&gt;I'm quite new with using the MKL and also not a big mathematic freak. At the moment I try to solve a Function from the type:&lt;BR /&gt;&lt;BR /&gt;ai + bi * x1 = ci * x2 / (di + x3)&lt;BR /&gt;&lt;BR /&gt;x1, x2, x3 are unknown, I have initial estimations for x2 and x3. &lt;BR /&gt;&lt;BR /&gt;Now the questions:&lt;BR /&gt;1.) Can I even use the MKL for that, espacially the strnlsp* functiopns?&lt;BR /&gt;2.) in the init function how can I match these function to the transfer parameters and what the... is the length of an function m ? &lt;BR /&gt;&lt;BR /&gt;I found some examples, but those are not really good documented - so I really need your help. &lt;BR /&gt;&lt;BR /&gt;Addition: You can not offend me my critizies my knowledge at mathematic.... ;-)&lt;BR /&gt;&lt;BR /&gt;Thanks for your best effort.</description>
      <pubDate>Mon, 07 Feb 2011 11:09:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807761#M3534</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-07T11:09:57Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807762#M3535</link>
      <description>Hi,&lt;DIV&gt;Basically speaking the problem is not clear for me. Is ai,bi,ci,di,x1,x2 and x3 scalar variables? If yes, why you can't calculate x1 asx1=(ci*x2/(di+x3)-ai)/bi?&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Feb 2011 02:55:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807762#M3535</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-08T02:55:20Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807763#M3536</link>
      <description>And one more question: how many equations you have in your system?&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Feb 2011 04:02:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807763#M3536</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-08T04:02:59Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807764#M3537</link>
      <description>one more question: &lt;B&gt;"I found some examples, but those are not really good documented - so I really need your help."&lt;/B&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;What examples are You talking about and how we should improve the documentation?&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Feb 2011 06:30:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807764#M3537</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-08T06:30:06Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807765#M3538</link>
      <description>The following comments are based on what I think is the purpose of the calculation:&lt;BR /&gt;&lt;BR /&gt;Given data vectors &lt;I&gt;a, b, c, d&lt;/I&gt; of size &lt;I&gt;n&lt;/I&gt; &amp;gt;= 3, scalar coefficients &lt;I&gt;x_1, x_2&lt;/I&gt; and &lt;I&gt;x_3&lt;/I&gt; are to be found such that the &lt;I&gt;n&lt;/I&gt; equations&lt;BR /&gt;&lt;BR /&gt; &lt;I&gt;a_i + b_i x_1 = c_i x_2 / (d_i + x_3), i = 1 .. n,&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;are satisfied in the least squares sense.&lt;BR /&gt;&lt;BR /&gt;Being curious myself about the capabilities of MKL in this task, I decided to write up a short test program, adapted from the example in the MKL documentation ("Example. dtrnlsp Usage in Fortran"), with fake data made up for &lt;I&gt;a, b, c, d&lt;/I&gt;, and reasonable termination criteria for the iterative solution. Note that the documentation contains a typo, as flagged in the source below. (Edit 2/8/2010: the typo has been corrected).&lt;BR /&gt;&lt;BR /&gt;The result is&lt;BR /&gt;&lt;BR /&gt; strnlsp j74 ... PASS 3.3930975E-03 3.3930975E-03&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]program nlfitmkl&lt;BR /&gt;implicit none&lt;BR /&gt;&lt;BR /&gt;INCLUDE 'mkl_rci.fi'&lt;BR /&gt;&lt;BR /&gt;external j74&lt;BR /&gt;real, dimension(3) ::  x = (/ 3.7, 1.9, 0.17 /)&lt;BR /&gt;integer :: i,j,st_cr,res,n=3,m=4,iter,iter1=10,iter2=5,rci_req&lt;BR /&gt;real :: eps(6) = (/0.01, 0.01, 0.01, 0.01, 0.01, 0.01 /),rs=90.0&lt;BR /&gt;real :: r1,r2,jac_eps=1e-3,fvec(4), fjac(4,3)&lt;BR /&gt;integer*8 hndl&lt;BR /&gt;logical :: success = .FALSE.&lt;BR /&gt;&lt;BR /&gt;res = strnlsp_init(hndl,n,m,x,eps,iter1,iter2,rs)&lt;BR /&gt;if (res /= TR_SUCCESS) then&lt;BR /&gt;   print *, ' Error in strnlsp_init',res&lt;BR /&gt;   call mkl_free_buffers()&lt;BR /&gt;   stop 1&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;RCI_req = 0&lt;BR /&gt;do i=1,m&lt;BR /&gt;   fvec(i) = 0&lt;BR /&gt;   do j=1,n&lt;BR /&gt;      fjac(i,j) = 0&lt;BR /&gt;   end do&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;do while(.not. success)&lt;BR /&gt;   res = strnlsp_solve(hndl,fvec,fjac,rci_req)&lt;BR /&gt;   if (res /= TR_SUCCESS) then&lt;BR /&gt;      print *, ' Error in strnlsp_solve', res&lt;BR /&gt;      call mkl_free_buffers()&lt;BR /&gt;      stop 2&lt;BR /&gt;   endif&lt;BR /&gt;   select case (rci_req)&lt;BR /&gt;      case (-1,-2,-3,-4,-5,-6)&lt;BR /&gt;      success = .true.&lt;BR /&gt;      case (1)&lt;BR /&gt;         call j74(m,n,x,fvec)&lt;BR /&gt;      case (2)&lt;BR /&gt;         res = sjacobi(j74,n,m,fjac,x,jac_eps)&lt;BR /&gt;         if(res /= TR_SUCCESS) then&lt;BR /&gt;            print *, ' Error in sjacobi'&lt;BR /&gt;            call mkl_free_buffers()&lt;BR /&gt;            stop 3&lt;BR /&gt;         endif&lt;BR /&gt;   end select&lt;BR /&gt;end do&lt;BR /&gt;res=strnlsp_get(hndl,iter,st_cr,r1,r2)   ! &amp;lt;---- MKL doc erroneously shows r1_r2&lt;BR /&gt;if (res /= TR_SUCCESS) then&lt;BR /&gt;   print *,' Error in strnlsp_get'&lt;BR /&gt;   call mkl_free_buffers&lt;BR /&gt;   stop 4&lt;BR /&gt;endif&lt;BR /&gt;res = strnlsp_delete(hndl)&lt;BR /&gt;if (res /= TR_SUCCESS) then&lt;BR /&gt;   print *, ' Error in strnlsp_delete'&lt;BR /&gt;   call mkl_free_buffers()&lt;BR /&gt;   stop 5&lt;BR /&gt;endif&lt;BR /&gt;call mkl_free_buffers()&lt;BR /&gt;if(r2 &amp;lt; 4e-3) then&lt;BR /&gt;   print *,' strnlsp j74 ... PASS',r1,r2&lt;BR /&gt;else&lt;BR /&gt;   print *,' strnlsp j74 ... FAIL',r1,r2&lt;BR /&gt;endif&lt;BR /&gt;end program nlfitmkl&lt;BR /&gt;&lt;BR /&gt;subroutine j74(m,n,x,f)&lt;BR /&gt;implicit none&lt;BR /&gt;real, dimension(4) :: &amp;amp;&lt;BR /&gt;   a=  (/ -20.394,  -21.862,  -16.822,  -21.395 /), &amp;amp;&lt;BR /&gt;   b = (/   5.137,   5.365,    3.418,     5.383 /), &amp;amp;&lt;BR /&gt;   c = (/ -1.752,   -2.554,   -2.282,    -1.88  /), &amp;amp;&lt;BR /&gt;   d = (/  2.228,    2.240,    0.868,     2.25 /)&lt;BR /&gt;integer, intent(in) :: m,n&lt;BR /&gt;integer :: i&lt;BR /&gt;real, dimension(n), intent(in out) :: x&lt;BR /&gt;real, dimension(m), intent(in out) :: f&lt;BR /&gt;do i=1,m&lt;BR /&gt;   f(i)=a(i)+x(1)*b(i)-x(2)*c(i)/(d(i)+x(3))&lt;BR /&gt;end do&lt;BR /&gt;return&lt;BR /&gt;end subroutine j74&lt;BR /&gt;[/fortran]&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Feb 2011 12:10:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807765#M3538</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-02-08T12:10:24Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807766#M3539</link>
      <description>&lt;OL start="1"&gt;&lt;LI&gt;&lt;B&gt;res=strnlsp_get(hndl,iter,st_cr,r1,r2)!&amp;lt;----MKLdocerroneouslyshowsr1_r2 &lt;/B&gt;&lt;/LI&gt;&lt;/OL&gt;What version are talking about?</description>
      <pubDate>Tue, 08 Feb 2011 13:16:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807766#M3539</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-08T13:16:18Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807767#M3540</link>
      <description>Gennady,&lt;BR /&gt;&lt;BR /&gt;I am not sure which version this link pertains to. I had searched the Intel site, located the documentation, and bookmarked the HTML version of the reference manual, assuming that it would be updated whenever a new release of MKL was issued.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/appendices/mkl_appC_osr_dtrnlsp.html#appC-exC-43"&gt;http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/appendices/mkl_appC_osr_dtrnlsp.html#appC-exC-43&lt;/A&gt;</description>
      <pubDate>Tue, 08 Feb 2011 13:32:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807767#M3540</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-02-08T13:32:47Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807768#M3541</link>
      <description>aahh, thanks a lot!I didn't check these examples -:). We will remove the typo asap.</description>
      <pubDate>Tue, 08 Feb 2011 14:00:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807768#M3541</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-08T14:00:22Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807769#M3542</link>
      <description>fyi - the typo was removed..</description>
      <pubDate>Wed, 09 Feb 2011 06:47:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807769#M3542</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-09T06:47:07Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807770#M3543</link>
      <description>Thanks a lot for all this help!&lt;BR /&gt;&lt;BR /&gt;Many things are now clear and understood. I translated your example to my enviroment and to C and I can observe the single steps working. &lt;BR /&gt;&lt;BR /&gt;But there occures an new problem. After the second Iteration (the Jacobi Matrix is been calculated the first time in 5 step, with success) - the strnlsp_solve crash with an segmentation fault or better with the output " unknown machine code instruction". &lt;BR /&gt;&lt;BR /&gt;Do you have any idear what is going wrong here?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Feb 2011 13:12:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807770#M3543</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-09T13:12:50Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807771#M3544</link>
      <description>My guess is that the MKL routines are not being called with the proper argument lists. Note that in this particular instance a function pointer is among the arguments.&lt;BR /&gt;&lt;BR /&gt;If you post the C source, it may be possible to locate the bug.</description>
      <pubDate>Wed, 09 Feb 2011 13:35:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807771#M3544</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-02-09T13:35:08Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807772#M3545</link>
      <description>&lt;PRE&gt;[cpp]    //Optimierung
    //Here I copy my local parameters to global variables for using them in the global function
    CopyCamParaToGlobalVar();  
    _TRNSP_HANDLE_t handle;
    int n = 3; // Count of unknowns
    int m = m_imagePointX.size()*2;  // Count of Values
    float *x;
    x = (float*) malloc (sizeof (float)*n);
    x[0] = m_k1; // Initial values
    x[1] = m_f;
    x[2] = m_Tz;
    Ipp32f eps[6];
    eps[1] = 0.005;
    eps[2] = 0.005; 
    eps[3] = 0.005; 
    eps[4] = 0.005; 
    eps[5] = 0.005; 
    eps[6] = 0.005; 
    int iter1 = 1000;
    int iter2 = 100;
    Ipp32f rs = 90;

    //Init
    int res = strnlsp_init(&amp;amp;handle, &amp;amp;n, &amp;amp;m, x, eps, &amp;amp;iter1, &amp;amp;iter2, &amp;amp;rs);
    if (res != TR_SUCCESS)
    {
        std::cerr&amp;lt;&amp;lt;"Fehler bei Least Square Init ="&amp;lt;&lt;RES&gt;&amp;lt;&lt;:ENDL&gt; = 0.0; 
    for (int i = 0; i&lt;M&gt; = 0.0; 
    while(success == false)
    {
        std::cerr&amp;lt;&amp;lt;"Neue Runde = "&amp;lt;&lt;ITERATION&gt;&amp;lt;&lt;:ENDL&gt; &lt;BR /&gt;&lt;BR /&gt;and here the Output on the screen:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]Erfolg bei Least Square Init =1501 n3 m140
Neue Runde = 0
Erfolg bei Least Square Solve Iteration=0 RCI_Request=1
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=0 x1=0.394556 x2=-0.0816883
Neue Runde = 1
Erfolg bei Least Square Solve Iteration=1 RCI_Request=2
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=27 x1=0.394556 x2=-0.0816883
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=-27 x1=0.394556 x2=-0.0816883
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=0 x1=27.3946 x2=-0.0816883
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=0 x1=-26.6054 x2=-0.0816883
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=0 x1=0.394556 x2=26.9183
CalculateFunctionTsai - Start
CalculateFunctionTsai - End mit x0=0 x1=0.394556 x2=-27.0817
Erfolg bei Jacobi Iteration=1 n=3 m=140
Neue Runde = 2
Ungltiger Maschinenbefehl

[/bash]&lt;/PRE&gt; The last means SIGILL&lt;BR /&gt;&lt;/:ENDL&gt;&lt;/ITERATION&gt;&lt;/M&gt;&lt;/:ENDL&gt;&lt;/RES&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Feb 2011 14:08:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807772#M3545</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-09T14:08:20Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807773#M3546</link>
      <description>I checked this example also and have some questions about:&lt;BR /&gt;&lt;BR /&gt;1.) in Line 36 (C-Code Example) MKL)INT - I think this should be MKL_INT&lt;BR /&gt;2.) I'm confused about the access to the elemts of x:&lt;BR /&gt;&lt;PRE&gt;[cpp]    for (i = 0; i &amp;lt; n/4; i++)

    {

        x [4*i]     = 3.0;

        x [4*i + 1] = -1.0;

        x [4*i + 2] = 0.0;

        x [4*i + 3] = 1.0;

    }[/cpp]&lt;/PRE&gt; &lt;BR /&gt; This will always steps through the loop once, right? Is there a deeper sense-which I do not understand?&lt;BR /&gt;&lt;BR /&gt;And at the end the same again:&lt;BR /&gt;&lt;PRE&gt;[cpp]void extended_powell (MKL_INT *m, MKL_INT *n, double *x, double *f)

{

    MKL_INT i;

 

    for (i = 0; i &amp;lt; (*n)/4; i++)

    {

       f [4*i] = x [4*i] + 10.0*x [4*i + 1];

       f [4*i + 1] = 2.2360679774998*(x [4*i + 2] - x [4*i + 3]);

       f [4*i + 2] = (x [4*i + 1] - 2.0*x [4*i + 2])*(x [4*i + 1] - 2.0*x [4*i + 2]);

       f [4*i + 3] = 3.1622776601684*(x [4*i] - x [4*i + 3])*(x [4*i] - x [4*i + 3]);

    }

    return;

}[/cpp]&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Feb 2011 15:52:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807773#M3546</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-09T15:52:24Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807774#M3547</link>
      <description>Gentlemen,&lt;DIV&gt;First of all thank you for so deep interest in Trust Region functionality! Nevertheless Jeremy could you provide us your example fully (subroutine CalculateFunctionTsai and other) to reproduce your problem.&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Feb 2011 16:45:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807774#M3547</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-09T16:45:21Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807775#M3548</link>
      <description>Aboutextendet_powell function: you can set m=n=8 for example than your example will step through loop twice.&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Feb 2011 16:58:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807775#M3548</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-09T16:58:44Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807776#M3549</link>
      <description>Sorry that I can not share the whole code, but for a better understanding I can provide all the inputs and the code parts which are interessting for this error:&lt;BR /&gt;&lt;BR /&gt;1.) The CalculateFunctionTsai Subroutine:&lt;BR /&gt;&lt;PRE&gt;[cpp]void CalculateFunctionTsai(int *m, int *n, double *x, double *FValues)
{
	std::cerr&amp;lt;&amp;lt;"CalculateFunctionTsai - Start m="&amp;lt;&amp;lt; *m&amp;lt;&lt;:ENDL&gt; - g_cx) / g_sx;      // [mm]
		yd = g_dy * (g_imagePointY&lt;I&gt; - g_cy);              // [mm]
		r_squared = pow(xd , 2) + pow(yd, 2);
		ay = yd;
		ax = xd;
		by = yd * r_squared;
		bx = xd * r_squared;
		cy = (g_R4 * g_refPointX&lt;I&gt; + g_R5 * g_refPointY&lt;I&gt; + g_R6 * g_refPointZ&lt;I&gt; + g_Ty );
		cx = (g_R1 * g_refPointX&lt;I&gt; + g_R2 * g_refPointY&lt;I&gt; + g_R3 * g_refPointZ&lt;I&gt; + g_Tx );
		d = (g_R7 * g_refPointX&lt;I&gt; + g_R8 * g_refPointY&lt;I&gt; + g_R9 * g_refPointZ&lt;I&gt;);
		*FValues = ax + bx * x[0] - cx * x[1] / (d + x[2]);
		++FValues;
		*FValues = ay + by * x[0] - cy * x[1] / (d + x[2]);
		++FValues;
	}
	std::cerr&amp;lt;&amp;lt;"CalculateFunctionTsai - End mit x0="&amp;lt;&lt;X&gt; &lt;BR /&gt;2.) The Start Parameters:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]IS::Error CameraCalib::ReadCalib()
{

	//Kalibrierwerte ToDo: Wird bergeben
	int countSpan = 7;
	int countRow = 10;
	int countTotal = 70;
	Ipp32f xRefOffset = 100.0;
	Ipp32f yRefOffset = 100.0;
	Ipp32f xRefStepSize = 40.0;
	Ipp32f yRefStepSize = 80.0;

	Ipp32f xImg[70] ={ 42.0, 127.0, 214.0, 305.0, 399.0, 490.5, 576.0,
							   36.0, 121.5, 210.0, 304.5, 399.0, 492.0, 580.5,
							   31.5, 115.5, 207.0, 301.5, 397.5, 492.0, 580.5,
							   27.0, 114.0, 204.0, 300.0, 396.0, 492.0, 580.5,
							   22.5, 111.0, 202.5, 298.5, 394.5, 490.5, 580.5,
							   21.0, 108.0, 201.0, 295.5, 393.0, 389.0, 577.5,
							   18.0, 106.5, 199.5, 294.0, 391.5, 487.5, 576.0,
							   16.5, 105.0, 198.0, 292.5, 388.5, 484.5, 573.0,
							   16.5, 103.5, 196.5, 292.5, 387.0, 481.5, 570.0,
							   18.0, 103.5, 196.5, 291.0, 384.0, 477.0, 565.5};

	Ipp32f yImg[70] ={ 34.0,  33.0,  29.0,  31.0,  35.0,  40.5,  49.5,
							   75.0,  73.5,  73.5,  73.5,  78.0,  82.5,  90.0,
							  115.5, 117.0, 117.0, 117.5, 121.5, 126.0, 135.0,
							  162.0, 162.0, 163.5, 166.5, 165.5, 174.0, 178.5,
							  207.0, 208.5, 211.5, 214.5, 219.0, 222.0, 226.5,
							  253.5, 255.0, 259.5, 264.0, 267.0, 271.5, 273.0,
							  300.0, 303.0, 307.5, 312.0, 319.0, 318.0, 319.5,
							  346.5, 351.0, 357.0, 360.0, 364.5, 366.0, 367.5,
							  391.5, 399.0, 402.0, 408.0, 412.5, 412.5, 411.5,
							  436.5, 445.5, 451.5, 456.0, 459.0, 459.0, 456.0};

	m_refPointX.resize(countTotal);
	m_refPointY.resize(countTotal);
	m_refPointZ.resize(countTotal);
	m_imagePointX.resize(countTotal);
	m_imagePointY.resize(countTotal);

	int t=0;

	for(int y=0; y&lt;COUNTROW&gt; = xImg&lt;T&gt;;
			m_imagePointY&lt;T&gt; = yImg&lt;T&gt;;

			m_refPointX&lt;T&gt; = xRefOffset + x * xRefStepSize;
			m_refPointY&lt;T&gt; = yRefOffset + y * yRefStepSize;
			m_refPointZ&lt;T&gt; = 10;
			std::cerr&amp;lt;&amp;lt;"X: "&amp;lt;&lt;M_REFPOINTX&gt;&lt;T&gt;&amp;lt;&amp;lt;" Y: "&amp;lt;&lt;M_REFPOINTY&gt;&lt;T&gt;&amp;lt;&amp;lt;" ; ";
			++t;
		}
		std::cerr&amp;lt;&lt;:ENDL&gt; &lt;BR /&gt;&lt;BR /&gt;3.) The already calculated parameters:&lt;BR /&gt;m_Ty =-781.346&lt;BR /&gt;m_Tx =-0.772715&lt;BR /&gt;m_sx =1.5971&lt;BR /&gt;m_R1=-0.874132 m_R2=0.025665 m_R3=0.48501&lt;BR /&gt;m_R4=-0.407516 m_R5=-0.582054 m_R6=-0.703665&lt;BR /&gt;m_R7=0.264242 m_R8=-0.812745 m_R9=0.519251&lt;BR /&gt;&lt;BR /&gt;I guess this is all.&lt;BR /&gt;&lt;BR /&gt;There is are some informations I want to share with you:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;I found out, that when I overwrite the results of fjac again width 0.0 after calling sjacobi(CalculateFunctionTsai,&amp;amp;n,&amp;amp;m,fjac,x,eps); (line 67)-&amp;gt; the error don't occures! It seems like it have to do width the content of fjac. -&amp;gt; I'm really confused&lt;/LI&gt;&lt;LI&gt;It doesn't make any difference if I use the double functions instead of the Real Functions.&lt;/LI&gt;&lt;/UL&gt;Last but not least all variables called g_* are only copies of the corresponding m_* variable&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/:ENDL&gt;&lt;/T&gt;&lt;/M_REFPOINTY&gt;&lt;/T&gt;&lt;/M_REFPOINTX&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/COUNTROW&gt;&lt;/PRE&gt;&lt;/X&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/:ENDL&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Feb 2011 17:16:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807776#M3549</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-09T17:16:30Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807777#M3550</link>
      <description>There is no difference, when I limit m to n.</description>
      <pubDate>Wed, 09 Feb 2011 19:22:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807777#M3550</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-09T19:22:06Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807778#M3551</link>
      <description>Hi,&lt;DIV&gt;Its
really difficult to reproduce your testcase from parts of program. Could you
combine really small example that I could compile and execute on my side? You
dont need to share whole code but without testcase it is really hard to find
out rootcase of your problem.&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Feb 2011 04:22:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807778#M3551</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-10T04:22:12Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807779#M3552</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I transfer all to a small C-Programm. This should help to reproduce the error:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]/*
 * test.cpp
 *
 *  Created on: 10.02.2011
 *      Author: jeremy
 */

#include &lt;MKL_RCI.H&gt;
#include &lt;MATH.H&gt;
#include &lt;IOSTREAM&gt;
#include &lt;VECTOR&gt;


	//! Innere Kalibrimain.o:(.bss+0x88): first defined here
	float m_f, m_cx, m_cy, m_k1, m_k2;

	//! Rotationsmatrix der Kamera
	float m_R1, m_R2, m_R3, m_R4, m_R5, m_R6, m_R7, m_R8, m_R9;

	//!Translationsmatrix
	float m_Tx, m_Ty, m_Tz;

	//! Sensorwerte
	float m_dxs, m_dy, m_Ncx, m_Nfx, m_sx;

	//! Vector Referenzpunkte
	std::vector&lt;DOUBLE&gt; m_refPointX, m_refPointY, m_refPointZ;

	//! Vector Bildpunkte
	std::vector&lt;DOUBLE&gt; m_imagePointX, m_imagePointY;

void CalculateFunctionTsai(int *m, int *n, double *x, double *FValues)
{
	std::cerr&amp;lt;&amp;lt;"CalculateFunctionTsai - Start m="&amp;lt;&amp;lt; *m&amp;lt;&lt;:ENDL&gt; - m_cx) / m_sx;      // [mm]
		yd = m_dy * (m_imagePointY&lt;I&gt; - m_cy);              // [mm]
		r_squared = pow(xd , 2) + pow(yd, 2);
		ay = yd;
		ax = xd;
		by = yd * r_squared;
		bx = xd * r_squared;
		cy = (m_R4 * m_refPointX&lt;I&gt; + m_R5 * m_refPointY&lt;I&gt; + m_R6 * m_refPointZ&lt;I&gt; + m_Ty );
		cx = (m_R1 * m_refPointX&lt;I&gt; + m_R2 * m_refPointY&lt;I&gt; + m_R3 * m_refPointZ&lt;I&gt; + m_Tx );
		d = (m_R7 * m_refPointX&lt;I&gt; + m_R8 * m_refPointY&lt;I&gt; + m_R9 * m_refPointZ&lt;I&gt;);
		*FValues = ax + bx * x[0] - cx * x[1] / (d + x[2]);
		++FValues;
		*FValues = ay + by * x[0] - cy * x[1] / (d + x[2]);
		++FValues;
	}
	std::cerr&amp;lt;&amp;lt;"CalculateFunctionTsai - End mit x0="&amp;lt;&lt;X&gt; = xImg&lt;T&gt;;
			m_imagePointY&lt;T&gt; = yImg&lt;T&gt;;

			m_refPointX&lt;T&gt; = xRefOffset + x * xRefStepSize;
			m_refPointY&lt;T&gt; = yRefOffset + y * yRefStepSize;
			m_refPointZ&lt;T&gt; = 10;
			std::cerr&amp;lt;&amp;lt;"X: "&amp;lt;&lt;M_REFPOINTX&gt;&lt;T&gt;&amp;lt;&amp;lt;" Y: "&amp;lt;&lt;M_REFPOINTY&gt;&lt;T&gt;&amp;lt;&amp;lt;" ; ";
			++t;
		}
		std::cerr&amp;lt;&lt;:ENDL&gt; = 0.0;
	for (int i = 0; i&amp;lt; (m * n); ++i)
		fjac&lt;I&gt; = 0.0;

	while(success == false)
	{
		std::cerr&amp;lt;&amp;lt;"Neue Runde = "&amp;lt;&lt;ITERATIONCOUNTER&gt;&amp;lt;&lt;:ENDL&gt; best regards Jeremy&lt;/:ENDL&gt;&lt;/ITERATIONCOUNTER&gt;&lt;/I&gt;&lt;/:ENDL&gt;&lt;/T&gt;&lt;/M_REFPOINTY&gt;&lt;/T&gt;&lt;/M_REFPOINTX&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/X&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/:ENDL&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/VECTOR&gt;&lt;/IOSTREAM&gt;&lt;/MATH.H&gt;&lt;/MKL_RCI.H&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Feb 2011 09:02:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807779#M3552</guid>
      <dc:creator>jeremy_74</dc:creator>
      <dc:date>2011-02-10T09:02:50Z</dc:date>
    </item>
    <item>
      <title>How to use Nonlinear Least Squares Problem without Constraints</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807780#M3553</link>
      <description>&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;Jeremy, may be I missed something the part of discussions,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;but you mentioned above that some crash happened: "the strnlsp_solve crash with an segmentation fault or better with the output " unknown machine code instruction"."&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;I quickly checked your example - the test finished without run-time problems..&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Feb 2011 09:37:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-Nonlinear-Least-Squares-Problem-without-Constraints/m-p/807780#M3553</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-02-10T09:37:38Z</dc:date>
    </item>
  </channel>
</rss>

