<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>NMath configuration Archives - CenterSpace</title>
	<atom:link href="https://www.centerspace.net/tag/nmath-configuration/feed" rel="self" type="application/rss+xml" />
	<link>https://www.centerspace.net/tag/nmath-configuration</link>
	<description>.NET numerical class libraries</description>
	<lastBuildDate>Tue, 01 Mar 2016 17:20:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
<site xmlns="com-wordpress:feed-additions:1">104092929</site>	<item>
		<title>Building ASP.NET web applications with NMath</title>
		<link>https://www.centerspace.net/building-asp-net-web-applications-with-nmath</link>
					<comments>https://www.centerspace.net/building-asp-net-web-applications-with-nmath#respond</comments>
		
		<dc:creator><![CDATA[Trevor Misfeldt]]></dc:creator>
		<pubDate>Thu, 21 Feb 2013 16:04:14 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[NMath]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[NMath configuration]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://www.centerspace.net/blog/?p=4219</guid>

					<description><![CDATA[<p>NMath can be used to create ASP.NET web applications, just like any other .NET application. However, there are a few additional considerations for building and deploying ASP.NET applications. Referencing NMath To use NMath types in your application, add a reference to NMath.dll, just as you would with other types of .NET applications. If you are [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/building-asp-net-web-applications-with-nmath">Building ASP.NET web applications with NMath</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>NMath can be used to create ASP.NET web applications, just like any other .NET application. However, there are a few additional considerations for building and deploying ASP.NET applications.</p>
<h3>Referencing NMath</h3>
<p>To use NMath types in your application, add a reference to NMath.dll, just as you would with other types of .NET applications. If you are using web projects in Visual Studio, you can simply right-click the References folder and select the Add Reference… command. If you specify Copy Local = true in the reference’s properties, then the assembly will be copied to the /bin directory of the web application, facilitating deployment to a web server.</p>
<p>If you are not using web projects in Visual Studio (e.g. using the “Open Web Site” command in Visual Studio, or using other development tools), then you can alternatively specify the reference in the web.config file, like this:</p>
<p><span style="font-family: Consolas;">&lt;configuration&gt;<br />
&lt;system.web&gt;<br />
&lt;compilation&gt;<br />
&lt;assemblies&gt;<br />
&lt;add assembly=&#8221;NMath, Version=&lt;Version&gt;, Culture=neutral, PublicKeyToken=&lt;Token&gt;&#8221;/&gt;<br />
&lt;/assemblies&gt;<br />
&lt;/compilation&gt;<br />
&lt;/system.web&gt;<br />
&lt;/configuration&gt;</span></p>
<p>We recommend that you do not add references to the kernel assemblies, as the appropriate kernel assembly for your platform is loaded at runtime and the appropriate native DLL is linked to the kernel.  Instead, place the kernel assemblies in the same location as the native DLLs, as described below.</p>
<p><strong>Note</strong>: when the web server launches an ASP.NET application for the first time, the assemblies in the /bin directory are loaded into memory. If the /bin directory contains a mixture of 32-bit and 64-bit assemblies (for example, both NMathKernelx86.dll and NMathKernelx64.dll), then depending on the configuration of the web server, the application may fail to start and instead throw an exception like this: “An attempt was made to load a program with an incorrect format.”</p>
<h3>Kernel Assemblies and Native DLLs</h3>
<p>For ASP.NET applications, Microsoft recommends that the /bin directory contain only .NET assemblies, not native DLLs.</p>
<p>If the deployment web server may not have NMath installed directly, then we recommend that the appropriate kernel assembly (NMathKernelx86.dll or NMathKernelx64.dll) and the appropriate native DLLs (e.g. nmath_native_x86.dll or nmath_native_x64.dll) be placed in a folder within the web application root directory, such as /NativeBin. This folder should then be copied to the deployment web server along with the rest of your application.</p>
<h3>NMath Configuration</h3>
<p>NMath settings can be configured as described in Chapter 1.5 of the <em>NMath User’s Guide.</em> However, when deploying web applications &#8212; especially to a shared hosting environment &#8212; it&#8217;s quite common not to know the details about the physical structure of the file system, and to have restricted access to the system’s environment variables. The references to resources within web apps are typically relative to the root of the virtual directory for the website, regardless of where they might physically reside on disk.</p>
<p>For this reason, starting in NMath 5.3, the ASP.NET ~ operator can be used to specify the location of the NMath native libraries and the log file, relative to the web application root. That is, these can be specified in the web.config file like this:</p>
<p><span style="font-family: Consolas;"> &lt;add key=&#8221;NMathNativeLocation&#8221; value=&#8221;~/NativeBin&#8221; /&gt;<br />
</span><span style="font-family: Consolas;"> &lt;add key=&#8221;NMathLogLocation&#8221; value=&#8221;~/Logs&#8221; /&gt;</span></p>
<p>It is not sufficient to use relative paths (e.g. &#8220;bin/&#8221;), since the executing assembly is usually the ASP.NET worker process, and depending on the web server configuration, the working directory will usually be a subdirectory of the Windows system directory (e.g. c:\windows\system32).</p>
<p>The ~ operator can only be used in ASP.NET applications; specifying this in a Windows application will cause the path to be resolved incorrectly.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/building-asp-net-web-applications-with-nmath">Building ASP.NET web applications with NMath</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.centerspace.net/building-asp-net-web-applications-with-nmath/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4219</post-id>	</item>
		<item>
		<title>NMath Configuration</title>
		<link>https://www.centerspace.net/nmath-configuration</link>
					<comments>https://www.centerspace.net/nmath-configuration#comments</comments>
		
		<dc:creator><![CDATA[Ken Baldwin]]></dc:creator>
		<pubDate>Fri, 20 Jul 2012 15:35:10 +0000</pubDate>
				<category><![CDATA[CenterSpace]]></category>
		<category><![CDATA[NMath]]></category>
		<category><![CDATA[NMath Stats]]></category>
		<category><![CDATA[.NET math library]]></category>
		<category><![CDATA[C# math library]]></category>
		<category><![CDATA[F# math library]]></category>
		<category><![CDATA[new C# math library release]]></category>
		<category><![CDATA[new NMath release]]></category>
		<category><![CDATA[new NMath Stats release]]></category>
		<category><![CDATA[NMath configuration]]></category>
		<category><![CDATA[VB math library]]></category>
		<guid isPermaLink="false">http://www.centerspace.net/blog/?p=3946</guid>

					<description><![CDATA[<p>Beginning with the release of NMath 5.2 and NMath Stats 3.5, NMath includes a new configuration system for controlling the loading of the NMath license key, kernel assembly, and native library. Based on customer feedback, we've designed this system to provide greater flexibility and security at deployment, and greater convenience in group development environments. We've also added optional logging to help debug configuration issues.</p>
<p>An NMath license file is no longer used.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/nmath-configuration">NMath Configuration</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Beginning with the <a href="/new-versions-of-nmath-libraries-released-4/">release of NMath 5.2 and NMath Stats 3.5</a>, <strong>NMath</strong> includes a new configuration system for controlling the loading of the <strong>NMath</strong> license key, kernel assembly, and native library. Based on customer feedback, we&#8217;ve designed this system to provide greater flexibility and security at deployment, and greater convenience in group development environments. We&#8217;ve also added optional logging to help debug configuration issues.</p>
<p><span style="color: red;">An NMath license file is no longer used.</span></p>
<h3>NMath License Key</h3>
<p><strong>NMath</strong> license information is stored in a license key which must be found at runtime. The license key governs the properties of your <strong>NMath</strong> installation. If no license key is found, a default evaluation license key is used which provides a free 30-day evaluation period for <strong>NMath</strong> on the current machine.</p>
<p>When you purchase one or more developer seats of <strong>NMath</strong>, you will be issued a license key describing the terms of your license. To enter your license key:</p>
<ol>
<li>Open <strong>CenterSpace Software | License NMath</strong> from your <strong>Start</strong> menu.</li>
<li>Enter your name, email, and license key, and click <strong>OK</strong>.</li>
</ol>
<p>The license key will be written to the registry. You can also specify your license key using various other mechanisms: by environment variable, by configuration app setting, and programmatically. These mechanisms may be preferable in group development environments, and at deployment. (See below.)</p>
<h3>NMath Configuration</h3>
<p>NMath configuration settings govern the loading of the <strong>NMath</strong> license key, kernel assembly, and native library. Property values can be set three ways:</p>
<ul>
<li>by environment variable</li>
<li>by configuration app setting</li>
<li>by programmatically setting properties on class <a href="https://www.centerspace.net/doc/NMathSuite/ref/html/T_CenterSpace_NMath_Core_NMathConfiguration.htm">NMathConfiguration</a></li>
</ul>
<p>Settings are applied in that order, and resetting a property takes precedent over any earlier values. For example, here an environment variable is used:</p>
<pre lang="csharp"> > set NMATH_NATIVE_LOCATION="C:\tmp"</pre>
<p>This code uses an app config file:</p>
<pre class="code">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="NMathNativeLocation" value="C:\tmp" /&gt;
  &lt;/appSettings&gt;
&lt;/configuration&gt;
</pre>
<p>And this code accomplishes the same thing programmatically:</p>
<pre lang="csharp" line="1">NMathConfiguration.NativeLocation = @"C:\tmp";</pre>
<p>Also, all paths can be specified relative to the executable.  So to place the natives in an existing directory named <i>resources</i> adjacent to the executable one would<br />
write:</p>
<pre lang="csharp" line="1">NMathConfiguration.NativeLocation = @"..\resources";</pre>
<p>The supported environment variables, configuration app setting keys, and property names are show below.</p>
<pre class="code">
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th>Environment Variable</th>
<th>Configuration Setting</th>
<th>Property</th>
</tr>
<tr>
<td><code>NMATH_LOG_LOCATION</code></td>
<td><code>NMathLogLocation</code></td>
<td><code>LogLocation</code></td>
</tr>
<tr>
<td><code>NMATH_LICENSE_KEY</code></td>
<td><code>NMathLicenseKey</code></td>
<td><code>LicenseKey</code></td>
</tr>
<tr>
<td><code>NMATH_NATIVE_LOCATION</code></td>
<td><code>NMathNativeLocation</code></td>
<td><code>NativeLocation</code></td>
</tr>
<tr>
<td><code>NMATH_USE_SEQUENTIAL_THREADING</code></td>
<td><code>NMathUseSequentialThreading</code></td>
<td><code>UseSequentialThreading</code></td>
</tr>
<tr>
<td><code>NMATH_USE_EXTERNAL_THREADING</code></td>
<td><code>NMathUseExternalThreading</code></td>
<td><code>UseExternalThreading</code></td>
</tr>
</tbody>
</table></pre>
<p>NOTE- Assembly loading and license checking is normally performed the first time you make an <strong>NMath</strong> call. If you wish to explicitly control when these operations occur&#8211;at application start-up, for example&#8211;use the static <a href="https://www.centerspace.net/doc/NMathSuite/ref/html/M_CenterSpace_NMath_Core_NMathConfiguration_Init.htm">NMathConfiguration.Init()</a> method.</p>
<p>For example, when using Mono on a Mac, to configured NMath with a sequentially threaded library set the environmental variable as follows.</p>
<pre lang="csharp"> > export NMATH_USE_SEQUENTIAL_THREADING="True" </pre>
<p><strong>Logging</strong></p>
<p>To debug configuration issues, specify a log file location. For example, setting the property programmatically to place the NMath log file in the same directory as the executable one would write:</p>
<pre lang="csharp" line="1">NMathConfiguration.LogLocation = @".";</pre>
<p>Or if you prefer to use a global temporary directory you could specify an absolute path.</p>
<pre lang="csharp" line="1">NMathConfiguration.LogLocation = @"C:\temp\logs";</pre>
<p>This creates a file named <code>NMathConfiguration.log</code> at the specified location containing log output. <i>The specified location must exist</i>. To turn off logging, set the log location to null.</p>
<p><strong>License Key</strong></p>
<p>You can specify your <strong>NMath</strong> license key using the <code>LicenseKey</code> property, or the equivalent environment variable or app config setting. If so, any keys in the registry are ignored.</p>
<p><strong>Native Location</strong></p>
<p>The NMath native assembly must be found at runtime. Failure to locate this file is one of the most common configuration issues, especially in deployment. The search order is determined by your <code>PATH</code> (on Windows systems). Some standard locations are automatically prepended to your (process-specific) <code>PATH</code>. You can also use the <code>NativeLocation</code> property, or the equivalent environment variable or app config setting, to prepend another location.</p>
<p><strong>Alternative Kernel and Native Assemblies</strong></p>
<p>The names of the <strong>NMath</strong> kernel and native assemblies are determined by your platform (x86 or x64), and the values of the <code>UseSequentialThreading</code> and <code>UseExternalThreading</code> properties, as shown below:</p>
<pre class="code">Standard
     Kernel
          NMathKernelx86.dll
          NMathKernelx64.dll
     Native
          nmath_native_x86.dll
          nmath_native_x64.dll

Sequentially-Threaded
     Kernel
          NMathKernelx86Sequential.dll
          NMathKernelx64Sequential.dll
     Native
          nmath_native_x86_seq.dll
          nmath_native_x64_seq.dll

Externally-Threaded
     Kernel
          NMathKernelx86External.dll
          NMathKernelx64External.dll
     Native
          nmath_native_x86_ext.dll
          nmath_native_x64_ext.dll</pre>
<p>Sequentially-threaded and externally-threaded kernel and native assemblies are available upon request from CenterSpace Software:</p>
<ul>
<li><strong>Sequentially-Threaded: </strong> MKL contains highly optimized, extensively threaded math routines. In rare cases, these can cause conflicts between the Intel OMP threading library (<code>libiomp.dll</code>) and the .NET threading model. If your .NET application is itself highly multi-threaded, you may wish to use the sequentially-threaded version of MKL.</li>
<li><strong>Externally-Threaded:</strong> <strong>NMath</strong> normally statically links in the Intel OMP threading library described above. Sometimes this can cause collisions with libraries from other vendors that also use OMP. The externally-threaded version of <code>NMath</code> dynamically-links in OMP.</li>
</ul>
<p>To trigger loading of these assemblies, use properties <code>UseSequentialThreading</code> and <code>UseExternalThreading</code> on class <a href="https://www.centerspace.net/doc/NMathSuite/ref/html/T_CenterSpace_NMath_Core_NMathConfiguration.htm">NMathConfiguration</a>, or the equivalent environment variables or app config settings. Both properties default to <code>false</code>.</p>
<p><code>UseSequentialThreading</code> and <code>UseExternalThreading</code> are mutually exclusive, and <code>UseSequentialThreading</code> takes precedence; <code>UseExternalThreading</code> only has an effect if <code>UseSequentialThreading</code> is <code>false</code>.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/nmath-configuration">NMath Configuration</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.centerspace.net/nmath-configuration/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3946</post-id>	</item>
	</channel>
</rss>
