<?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 Thank you for the suggestions in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013736#M19378</link>
    <description>&lt;P&gt;Thank you for the suggestions! I'd like to try both ways.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;One way is to add an array containing the parameters to the argument list of the vector function that is being optimized. You declare and initialize the array in the caller of the optimizer routine, and take care to modify the DJACOBI routine if you are using numerical evaluation of the Jacobian.&lt;/P&gt;

&lt;P&gt;Alternatively, in Fortran, put your parameters declarations and initializations into a module, and USE that module in the callback subroutine. For example:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE PARAMETERS
   IMPLICIT NONE
   DOUBLE PRECISION :: P(5) = [ 10.D0, 2.2360679774998D0, -2.D0, &amp;amp;
                                3.1622776601684D0, -1D0 ]
END MODULE PARAMETERS

SUBROUTINE EXTENDED_POWELL (M, N, X, F)
  USE PARAMETERS
  IMPLICIT NONE
  INTEGER M, N
  DOUBLE PRECISION X (*), F (*)
  INTEGER I

  DO I = 1, N/4
      F (4*I-3) = X(4*I - 3) + P(1) * X(4*I - 2)
      F (4*I-2) = P(2)*(X(4*I-1) - X(4*I))
      F (4*I-1) = (X(4*I-2) + P(3)*X(4*I-1))**2
      F (4*I)   = P(4)*(X(4*I-3) +P(5)* X(4*I))**2
  ENDDO

END SUBROUTINE EXTENDED_POWELL
&lt;/PRE&gt;

&lt;P&gt;Similarly, in C, you can use global variables to contain the parameter values.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2014 15:36:06 GMT</pubDate>
    <dc:creator>Cheng_C_</dc:creator>
    <dc:date>2014-05-14T15:36:06Z</dc:date>
    <item>
      <title>Parameters of the objective function for the nonlinear fitting routine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013734#M19376</link>
      <description>&lt;P&gt;I want to conduct a nonlinear least square fitting using MKL. However, I don't know how I can introduce some additional parameters for the objective function. Does anybody have some ideas?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;This is the introduction of the routine:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;A href="https://software.intel.com/en-us/node/471086" target="_blank"&gt;https://software.intel.com/en-us/node/471086&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;This is one example code for the routine:&amp;nbsp;https://software.intel.com/en-us/node/471540&lt;/P&gt;

&lt;P&gt;How can I past some parameters for the objective function (the f(x) function in the introduction or the extendet_powell() function in the example code)? Thanks very much.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 03:24:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013734#M19376</guid>
      <dc:creator>Cheng_C_</dc:creator>
      <dc:date>2014-05-14T03:24:48Z</dc:date>
    </item>
    <item>
      <title>Put your parameters</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013735#M19377</link>
      <description>&lt;P&gt;One way is to add an array containing the parameters to the argument list of the vector function that is being optimized. You declare and initialize the array in the caller of the optimizer routine, and take care to modify the DJACOBI routine if you are using numerical evaluation of the Jacobian.&lt;/P&gt;

&lt;P&gt;Alternatively, in Fortran, put your parameters declarations and initializations into a module, and USE that module in the callback subroutine. For example:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE PARAMETERS
   IMPLICIT NONE
   DOUBLE PRECISION :: P(5) = [ 10.D0, 2.2360679774998D0, -2.D0, &amp;amp;
                                3.1622776601684D0, -1D0 ]
END MODULE PARAMETERS

SUBROUTINE EXTENDED_POWELL (M, N, X, F)
  USE PARAMETERS
  IMPLICIT NONE
  INTEGER M, N
  DOUBLE PRECISION X (*), F (*)
  INTEGER I

  DO I = 1, N/4
      F (4*I-3) = X(4*I - 3) + P(1) * X(4*I - 2)
      F (4*I-2) = P(2)*(X(4*I-1) - X(4*I))
      F (4*I-1) = (X(4*I-2) + P(3)*X(4*I-1))**2
      F (4*I)   = P(4)*(X(4*I-3) +P(5)* X(4*I))**2
  ENDDO

END SUBROUTINE EXTENDED_POWELL
&lt;/PRE&gt;

&lt;P&gt;Similarly, in C, you can use global variables to contain the parameter values.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 12:23:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013735#M19377</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-05-14T12:23:00Z</dc:date>
    </item>
    <item>
      <title>Thank you for the suggestions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013736#M19378</link>
      <description>&lt;P&gt;Thank you for the suggestions! I'd like to try both ways.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;One way is to add an array containing the parameters to the argument list of the vector function that is being optimized. You declare and initialize the array in the caller of the optimizer routine, and take care to modify the DJACOBI routine if you are using numerical evaluation of the Jacobian.&lt;/P&gt;

&lt;P&gt;Alternatively, in Fortran, put your parameters declarations and initializations into a module, and USE that module in the callback subroutine. For example:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE PARAMETERS
   IMPLICIT NONE
   DOUBLE PRECISION :: P(5) = [ 10.D0, 2.2360679774998D0, -2.D0, &amp;amp;
                                3.1622776601684D0, -1D0 ]
END MODULE PARAMETERS

SUBROUTINE EXTENDED_POWELL (M, N, X, F)
  USE PARAMETERS
  IMPLICIT NONE
  INTEGER M, N
  DOUBLE PRECISION X (*), F (*)
  INTEGER I

  DO I = 1, N/4
      F (4*I-3) = X(4*I - 3) + P(1) * X(4*I - 2)
      F (4*I-2) = P(2)*(X(4*I-1) - X(4*I))
      F (4*I-1) = (X(4*I-2) + P(3)*X(4*I-1))**2
      F (4*I)   = P(4)*(X(4*I-3) +P(5)* X(4*I))**2
  ENDDO

END SUBROUTINE EXTENDED_POWELL
&lt;/PRE&gt;

&lt;P&gt;Similarly, in C, you can use global variables to contain the parameter values.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 15:36:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Parameters-of-the-objective-function-for-the-nonlinear-fitting/m-p/1013736#M19378</guid>
      <dc:creator>Cheng_C_</dc:creator>
      <dc:date>2014-05-14T15:36:06Z</dc:date>
    </item>
  </channel>
</rss>

