<?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 Hi Zhang, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978569#M17284</link>
    <description>Hi Zhang,

I'm having same problem as above. I understood that m has to be same or larger than n.
But in case, my fuction actually has smaller m than n, how should I handle? Should I just copy existing function vector to make the size o n? Or should I just set to zero for the remaining fvec array?</description>
    <pubDate>Thu, 30 Aug 2018 16:09:51 GMT</pubDate>
    <dc:creator>Yoon__JAEGOON</dc:creator>
    <dc:date>2018-08-30T16:09:51Z</dc:date>
    <item>
      <title>Q: dtrnlsp_init for initializing the solver of a nonlinear least squares problem.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978566#M17281</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;We're replacing our current solver for a non-linear least squares problem without constraints&amp;nbsp;with the MKL version.&lt;/P&gt;
&lt;P&gt;First tried implementing it in a simple problem:&amp;nbsp;F(x) : n = 6 &amp;nbsp;→&amp;nbsp;m = 1&lt;/P&gt;
&lt;P&gt;Followed the example in&amp;nbsp;ex_nlsqp_c_c.htm.&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp;dtrnlsp_init returns&amp;nbsp;TR_INVALID_OPTION instead of&amp;nbsp;TR_SUCCESS.&lt;/P&gt;
&lt;P&gt;After going through the code, still puzzled as to why given that this seems to be straightforward.&lt;/P&gt;
&lt;P&gt;Any insight would be much appreciated.&lt;/P&gt;
&lt;P&gt;__ System Config___&lt;/P&gt;
&lt;P&gt;OS: Windows 7 x64&lt;/P&gt;
&lt;P&gt;IDE: MS VS 2010&amp;nbsp;C++&lt;/P&gt;
&lt;P&gt;Compiler: Intel Composer XE 2013&amp;nbsp;C++&lt;/P&gt;
&lt;P&gt;MKL:&amp;nbsp;11.0.5&lt;/P&gt;
&lt;P&gt;___Code fragment___&lt;/P&gt;
&lt;P&gt;// Intel MKL&lt;BR /&gt;#include &amp;lt;mkl.h&amp;gt;&lt;BR /&gt;#include &amp;lt;mkl_rci.h&amp;gt;&lt;BR /&gt;#include &amp;lt;mkl_types.h&amp;gt;&lt;BR /&gt;#include &amp;lt;mkl_service.h&amp;gt;&lt;/P&gt;
&lt;P&gt;. . .&lt;/P&gt;
&lt;P&gt;double MyClass::SimpleTestMemberFunction&lt;BR /&gt;( std::array&amp;lt;double,_6D&amp;gt;&amp;amp; rtParameter )&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;int byteAlignment = 64;&lt;/P&gt;
&lt;P&gt;// 1: Initialization&lt;BR /&gt;_TRNSP_HANDLE_t handle;&lt;/P&gt;
&lt;P&gt;MKL_INT n = 6; // x has 6 d.o.f.&lt;BR /&gt;MKL_INT m = 1; // f(x): scalar function&lt;BR /&gt;double* rtPrmtrMKL = NULL;&lt;BR /&gt;double epsMKL[6]; // 6 precision stop-criteria array [see MKL manual for definitions]&lt;BR /&gt;MKL_INT nMaxIter = 1000;&lt;BR /&gt;MKL_INT nMaxTrialIter = 100;&lt;BR /&gt;double stepBound = 0.0;&lt;BR /&gt;MKL_INT taskStatus;&lt;/P&gt;
&lt;P&gt;rtPrmtrMKL = static_cast&amp;lt;double*&amp;gt;(MKL_malloc( static_cast&amp;lt;size_t&amp;gt;(n) * sizeof(double), byteAlignment));&lt;/P&gt;
&lt;P&gt;if (rtPrmtrMKL == NULL)&lt;BR /&gt;{&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "rtPrmtrMKL: mkl_malloc memory allocation failure " &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;return -1.0;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;// Input parameter initialization&lt;/P&gt;
&lt;P&gt;for (int i = 0; i != n; i++)&lt;BR /&gt;rtPrmtrMKL&lt;I&gt; =&amp;nbsp;rtParameter&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;// Initialize precisions for stop-criteria &lt;BR /&gt;for (int i = 0; i != 6; i++)&lt;BR /&gt;epsMKL&lt;I&gt; = 1.e-05;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;// Initialize the nonlinear least squares solver &lt;BR /&gt;taskStatus = dtrnlsp_init&lt;BR /&gt;( &amp;amp;handle &lt;BR /&gt;, &amp;amp;n // Number of function variables&lt;BR /&gt;, &amp;amp;m // Dimension of function value&lt;BR /&gt;, rtPrmtrMKL // Solution vector: contains values x for f(x)&lt;BR /&gt;, epsMKL // Precisions for stop-criteria [see manual for details]&lt;BR /&gt;, &amp;amp;nMaxIter // Maximum number of iterations&lt;BR /&gt;, &amp;amp;nMaxTrialIter // Maximum number of iterations of calculation of trial-step&lt;BR /&gt;, &amp;amp;stepBound ); // Initial step bound&lt;/P&gt;
&lt;P&gt;if (taskStatus != TR_SUCCESS)&lt;BR /&gt;{&lt;BR /&gt;if (taskStatus == TR_INVALID_OPTION)&lt;BR /&gt;{&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "dtrnlsp_init: error in the input parameters; taskStatus = TR_INVALID_OPTION " &amp;lt;&amp;lt; TR_INVALID_OPTION &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;mkl_free_buffers();&lt;BR /&gt;mkl_free( rtPrmtrMKL);&lt;BR /&gt;return -1.0;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;if (taskStatus == TR_OUT_OF_MEMORY)&lt;BR /&gt;{&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "dtrnlsp_init: memory error" &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;mkl_free_buffers();&lt;BR /&gt;mkl_free( rtPrmtrMKL);&lt;BR /&gt;return -1.0;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;Etc.&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2013 15:15:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978566#M17281</guid>
      <dc:creator>Audrius_S_</dc:creator>
      <dc:date>2013-08-19T15:15:40Z</dc:date>
    </item>
    <item>
      <title>MKL's trust-region solver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978567#M17282</link>
      <description>&lt;P&gt;MKL's trust-region solver solves nonlinear least square problems without boundary constraints defined as:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mklman/GUID-9DB0DCCE-A251-46E9-9B27-31EE31728B1B-low.jpg" height="41" width="451" /&gt;&lt;/P&gt;
&lt;P&gt;Note that m is larger than or equal to n. In your code, n = 6 and m = 1. This is the problem.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 18:07:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978567#M17282</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-08-20T18:07:31Z</dc:date>
    </item>
    <item>
      <title>Realized this after posting ;</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978568#M17283</link>
      <description>&lt;P&gt;Realized this after posting ;-)&lt;/P&gt;
&lt;P&gt;Thank you for your prompt answer.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2013 21:33:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978568#M17283</guid>
      <dc:creator>Audrius_S_</dc:creator>
      <dc:date>2013-09-03T21:33:34Z</dc:date>
    </item>
    <item>
      <title>Hi Zhang,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978569#M17284</link>
      <description>Hi Zhang,

I'm having same problem as above. I understood that m has to be same or larger than n.
But in case, my fuction actually has smaller m than n, how should I handle? Should I just copy existing function vector to make the size o n? Or should I just set to zero for the remaining fvec array?</description>
      <pubDate>Thu, 30 Aug 2018 16:09:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978569#M17284</guid>
      <dc:creator>Yoon__JAEGOON</dc:creator>
      <dc:date>2018-08-30T16:09:51Z</dc:date>
    </item>
    <item>
      <title>The problem as described by</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978570#M17285</link>
      <description>&lt;P&gt;The problem as described by you is ill-posed.&lt;/P&gt;

&lt;P&gt;Consider the following counterexample:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x&lt;SUP&gt;2&lt;/SUP&gt; + y&lt;SUP&gt;2&lt;/SUP&gt; = 9&lt;/P&gt;

&lt;P&gt;There are two variables, x and y, and one "data" point. What criterion would you use to certify a candidate point (x, y) as a "solution"?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Any point on the circle with center at the origin and radius = 3 satisfies the equation. How then, would you pick just one such point as "the solution"?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 09:00:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Q-dtrnlsp-init-for-initializing-the-solver-of-a-nonlinear-least/m-p/978570#M17285</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2018-08-31T09:00:37Z</dc:date>
    </item>
  </channel>
</rss>

