<?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/"
	>

<channel>
	<title>The ILNumerics Blog &#187; ILNumerics</title>
	<atom:link href="https://ilnumerics.net/blog/tag/ilnumerics/feed/" rel="self" type="application/rss+xml" />
	<link>https://ilnumerics.net/blog</link>
	<description>The Productivity Machine  &#124;  A fresh attempt for scientific computing  &#124;  http://ilnumerics.net</description>
	<lastBuildDate>Thu, 05 Dec 2024 09:09:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>ILNumerics Accelerator – A better Approach to faster Array Codes, Part I</title>
		<link>https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/#comments</comments>
		<pubDate>Mon, 31 Oct 2022 21:10:26 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Numerical Algorithms]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[hpc]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=1069</guid>
		<description><![CDATA[<p>A Truth most Programmers won&#8217;t tell. TLDR: It was twenty years ago when computer manufacturers, while trying to boost CPU performance, were confronted with the hard wall imposed by physical limitations. It took a long time for everyone involved to realize that individual processors could no longer become significantly faster in the future. The previous &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics Accelerator – A better Approach to faster Array Codes, Part I</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/">ILNumerics Accelerator – A better Approach to faster Array Codes, Part I</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2>A Truth most Programmers won&#8217;t tell.</h2>
<p style="font-size: +1.1em; margin-bottom: 1em; text-align: justify;"><em>TLDR: It was twenty years ago when computer manufacturers, while trying to boost CPU performance, were confronted with the hard wall imposed by physical limitations. </em><em>It took a long time for everyone involved to realize that individual processors could no longer become significantly faster in the future. The previous approach made it too simple to deal with the constantly growing demands caused by ever larger data and ever more complex programs. </em><em>Haymo Kutschbach, founder and CEO of ILNumerics explains the challenges involved for automatic parallelization on today&#8217;s hardware and why traditional compilers will not satisfy the strong demand for a feasible solution. </em><em>A better, working approach is presented.</em></p>
<p align="right">Reading time: 10 minutes</p>
<p>For many decades, the rule applied: &#8220;Your program is too slow? Simply buy the latest hardware!&#8221; This was made possible by the availability of (general purpose) programming languages, as well as a stream of innovations in processor architectures and the associated compilers. They allowed the programs to be written largely independently of the execution hardware. The compiler adapted abstract codes to the low-level features of the processors. Everything fit together so conveniently!</p>
<p>And then nature threw a spanner in the works on this easy calculation. We&#8217;ve seen new computers continueing to obey Moore&#8217;s Law and become more powerful with each generation. But this new computing power is now distributed over many processors! A program can only use the new speed if it can use all processors at the same time. In addition, a significant part of the computing power of today&#8217;s computers is found in heterogeneous architectures such as GPUs and other accelerator hardware.</p>
<p>The consequences can be observed today in probably every development department: Programs are written abstractly. Efforts are made to create &#8216;clean code&#8217; that can be tested and maintained. Unfortunately, it is often executed too slowly, though! So you start to examine the codes for optimization potential. You identify individual bottlenecks, decide manually on a parallelization strategy, implement, test and measure again. Many programmers don&#8217;t see this as a problem – their expert knowledge guarantees them a good income for many years to come! Since there are no alternatives, the enormous delays in time to market are accepted. Just like the fact that the next generation of devices will again require a complete rewrite for large parts of the software.</p>
<p>Hardware today is far more diverse and heterogeneous than it was 20 years ago. But why is that actually a problem? Why are we still not able to <em>automatically </em>adapt and run our programs on such hardware again?</p>
<h2>If it&#8217;s too slow, blame the Compiler!</h2>
<p>For one, it&#8217;s because the compiler market has traditionally been dominated by processor manufacturers. Their compilers served to make their own hardware more accessible. Even though we&#8217;ve seen a recent trend towards vendor-independent compilers, they still continue the traditional approach: compiling (“lowering&#8221;) code of a general purpose programming language (like C or Fortran) to hardware instructions that can be executed on a specific (and previously selected) processor architecture. What we actually need, however, is a compiler that translates an abstract program for a &#8220;computer&#8221; &#8211; with all its diverse computing resources.</p>
<p>This task, however, is much more demanding! Why? Here we come to the second reason that has so far prevented a working solution: granularity. In order to be able to use parallel resources, the software must contain additional instructions that take care of the distribution of the individual program parts. This additional overhead makes a certain minimum program size (workload) mandatory. Parallelization only makes sense if the gain in speed through parallel execution exceeds the additional management effort!</p>
<p>Here, the term &#8220;granularity&#8221; refers to the number of individual low -level instructions that a piece of code requires to calculate its result. Apparently, the granularity increases with the size or complexity of a program part, because more low-level instructions are executed at the end. So, in order to make efficient use of parallelism, it is not enough to consider individual instructions of a program. Rather, a compiler must merge larger program parts (‘grains’) and distribute them to the available computing resources . One of the most important challenges of a parallelizing compiler is to find the optimal size of these &#8220;chunks&#8221; &#8211; and thus the optimal granularity.</p>
<p>This brings us to the third reason: complexity. In general, programs can become arbitrarily complex. Compilers have the task of translating programs into another, useful form. But how does one translate information that can be arbitrarily complex? Traditional compilers achieve this goal by limiting their consideration to individual instructions in the program. They know the (manageable) set of possible translations for each of these instructions. The finished program is then little more than the chain of such individual translations. Nevertheless, traditional compilers are already considered to be extremely complex software!</p>
<p>Unfortunately, this &#8220;complexity reduction&#8221; trick is in direct contradiction to the necessary, minimal granularity described above. A parallelizing compiler must face the challenge of finding an optimal translation even for program chunks that consist of multiple or many instructions. As always, low hanging fruits exist (see e.g.: tensorflow). However, an optimal solution must not restrict itself to individual, specific instructions just because their translation is particularly simple and therefore easy to implement!</p>
<p>And then there is a fourth aspect that also plays into the area of complexity. In addition to the optimal chunk size (granularity), it is also important to identify those grains of a program that can be executed independently of one another. The program analysis required must also take into account the best possible granularity. A compiler must therefore be able to <em>understand </em>large program sections, form chunks of an optimal grain size and execute them efficiently in parallel on heterogeneous hardware.</p>
<p>Ultimately, it is the complexity of this task that has so far prevented such a compiler from being born. In general, development departments still follow the manual approach described earlier. It requires expert knowledge and enormous effort to <em>manually </em>perform the necessary steps (granularity and independence analysis, parallel implementation) for <em>a special program </em>. But despite the enormous amount of time, despite the enormous maintenance issues associated, this approach allows to scratch the surface only! It can neither address nor solve the real problem.</p>
<h2><strong>Are we lost?</strong></h2>
<p>Not yet! Let’s wrap it up:</p>
<ul>
<li>Traditional compilers work at too low a level of granularity. They consider too few instructions to cover a workload, suitable for efficient parallelization.</li>
<li>Previous attempts to include large/all program parts in an analysis have only been successful in a few special cases. Global analysis for general programs is an unsolved problem and, in the opinion of the author, will remain so for a long time to come.</li>
</ul>
<p>But now we come to the topic of our headline! For a not too small class of programs ILNumerics succeeded in developing a compiler that fulfills all optimality requirements. It is the class of numeric, array-based programs. They are written by scientists, mathematicians, and engineers to encode the innovations of our modern times. They form the core of big data, machine learning and artificial intelligence, and all codes, making use of them. Numerical algorithms realize innovations – moreover: they <em>are </em>these innovations! They allow to formulate great complexity without great effort. They handle huge data and, therefore, require greatest speed.</p>
<p>A development department, faced with the challenge of accelerating its numerical array codes can only select and use the best possible language and libraries there are. Technical requirements often rule out prototyping languages, like numpy and Matlab. Individual parts may be outsourced to GPUs. Other parts are parallelized using multithreading. All of this slows down the industrial development process significantly. It is like writing GUI programs in assembler…</p>
<h2>A Better Approach to faster Array Codes</h2>
<p>ILNumerics proposes a new, faster approach to the execution of array codes. ILNumerics Accelerator, automatically finds parallel potential in array-based algorithms (as: numpy, Matlab, ILNumerics) and efficiently distributes its workload to heterogeneous computing resources &#8211; dynamically and at runtime, when all important information is available. It again scales your algorithm speed to any heterogeneous hardware without recompilation.</p>
<p>The <a title="ILNumerics Accelerator Compiler Documentation" href="/ilnumerics-accelerator-compiler.html">online documentation</a> describes technical details of the ILNumerics Accelerator Compiler. Make sure to <a href="https://eepurl.com/9loxX">register for our newsletter here</a> and don&#8217;t miss any news!</p>
<h3>Where can I get it ?</h3>
<p>ILNumerics Accelerator has entered the public beta phase. It will be released with ILNumerics Ultimate VS version 7. The pre-release is available on nuget. <a title="Getting Started Guide I - Sum Examples" href="/accelerate-sum-examples.html">Start here !</a> General documentation on the new Accelerator is found <a title="ILNumerics Accelerator Compiler Documentation" href="/ilnumerics-accelerator-compiler.html">here</a>. It will subsequently be completed within the next weeks. Read the getting <a title="Getting Started (I) with ILNumerics Accelerator" href="/accelerate-sum-examples.html">started guide(s)</a>, get your hands dirty and please, <a href="mailto:info@ilnumerics.net?subject=ILNumerics%20Accelerator%20Feedback">let us know what you think</a>!</p>
<h3>Patents</h3>
<p>ILNumerics software is protected by international <a href="https://ilnumerics.net/imprint.html">patents and patent applications</a>.</p>
<p>DE102011119404.9, WO2018197695A1, US11144348B2, CN110383247A, JP2020518881A, EP3443458A1, EP22156804, US20230259338A1, JP7495028B2, CN116610436A, EP23173406.2, PCT/EP2024/062463</p>
<p>. ILNumerics is a registered trademark of ILNumerics GmbH, Berlin, Germany.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/">ILNumerics Accelerator – A better Approach to faster Array Codes, Part I</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/ilnumerics-accelerator-a-better-approach-to-faster-array-codes-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Release Notes ILNumerics 4.13 (detailed)</title>
		<link>https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/</link>
		<comments>https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/#comments</comments>
		<pubDate>Wed, 03 May 2017 10:27:07 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[4.13]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[release notes]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=985</guid>
		<description><![CDATA[<p>See this changelog for a quick list of all changes in version 4.13. Here we dive into some details about specific topics. Visualization Engine Improvements The main goal of the GDI renderer is still to provide a fully compatible alternative to the OpenGL renderer. It automatically replaces the OpenGL default renderer if a problem / &#8230; <a href="https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/" class="more-link">Continue reading <span class="screen-reader-text">Release Notes ILNumerics 4.13 (detailed)</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/">Release Notes ILNumerics 4.13 (detailed)</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>See this <a title="Changelog &amp; Release Notes" href="https://ilnumerics.net/changelog.html">changelog</a> for a quick list of all changes in version 4.13. Here we dive into some details about specific topics.</p>
<h2>Visualization Engine Improvements</h2>
<p>The main goal of the <strong>GDI renderer</strong> is still to provide a fully compatible alternative to the OpenGL renderer. It automatically replaces the OpenGL default renderer if a problem / incompatible hardware etc. was detected at runtime. The focus lays on feature completeness and precision of the rendering result. The quality of the GDI renderer has been further improved to these regards in 4.13. Changes affect the following low level rendering features.</p>
<h3>Antialiasing</h3>
<p>Lines now recognize the <span class="il_inlinecode">ILLines.Antialiasing</span> property for thick lines (Width &gt; 2). The antialised rendering works in all situations: transparent lines, lines with stipple patterns, inside /outside of plot cubes and for logartithmic / linear axis scales. The quality of the antialiasing implementation is now on par with common OpenGL implementations.</p>
<p><em>The new default value for </em><span class="il_inlinecode">ILLines.Antialiasing</span><em> is now </em><strong><span class="il_inlinecode">true</span></strong><em>.</em> However, thin lines would not profit from antialiasing, hence thin lines will continue to ignore the value of the <span class="il_inlinecode">ILLines.Antialiasing</span> property.</p>
<p>Note, that some OpenGL drivers actually refuse to render certain combinations of line properties. We experienced such behavior for stippled, thick line <em>strips</em> having antialiased rendering configured. In such situations you should make sure to have the most recent OpenGL / graphics card drivers installed. Alternatively you may chose either stippled pattern &#8211; / <em>or </em>antialiased rendering by explicitly configuring your lines for either one setting. Or use the GDI renderer instead.</p>
<p>Following is a screenshot of some lines examples. The left side shows the OpenGL renderer result. On the right side the GDI version is shown. Use your browser to show the full, unscaled image (right click on the image):</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2017/04/LinesAntialiasingGDIversOpenGL413.png"><img class="aligncenter size-full wp-image-991" src="http://ilnumerics.net/blog/wp-content/uploads/2017/04/LinesAntialiasingGDIversOpenGL413.png" alt="LinesAntialiasingGDIversOpenGL413" width="880" height="454" /></a>&#8230; and with dotted lines:<a href="http://ilnumerics.net/blog/wp-content/uploads/2017/04/DottedLinesAntialiasingGDIversOpenGL413.png"><img class="aligncenter size-full wp-image-992" src="http://ilnumerics.net/blog/wp-content/uploads/2017/04/DottedLinesAntialiasingGDIversOpenGL413.png" alt="DottedLinesAntialiasingGDIversOpenGL413" width="882" height="453" /></a></p>
<p>&nbsp;</p>
<h3>Default Color for ILLines &amp; ILLineStrip</h3>
<p>Basic, low level line shapes are now created with a default color: black. Higher level objects (as ILLinePlot, ILSplinePlot, Markers, ILSurface etc.) should always provide a color for low-level objects or use vertex based coloring explicitly. If you are assembling your scene with the low level line objects make sure to check that you have done this. This is not a breaking change.</p>
<p>Note that the setting for the shapes <span class="il_inlinecode">Color</span> property overrides the vertex colors buffer (<span class="il_inlinecode">Color<strong>s</strong></span> property). In order to use vertex based coloring one must set the <span class="il_inlinecode">Color</span> property to null, enabling the colors information from the Colors buffer.</p>
<h3>Auto Color for Spline Plots</h3>
<p>ILSplinePlot (derived from ILLinePlot) now adopts the auto-coloring feature from the ILLinePlot class. When no line color was given at the time the plot was created the color gets assigned which comes next in the <span class="il_inlinecode">ILLinePlot.NextColor</span> color enumeration. Use the <span class="il_inlinecode">linecolor</span> constructor argument of <span class="il_inlinecode">ILSplinePlot</span> or the <span class="il_inlinecode">Line.Color</span> property in order to control the color of the spline line explicitly.</p>
<h3>Camera Default Depth: 100</h3>
<p>In earlier versions the default <span class="il_inlinecode">ILCamera.ZFar</span> value was 1000 which led to depth buffer precision issues in some situations. The new default value of 100 increases the depth buffer precision significantly. However, the new value (just like the old one) does not take into account the actual depth of your scene! If you encounter unwanted clipping in the far clippping area now, set the value for scene.Camera.ZFar explicitly. At best you know the depth of your scene and use this value. Or &#8211; more simple &#8211; use the old default of 1000:</p>
<pre class="brush: csharp; title: ; notranslate"> scene.Camera.ZFar = 1000; </pre>
<h2>Visual Studio 2017 Compatibility</h2>
<p>With the new version ILNumerics installs into the great, fresh new Visual Studio 2017 (released March 2017). &#8230; well, at least &#8216;kind of&#8217;&#8230;  What is true is that with 4.13 you can again use ILNumerics in all recent Visual Studio editions supporting extensions at all (which is all editions except Express Edition &#8211; I wonder if anyone is using this, still??), including Visual Studio 2017 Community Edition. This is great and all &#8230; <strong><em>but</em></strong>:</p>
<p>As you noticed there was a great deal of changes coming with VS2017. This includes the installer system which is &#8211; great attempt! &#8211; much more slim now by omitting unneeded stuff from the installation. But VS2017 also requires changes to the manifest files facilitating every Visual Studio Extensibility project. A new version has been introduced: version3. This is the first version which is not compatible with Visual Studio 2010 anymore. As a consequence, by supporting the new extension packaging system we would be required to drop support for Visual Studio 2010. This is not too dramatic since the 6 years VS2010 is out now feel kind of an eternity in our dev-world. However, we wanted to give the remaining VS2010 customers at least one version iteration of deprecating VS2010 in order to jump to a more recent version smoothly.</p>
<p>Additionally, the way the new VS installer works seems to reflect not the last word spoken on that topic (at least this is what we hope). The bottom line: we use an MSI installer, wrapped in an exe bootstrapper. The MSI installs all GAC binaries, registers the development dlls in Visual Studio, maintains the singleton installation directory and triggers the VSIX installer which installs the extension into all supported Visual Studio installations located on the system. This may sound complicated but worked quite reliably over the years.</p>
<p>Now, with the new Visual Studio package system things become odd. Out of subtle reasons, the MSI cannot (reliably) trigger the VSIX package automatically (and quietly). The <a href="http://stackoverflow.com/a/42278790/1215993">reason </a>becomes obvious when considering that the new extension potentially needs to trigger the installation of new components which it depends on. This install would not be possible while the hosting MSI is being installed itself still. So, as a consequence, currently, MSI installs of VSIX extensions into VS2017 are simply not working. When you start the ILNumerics installation from the delivered *.exe you will find the extension being installed into VS2010 and upwards &#8211; with the exception of Visual Studio 2017 <img src="https://ilnumerics.net/blog/wp-includes/images/smilies/icon_sad.gif" alt=":(" class="wp-smiley" /></p>
<p>Currently, some smart (WIX) people are attempting a solution to this. But we are not aware of a clean solution released already. Therefore, we will wait for it and/or eventually consider a new deployment scheme for our extensions.</p>
<p>However, luckily there is a simple workaround for now! After the ILNumerics installation was finished, you can easily install our extension into VS2017 manually. Just go to the installation folder (by default: C:\Program Files (x86)\ILNumerics\ILNumerics Ultimate VS\bin) and find the &#8216;ILNumerics.VSExtension.vsix&#8217; file. Double click on it to start the installation into the remaining Visual Studio instances manually. This should work without problems. Be sure to accept the warning dialog during the install. It originates from the fact that our extension must still support older Visual Studio extension techniques.</p>
<p>Keep in mind that this is a workaround, though! Once installed the extension will work as expected. But some things will not work consistentyl. Deinstallation, for example must be done manually from the &#8220;Extensions and Tools&#8221; dialog within Visual Studio 2017:</p>
<figure id="attachment_986" style="width: 954px;" class="wp-caption aligncenter"><a href="http://ilnumerics.net/blog/wp-content/uploads/2017/04/Deinstall-2017-Extensions-and-Updates.png"><img class="size-full wp-image-986" src="http://ilnumerics.net/blog/wp-content/uploads/2017/04/Deinstall-2017-Extensions-and-Updates.png" alt="A manually installed extension requires a manual uninstall." width="954" height="659" /></a><figcaption class="wp-caption-text">A manually installed extension requires a manual uninstall.</figcaption></figure>
<p>Also, in difference to the machine wide installation done by the (administrative) MSI install the manual VSIX installation changes the local user account only. You may have to repeat the VSIX install for other user accounts. Besides these lowered installation experience we know of no other incompatibilities in Visual Studio 2017. </p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/">Release Notes ILNumerics 4.13 (detailed)</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/release-notes-ilnumerics-4-13-detailed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ILNumerics &#8211; Unexpected behavior</title>
		<link>https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/</link>
		<comments>https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/#comments</comments>
		<pubDate>Tue, 24 Mar 2015 10:45:44 +0000</pubDate>
		<dc:creator><![CDATA[Balázs]]></dc:creator>
				<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[installing ilnumerics]]></category>
		<category><![CDATA[unexpected behavior]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=814</guid>
		<description><![CDATA[<p>At ILNumerics we get a lot of support requests every day. During the last couple of months some questions were related to installing ILNumerics. In some cases an unexpected error message appears. The easy solution is to manually uninstall our extension from all Visual Studio instances and then reinstall ILNumerics. This issue will be resolved &#8230; <a href="https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/" class="more-link">Continue reading <span class="screen-reader-text">Installing ILNumerics &#8211; Unexpected behavior</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/">Installing ILNumerics &#8211; Unexpected behavior</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">At ILNumerics we get a lot of support requests every day. During the last couple of months some questions were related to installing ILNumerics. In some cases an unexpected error message appears. The easy solution is to manually uninstall our extension from all Visual Studio instances and then reinstall ILNumerics. This issue will be resolved once we release our new installer.</p>
<p style="text-align: justify;"><span id="more-814"></span></p>
<h3>Problem during installing ILNumerics</h3>
<p style="text-align: justify;">Since the error is mostly related to the software upgrades, I was able to realize it on my computer. I have been playing with the installer and the build for quite some time now. I had an intermediate build being installed on my computer. I downloaded the official trial to use it for demonstration purpose. The following thing happened to me.</p>
<p style="text-align: justify;">Without even changing a string, next, next&#8230; install, the progress bar is running. Suddenly the following message pops up:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/03/11.png"><img class="alignnone wp-image-815 size-full" src="http://ilnumerics.net/blog/wp-content/uploads/2015/03/11.png" alt="Installing ILNumerics" width="509" height="399" /></a></p>
<h3>Reasons why it might happen</h3>
<p style="text-align: justify;">Visual Studio potentially gets confused when trying to install / uninstall multiple installer versions. Especially when such installers have the same major and minor version number. If one receives a software upgrade, it usually means the major and minor version is not changed. Therefore it is not a considered as major or minor upgrade.</p>
<h3 style="text-align: justify;">Locating the error</h3>
<p style="text-align: justify;">The easiest way to detect it, is after uninstalling ILNumerics. Check the VS Extensions (Tools -&gt; Extensions and Updates). If you still see &#8216;ILNumerics Ultimate VS&#8230;&#8217; installed that means you manually have to remove it. Unfortunately we have made some mistakes, and somehow it is not being removed correctly. This is something which happens occasionally.</p>
<h3 style="text-align: justify;">Resolution</h3>
<p style="text-align: justify;">A suggestion is to remove the VS extension manually. It is not a normal, nor an intended way of handling (un)installing ILNumerics. It is a workaround. I did the following: from VS 2010 to 2013, I manually uninstalled the VS Extensions (note: VS 2010 needs to be started with admin rights to be able to remove the extension).</p>
<p style="text-align: justify;">For me, after the removal of the extensions, the installer went smoothly <img src="https://ilnumerics.net/blog/wp-includes/images/smilies/icon_smile.gif" alt=":-)" class="wp-smiley" /> Hope this helps in some unexpected cases! We would like to make the installation process smoother, feedback and ideas are welcome.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/">Installing ILNumerics &#8211; Unexpected behavior</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/installing-ilnumerics-unexpected-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ILNumerics for Science &#8211; How did you do the Visualization?</title>
		<link>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/#comments</comments>
		<pubDate>Mon, 02 Feb 2015 16:35:03 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[plots]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=772</guid>
		<description><![CDATA[<p>In the third part of our series we focus on the visualization of scientific data. You learn how to easily display your data with ILNumerics and the ILPanels. Reactions I got a lot of emails after the last two posts (first, second) of people that liked the post and are interested in learning more. Most &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics for Science &#8211; How did you do the Visualization?</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/">ILNumerics for Science &#8211; How did you do the Visualization?</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In the third part of our series we focus on the visualization of scientific data. You learn how to easily display your data with ILNumerics and the ILPanels.</p>
<p><span id="more-772"></span></p>
<h3>Reactions</h3>
<p style="text-align: justify;">I got a lot of emails after the last two posts (<a title="ILNumerics for Scientists – An easy start" href="http://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">first</a>, <a title="ILNumerics for Scientists – Going 3D" href="http://ilnumerics.net/blog/ilnumerics-for-scientists/">second</a>) of people that liked the post and are interested in learning more. Most emails asked me to go into more details about how I did all that. Obviously, not too many people are interested in implementing the particle in a box, so the “what” is not as interesting as the “how”.</p>
<p style="text-align: justify;">In this post I want to focus on the visualization part of the previous two examples and how <a href="http://ilnumerics.net">ILNumerics </a>helped me. As many of our users are scientists and engineers they are typically experts in the computation part but appreciate a little help in the visualization. If you&#8217;re interested in the computation part, please be patient until the next post.</p>
<h3>The Form</h3>
<p style="text-align: justify;">I started by creating a new project in Visual Studio and chose Windows Forms Application. This gives me a vanilla Form1.cs. That’s the basis of all the visualization and helps me – being a scientist and not a coder – a lot, because I couldn’t do all that without the help of Visual Studio in the background.</p>
<p style="text-align: justify;">On the left-hand side in the Toolbox panel I picked TableLayoutPanel under Containers and dragged it into Form1.cs.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/firstimage.png"><img class="alignnone size-full wp-image-775" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/firstimage.png" alt="firstimage" width="421" height="379" /></a></p>
<p style="text-align: justify;">I adjusted the table to have three rows and a single column. In the Properties section under Dock I chose Fill so that everything scales when scaling the window later on.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/secondimage.png"><img class="alignnone size-full wp-image-777" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/secondimage.png" alt="secondimage" width="404" height="475" /></a></p>
<p style="text-align: justify;">A right click on Table -&gt; Edit Rows and Columns allows you to change the behavior of the three rows. I wanted the first and last row not to scale when changing the window. This is what I chose here.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/thirdimage.png"><img class="alignnone size-full wp-image-779" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/thirdimage.png" alt="thirdimage" width="730" height="481" /></a></p>
<p style="text-align: justify;">In the middle row we would like to see two ILNumerics panels. So I dragged another TableLayoutPanel in the middle row and chose two columns and one row. Choosing Dock = Fill for the new table and dragging two ILPanels into the respective columns (again with Dock = Fill) gives us the layout for our final Windows Form.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fourthimage.png"><img class="alignnone size-full wp-image-776" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fourthimage.png" alt="fourthimage" width="685" height="623" /></a></p>
<p style="text-align: justify;">In the header (the first row) I inserted a FlowLayoutPanel that makes sure that everything in there will be displayed rather neatly. Then I added the labels and the NumericUpDown according to my needs. Please make sure that you go through the properties of every item and choose the values according to your needs. In my case, for instance, the minimum value for the state is 1, since 0 would mean that there is no particle present. Here is the final picture of the form for the 1D particle in a box:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fifthimage.png"><img class="alignnone size-full wp-image-774" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/fifthimage.png" alt="fifthimage" width="935" height="660" /></a></p>
<h3>The Wiring</h3>
<p style="text-align: justify;">After having the layout ready the interactivity needs to be implemented. In this case there is only one point of user interaction. The user can choose which eigenvector to display. Double-clicking on the NumericUpDown control opens a new tab with a predefined class and a function handling the event when a user changes the value of the eigenvector.</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/02/sixthimage.png"><img class="alignnone size-full wp-image-778" src="http://ilnumerics.net/blog/wp-content/uploads/2015/02/sixthimage.png" alt="sixthimage" width="589" height="477" /></a></p>
<p style="text-align: justify;">All that’s needed now is to implement the function numericUpDown1_ValueChanged. This is particularly simple in our case. We just call the Update function (still to be implemented) with the new value for the eigenvector.</p>
<p style="text-align: justify;">In the case of the 2D particle in a box we have, in fact, four events that should trigger the Update function. This is easily done by introducing these lines of code in the public function Form1():</p>
<pre class="brush: csharp; title: ; notranslate">
     numericUpDown1.ValueChanged += Update;
     numericUpDown2.ValueChanged += Update;
     numericUpDown3.ValueChanged += Update;
     textBox1.TextChanged += Update;
</pre>
<h3 style="text-align: left;">The Implementation</h3>
<p style="text-align: justify;">Now, all we need to do is to implement the Update function and the initialization. The initialization makes sure that all the plotting objects are created when starting the program.</p>
<pre class="brush: csharp; title: ; notranslate">
     public Form1()
     {
        InitializeComponent();

        var EVID = 1;
        var MeshSize = 1000;

        InitializePanel1(EVID, MeshSize);
        InitializePanel2(EVID, MeshSize);

        label2.Text = string.Format(&quot;In appropriate units the energy is {0}&quot;, EVID * EVID);
     }

     private void InitializePanel1(int EVID, int MeshSize)
     {
        ILArray&lt;float&gt; XY = ILMath.tosingle(Computing_Module1.CalcWF(EVID, MeshSize));
        var color = Color.Black;
        ilPanel1.Scene =
          new ILScene {
            new ILPlotCube {
              new ILLinePlot (XY, lineColor : color)
            }
          };
     }
</pre>
<p style="text-align: justify;">The call to Computing_Module1.CalcWF will be explained in the next post. The piece of code above initializes the wave function plot and the density plot in their respective panels with the first eigenvector and a mesh size of 1000.</p>
<p>Finally, the Update function is implemented.</p>
<pre class="brush: csharp; title: ; notranslate">
     private void Update(int EVID, int MeshSize = 1000)
     {
       ILArray&lt;float&gt; XY = ILMath.tosingle(Computing_Module1.CalcWF(EVID, MeshSize));
       ilPanel1.Scene.First&lt;ILLinePlot&gt;().Update(XY);
       ilPanel1.Scene.First&lt;ILPlotCube&gt;().Reset();
       ilPanel1.Refresh();

       ILArray&lt;float&gt; XD = ILMath.tosingle(Computing_Module1.CalcDensity(EVID, MeshSize));
       ilPanel2.Scene.First&lt;ILLinePlot&gt;().Update(XD);
       ilPanel2.Scene.First&lt;ILPlotCube&gt;().Reset();
       ilPanel2.Refresh();
       label2.Text = string.Format(&quot;In appropriate units the energy is {0}&quot;, EVID * EVID);
     }
</pre>
<p style="text-align: justify;">Again, the CalcWF and CalcDensity calls will be explained in the next post. The Reset() function rescales the axes and the Refresh() function finally puts the new plot on screen.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/">ILNumerics for Science &#8211; How did you do the Visualization?</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/ilnumerics-for-scientists-how-did-you-do-the-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plotting Fun with ILNumerics and IronPython</title>
		<link>https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/</link>
		<comments>https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/#comments</comments>
		<pubDate>Mon, 15 Sep 2014 10:31:45 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[IronPython]]></category>
		<category><![CDATA[numerical algorithms]]></category>
		<category><![CDATA[plots]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=599</guid>
		<description><![CDATA[<p>Since the early days of IronPython, I keep shifting one bullet point down on my ToDo list: * Evaluate options to use ILNumerics from IronPython Several years ago there has been some attempts from ILNumerics users who successfully utilized ILNumerics from within IronPython. But despite our fascination for these attempts, we were not able to &#8230; <a href="https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/" class="more-link">Continue reading <span class="screen-reader-text">Plotting Fun with ILNumerics and IronPython</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/">Plotting Fun with ILNumerics and IronPython</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Since the early days of IronPython, I keep shifting one bullet point down on my ToDo list:</p>
<p>* Evaluate options to use <a href="http://ilnumerics.net">ILNumerics</a> from IronPython</p>
<p>Several years ago there has been some attempts from<a href="https://code.google.com/p/ironlab/"> ILNumerics users</a> who successfully utilized ILNumerics from within IronPython. But despite our fascination for these attempts, we were not able to catch up and deeply evaluate all options for joining both projects. Years went by and Microsoft has dropped support for IronPython in the meantime. Nevertheless, a considerably large community seems to be active on IronPython. Finally, today is the day I am going to give this a first quick shot.</p>
<p><span id="more-599"></span></p>
<p><em>Disclaimer: I am not a python developer. My experience with IronPython range from 0 &#8230; zero (unfortunatley, since the project deserves <strong>much</strong> more attention). For CPython it is only slighly better. So please bare with me if I went into some stupid direction or if I have completely missed better options in this article! Corrections and suggestions are always warmly welcome.</em></p>
<h1>Setup</h1>
<p>I downloaded and installed <a href="https://ironpython.codeplex.com/releases/view/90087">IronPython from CodePlex</a>. Also, in Visual Studio 2013 there exists a link in the NEW PROJECT dialog advertising the download of IronPython Tools for Visual Studio. I used that to setup Visual Studio for IronPython projects. All setup went smooth and easy. Nice!</p>
<h1>Creating Plots with IronPython</h1>
<p>The challenge I was interested in the most was how it is possible to utilize the great plotting capabilities of <a href="http://ilnumerics.net/Visualization-API.html">ILNumerics Visualization Engine</a> from IronPython projects. Since matplotlib seems not to be available for IronPython and other alternatives are also pretty rare (if any at all?) having our visualization engine available to IronPython projects seem to be a big improvement.</p>
<p>The good news first: it works and it does so very easily. The following plot is done purely in IronPython:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2014/09/Plotting-Fun-with-ILNumerics-in-IronPython1.png"><img class="aligncenter size-full wp-image-613" src="http://ilnumerics.net/blog/wp-content/uploads/2014/09/Plotting-Fun-with-ILNumerics-in-IronPython1.png" alt="" width="661" height="470" /></a>I started with a fresh new Iron Python Windows Forms Application from the &#8216;New Project&#8217; dialog in Visual Studio 2013.</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2014/09/IronPython_ILPanel_NewProjectVS2013.png"><img src="http://ilnumerics.net/blog/wp-content/uploads/2014/09/IronPython_ILPanel_NewProjectVS2013.png" alt="" width="662" height="384" /></a></p>
<p>This gives a template python file &#8216;IronPython_ILPanel.py&#8217; with the following content:</p>
<pre class="brush: python; title: ; notranslate">
import clr
clr.AddReference('System.Drawing')
clr.AddReference('System.Windows.Forms')

from System.Drawing import *
from System.Windows.Forms import *

class MyForm(Form):
    def __init__(self):
        # Create child controls and initialize form
        pass

Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)

form = MyForm()
Application.Run(form)</pre>
<p>If you are familiar with the common setup of Windows Forms you may notice some similarities with the stub provided by a new C# Windows Forms Application project. What is otherwise spread over multiple files, now is done all within the global scope of the one and only *.py file: the form class is defined, the static Application class is configured and the event loop is started with an instance of the formerly defined MyForm class. Straight. This corresponds to the common setup for Windows.Forms from any language, where no Designer support exists for. The same could be done in PowerShell, to name just another example.</p>
<p>In order to integrate support for ILNumerics Visualization Engine, I did the following simple steps:</p>
<p>1) If not done so far, go and install <a href="http://ilnumerics.net">ILNumerics Ultimate VS</a>. We offer <a href="http://ilnumerics.net/download.html">30 days trials</a> which contain all features without limitation.<br />
2) Once installed, ILNumerics is available in the &#8220;Add Reference&#8221; dialog (right click on References in the Solution Explorer). ILNumerics.dll is added from the .NET tab:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2014/09/IronPython_ILPanel_Select_Component.png"><img class="aligncenter size-full wp-image-606" src="http://ilnumerics.net/blog/wp-content/uploads/2014/09/IronPython_ILPanel_Select_Component.png" alt="" width="592" height="476" /></a>3) Make the ILNumerics namespaces available: I added the following lines to the import section at the very top of IronPython_ILPanel.py:</p>
<pre class="brush: python; title: ; notranslate">
import clr
clr.AddReference('System.Drawing')
clr.AddReference('System.Windows.Forms')
clr.AddReference('ILNumerics')

from System.Drawing import *
from System.Windows.Forms import *
from ILNumerics import *
from ILNumerics.Drawing import *
from ILNumerics.Drawing.Plotting import *
</pre>
<p>4) Now we are ready to add a plot to the form. In C# we would simply use the <code>ilPanel1_Load</code> event handler which is easily added by help of the forms designer. Since we do not have designer support here, we simply add the setup to the constructor of MyForm:</p>
<pre class="brush: python; title: ; notranslate">
class MyForm(Form):
   def __init__(self):
     # Create child controls and initialize form
     ilpanel = ILPanel()
     ilpanel.Dock = DockStyle.Fill
     self.Controls.Add(ilpanel)
     # show some demo: first create a plotcube
     pc = ILPlotCube(&quot;pc&quot;, 0)
     # it will hold a surface with some sinc data in 3D
     # You can use ILRetArray returned from any ILNumerics Computing
     # Module as input argument here directly. Type conversions seem to happen automatically.
     sf = ILSurface(ILSpecialData.sincf(40,50))
     pc.Add(sf)
     # add the plotcube to the scene
     ilpanel.Scene.Add(pc)
     self.Text = &quot;Plotting Fun with ILNumerics in IronPython&quot;
</pre>
<p>This is all straightforward. The configuration of the panel and the plots is exactly as it would have been done in C# or Visual Basic. However, we have to add the ILPanel to the self.Controls collection manually. The result, of course is exactly the same: a nice interactive form, utilizing OpenGL, with all manipulation options like rotation, pan and zoom. The full spectrum of the Visualization Engine should work out of the box. This includes several, flexible <a href="http://ilnumerics.net/plotting-api.html">3D and 2D plotting types</a> as well as the whole <a href="http://ilnumerics.net/scene-graph-shapes-and-buffers.html">scene graph functionality</a> for building your own interactive visualizations.</p>
<p>This is all what needs to be done in order to create nice professional plots directly within IronPython. Press F5 and start your application, rotate the plot with the mouse and learn about all the <a href="http://ilnumerics.net/visualization-engine.html">options you have</a>.</p>
<p><iframe width="474" height="267" src="https://www.youtube.com/embed/G9WWy_u-vvI?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<h1>Computing Fun with IronPython and ILNumerics</h1>
<p>ILNumerics not only rely on its own flexible n-dimensional array implementation, it also introduces its very own memory management &#8211; for <a href="http://ilnumerics.net/performance.html">very good reasons</a>. In order for the memory managements to work, <a href="http://ilnumerics.net/GeneralRules.html">individual array types</a> (ILArray, ILInArray, ILOutArray and ILRetArray) are used in ILNumerics algorithms. This makes great use of the strict type safety of .NET languages as C# and Visual Basic and of automatic conversions between those types.</p>
<p>Python on the other side is a dynamic language. It does not know the concept of types to the same extend. A straightforward application of the ILNumerics array types is not possible. IronPython, however offers workarounds (clr.Convert) but they are not able to provide the same syntactical convenience as a pure C# algorithm.</p>
<p>My recommendation for the utilization of ILNumerics Computing Engine therefore is as follows:</p>
<p>ILNumerics Computing Engine can be used without restriction. The utilization of existing algorithms is straightforward. Algorithms leveraging the ILNumerics Function Rules can be called directly without any type conversions. The creation of local variables on the other side requires type conversions from ILRetArray to ILArray. This can be done by help of IronPythons clr.Convert function.</p>
<p>The type conversion issue possibly makes it less feasible to write own ILNumerics Computing Engine algorithms in IronPython. But most the time, one would rather want to use existing python algorithms anyway. In order to actually create a new algorithm, one should rather utilize C# and compile the algorithm into its own .NET module which can than easily be imported into your python project and get interfaced from your python code.</p>
<h1>Summary</h1>
<p>This blog demonstrated how easy it is to utilize ILNumerics from IronPython. Especially the Visualization Engine is incorporated without any problems and offers the full set of visualization and plotting options out of the box. Algorithms created with ILNumerics Computation Engine can directly be interfaced and used &#8211; in parallel with numpy algorithms, if the need arise. The syntax of the Computing Engine however is not as expressive and more clumsy due to the absense of implicit type conversions and operator overloads. Complex algorithms one therefore would rather implement in C# or VisualBasic than in IronPython. For small algorithms, like data preprocessing and the like, ILNumerics Computing Engine serves as a faster alternative to numpy arrays.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/">Plotting Fun with ILNumerics and IronPython</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/plotting-fun-with-ilnumerics-and-ironpython/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ILNumerics Language Features: Limitations for C#, Part II: Compound operators and ILArray</title>
		<link>https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/#comments</comments>
		<pubDate>Sun, 29 Dec 2013 14:17:30 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[compound operator]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Memory Management]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=517</guid>
		<description><![CDATA[<p>A while ago I blogged about why the CSharp var keyword cannot be used with local ILNumerics arrays (ILArray&#60;T&#62;, ILCell, ILLogical). This post is about the other one of the two main limitations on C# language features in ILNumerics: the use of compound operators in conjunction with ILArray&#60;T&#62;. In the online documentation we state the &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics Language Features: Limitations for C#, Part II: Compound operators and ILArray</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/">ILNumerics Language Features: Limitations for C#, Part II: Compound operators and ILArray</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>A while ago I blogged about <a title="Why the ‘var’ keyword is not allowed in ILNumerics" href="http://ilnumerics.net/blog/why-the-var-keyword-is-not-allowed-in-ilnumerics/">why the CSharp <strong>var</strong> keyword cannot be used with local ILNumerics arrays</a> (ILArray&lt;T&gt;, ILCell, ILLogical). This post is about the other one of the two main limitations on C# language features in ILNumerics: the use of compound operators in conjunction with ILArray&lt;T&gt;. In the <a href="http://ilnumerics.net/GeneralRules.html">online documentation</a> we state the rule as follows:</p>
<blockquote><p>The following features of the C# language are not compatible with the memory management of ILNumerics and its use is <em>not supported:</em></p>
<ul>
<li>The C# var keyword in conjunction with any ILNumerics array types, and</li>
<li>Any compound operator, like +=, -=, /=, *= a.s.o. Exactly spoken, these operators are not allowed in conjunction with the indexer on arrays. So A += 1; is allowed. A[0] += 1; is not!</li>
</ul>
</blockquote>
<p>Let&#8217;s take a closer look at the second rule. Most developers think of compound operators as being just syntactic sugar for some common expressions:</p>
<pre class="brush: csharp; title: ; notranslate">int i = 1;
i += 2;</pre>
<p>&#8230; would simply expand to:</p>
<pre class="brush: csharp; title: ; notranslate">int i = 1;
i  = i + 2; </pre>
<p>For such simple types like an integer variable the actual effect will be indistinguishable from that expectation. However, compound operators introduce a lot more than that. Back in his times at Microsoft, <a href="http://blogs.msdn.com/b/ericlippert/archive/2011/03/29/compound-assignment-part-one.aspx">Eric Lippert blogged about those subtleties</a>. The article is worth reading for a deep understanding of all side effects. In the following, we will focus on the single fact, which becomes important in conjunction with ILNumerics arrays: when used with a compound operator, <code>i</code> in the example above is only evaluated once! In difference to that, in <code>i = i + 2</code>, <code>i</code> is evaluated twice.</p>
<p>Evaluating an <code>int</code> does not cause any side effects. However, if used on more complex types, the evaluation may does cause side effects. An expression like the following:</p>
<pre class="brush: csharp; title: ; notranslate">ILArray&lt;double&gt; A = 1;
A += 2;</pre>
<p>&#8230; evaluates to something similiar to this:</p>
<pre class="brush: csharp; title: ; notranslate">ILArray&lt;double&gt; A = 1;
A = (ILArray&lt;double&gt;)(A + 2); </pre>
<p>There is nothing wrong with that! A += 2 will work as expected. Problems arise, if we include indexers on A:</p>
<pre class="brush: csharp; title: ; notranslate">ILArray&lt;double&gt; A = ILMath.rand(1,10);
A[0] += 2;
// this transforms to something similar to the following: 
var receiver = A; 
var index = (ILRetArray&lt;double&gt;)0;
receiver[index] = receiver[index] + 2; </pre>
<p>In order to understand what exactly is going on here, we need to take a look at the definition of indexers on <code>ILArray</code>: </p>
<pre class="brush: csharp; title: ; notranslate">public ILRetArray&lt;ElementType&gt; this[params ILBaseArray[] range] { ... </pre>
<p>The indexer expects a variable length array of <code>ILBaseArray</code>. This gives most flexibility for defining subarrays in ILNumerics. Indexers allow not only scalars of builtin system types as in our example, but arbitrary ILArray and string definitions. In the expression <code>A[0]</code>, <code>0</code> is implicitly converted to a scalar ILNumerics array before the indexer is invoked. Thus, a temporary array is created as argument. Keep in mind, due to the memory management of ILNumerics, all such implicitly created temporary arrays are immediately disposed off after the first use.</p>
<p>Since both, the indexing expression <code>0</code> and the object where the indexer is defined for (i.e.: A) are evaluated only once, we run into a problem: <code>index</code> is needed twice. At first, it is used to acquire the subarray at <code>receiver[index]</code>. The indexer <code>get { ...} </code> function is used for that. Once it returns, all input arguments are disposed &#8211; an important foundation of ILNumerics memory efficency! Therefore, if we invoke the index setter function with the same <code>index</code> variable, it will find the array being disposed already &#8211; and throws an exception.</p>
<p>It would certainly be possible to circumvent that behavior by converting scalar system types to <code>ILArray</code> instead of <code>ILRetArray</code>:</p>
<pre class="brush: csharp; title: ; notranslate">ILArray A = ...;
A[(ILArray)0] += 2;</pre>
<p>However, the much less expressive syntax aside, this would not solve our problem in general either. The reason lies in the flexibility required for the indexer arguments. The user must manually ensure, all arguments in the indexer argument list are of some non-volatile array type. Casting to <code>ILArray&lt;T&gt;</code> might be an option in some situations. However, in general, compound operators require much more attention due to the efficient memory management in ILNumerics. We considered the risk of failing to provide only non-volatile arguments too high. So we decided not to support compound operators at all. </p>
<p>See: <a href="http://ilnumerics.net/$GeneralRules.html">General Rules</a> for ILNumerics, <a href="http://ilnumerics.net/$FunctionRules.html">Function Rules</a>, <a href="http://ilnumerics.net/Subarray0.html">Subarrays</a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/">ILNumerics Language Features: Limitations for C#, Part II: Compound operators and ILArray</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/ilnumerics-language-features-limitations-for-c-part-ii-compound-operators-and-ilarray/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Troubleshooting: Adding ILNumerics 3D Controls to the VS Toolbox</title>
		<link>https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/</link>
		<comments>https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/#comments</comments>
		<pubDate>Thu, 05 Dec 2013 18:30:27 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Math Library]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=482</guid>
		<description><![CDATA[<p>Adding ILNumerics visualizations to Visual Studio based projects has become a quite convenient task: It&#8217;s easy to use the ILNumerics math library for own projects in .NET. However, from time to time users have problems adding the ILNumerics controls to their Visual Studio Toolbox window. Update: Since ILNumerics Ultimate VS version 4 this issue has &#8230; <a href="https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/" class="more-link">Continue reading <span class="screen-reader-text">Troubleshooting: Adding ILNumerics 3D Controls to the VS Toolbox</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/">Troubleshooting: Adding ILNumerics 3D Controls to the VS Toolbox</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><strong>Adding ILNumerics visualizations to Visual Studio based projects has become a quite convenient task: It&#8217;s easy to use the ILNumerics math library for own projects in .NET. However, from time to time users have problems adding the ILNumerics controls to their Visual Studio Toolbox window.</strong></p>
<p><em>Update: Since ILNumerics Ultimate VS version 4 this issue has been solved once for all. Simply install the MSI installer and find the ILNumerics ILPanel in the toolbox for all applicable situations.</em></p>
<p>That&#8217;s what a <a href="http://stackoverflow.com/questions/18239021/ilnumerics-how-to-get-ilnumerics-controls-in-windows-form-tools" target="_blank">post on Stack Overflow</a> from earlier this year was about: A developer who wanted to use our<a href="http://ilnumerics.net"> C# math library</a> for 3d visualizations and simulations wasn&#8217;t able to access the ILNumerics controls. &#8220;How can I locate it?&#8221;, he was wondering. &#8220;Do I have to make some changes to my VS?&#8221;</p>
<h2>Adding ILNumerics Controls to the Visual Studio Toolbox manually</h2>
<p>If the ILNumerics Ultimate VS math library is installed on a system, normally the ILNumerics controls are automatically listed in the Visual Studio toolbox on all supported versions of Visual Studio. However, if that&#8217;s not the case there&#8217;s a way to a add them manually: After clicking right onto the toolbox, you can select &#8220;Choose Item&#8221;. The dialog allows you to select the assambly to load the controls from – that&#8217;s it! You will find the ILNumerics.dll in the installation folder on your system. By default this directory is located at:  &#8220;C:\Program Files (x86)\ILNumerics\ILNumerics Ultimate VS\bin\ILNumerics.dll&#8221;.</p>
<p>However, if that doesn&#8217;t work straightaway, it often helps to clear the toolbox from any copies of custom controls before – simply right-click it and choose &#8220;Reset Toolbox&#8221;.</p>
<h2>Need help? ILNumerics Documentation and Support</h2>
<p><strong>You want to know more about our math library and its installation? Check out our <a href="http://ilnumerics.net/docs.html" target="_blank">documentation</a> and the <a title="Getting Started" href="http://ilnumerics.net/Getting-Started-with-ILNumerics.html" target="_blank">Quick Start Guide</a>! If you have any technical questions, have a look at our <a href="http://ilnumerics.net/support.html" target="_blank">Support Section</a>.</strong></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/">Troubleshooting: Adding ILNumerics 3D Controls to the VS Toolbox</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/troubleshooting-adding-controls-to-the-vs-toolbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</title>
		<link>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/</link>
		<comments>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/#comments</comments>
		<pubDate>Thu, 05 Sep 2013 08:28:09 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[Interesting/ useless]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[IPython Notebook]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[scientific plots]]></category>
		<category><![CDATA[Shiny]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=430</guid>
		<description><![CDATA[<p>It seems that we&#8217;re facing a trend at the moment: scientific computing, math and visualization software for web browsers. With our interactive web examples we have taken a step into that direction, too: Visitors of our website can change the C# code of our plotting and visualization demos in order to create a new SVG, &#8230; <a href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/" class="more-link">Continue reading <span class="screen-reader-text">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>It seems that we&#8217;re facing a trend at the moment: scientific computing, math and visualization software for web browsers. With our <a href="http://ilnumerics.net/ilnumerics-interactive-web-component.html">interactive web examples</a> we have taken a step into that direction, too: Visitors of our website can change the C# code of our plotting and visualization demos in order to create a new SVG, PNG, JPG or EXE output. This allows people to easily try out the ILNumerics syntax and our powerful <a href="http://ilnumerics.net/Visualization-API.html">2d and 3d visualization features for .NET</a>. In addition to that, <a href="http://ilnumerics.net/introducing-ilview.html">ILView</a> allows a convenient way to interactively explore scenes that are created with ILNumerics.</p>
<p>There are two other web applications that cause a lot of excitement in the scientific community at the moment: The IPython Notebook and Shiny, a tool for creating web applications in R. Let&#8217;s have a closer look…</p>
<h2>IPython Notebook: &#8220;Interactive Computational Environment&#8221;</h2>
<p>The IPython Notebook adresses the huge amount of Python users in the scientific community. It basically offers a new way for writing papers: It&#8217;s a web based editor for code execution, math, text and visualization. Because the IPython Notebook combines all parts you normally need to write a scientific paper, you won&#8217;t have to import / export different elements from several domain specific software applications: &#8220;Everything related to my analysis is located in one unified place&#8221;, explains Philip J. Guo in his blog (<a href="http://www.pgbovine.net/ipython-notebook-first-impressions.htm" target="_blank">http://www.pgbovine.net/ipython-notebook-first-impressions.htm</a>). Once you have finished your paper, you can share your IPython Notebook as HTML and PDF with your colleagues, your professor etc.</p>
<h2>Shiny: &#8220;Easy web applications in R&#8221;</h2>
<p>Shiny stands for a different approach: It allows you to implement own analysis into web applications. While IPython obviously adresses Python users, Shiny is based on R, a still very popular programming language among statisticians. What makes Shiny interesting are its interactivity features: Most demos on the Shiny website offer the opportunity to choose input parameters from text fields or drop-downs to dynamically change the output visualization. The code seems to be quite similar to R, so users who are familiar with that language will easily be able to create interactive data visualization applications for their websites using Shiny.</p>
<h2>Disadvantages: Performance does matter</h2>
<p>Both approaches make web browsers accesable for specific needs of scientific visualization: The IPython Notebook offers a convenient tool to share the results of analytics related research; Shiny allows R developers to publish particular interactive plots on the web.</p>
<p>However, both projects are limited – namely because of technological issues. The level of performance that can be realized with both platforms is restricted: You&#8217;ll face that at the latest when you start creating complex 3d scenes with either Python or R. This holds true for the platforms&#8217; web applications, too…</p>
<h2>Outlook: Scientific Computing online</h2>
<p>For certain purposes web based scientific computing software offers new convenient solutions. But if you want to realize complex interactive 3d visualizations, you still won&#8217;t use any of them but an application on your local machine instead.</p>
<p>Our interactive web examples point the direction we want to go. In order to make scientific computing more powerful, we&#8217;re working on the next step of our approach: a full WebGL support for ILNumerics. Stay tuned…</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/">Scientific Computing Online: IPython Notebook, Shiny (R) and ILNumerics</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/scientific-computing-online-ipython-notebook-shiny-r-and-ilnumerics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Performance Fast Fourier Transformation in .NET</title>
		<link>https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/</link>
		<comments>https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/#comments</comments>
		<pubDate>Sat, 24 Aug 2013 12:24:55 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Numerical Algorithms]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[Fast Fourier Transform]]></category>
		<category><![CDATA[FFT]]></category>
		<category><![CDATA[High Performance]]></category>
		<category><![CDATA[Math Library]]></category>
		<category><![CDATA[Numerical Algorithm]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=453</guid>
		<description><![CDATA[<p>„I started using ILNumerics for the FFT routines. The quality and speed are excellent in a .NET environment.“ The Fourier Transform (named after French mathematician and physicist Joseph Fourier) allows scientists to transform signals between time domain and frequency domain. This way, an arbitrary periodic function can be expressed as a sum of cosine terms. Think &#8230; <a href="https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/" class="more-link">Continue reading <span class="screen-reader-text">High Performance Fast Fourier Transformation in .NET</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/">High Performance Fast Fourier Transformation in .NET</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p style="text-align: right;"><em>„I started using ILNumerics for the FFT routines. </em><em>The quality and speed are excellent in a .NET environment.“</em></p>
<p style="text-align: left;" align="right">The Fourier Transform (named after French mathematician and physicist Joseph Fourier) allows scientists to transform signals between time domain and frequency domain. This way, an arbitrary periodic function can be expressed as a sum of cosine terms. Think of the equalizer of your mp3-player: It expresses your music’s signal in terms of the frequencies it is composed of.</p>
<p>The <a href="http://ilnumerics.net/FFTMain.html">Fast Fourier Transform (FFT)</a> is an algorithm for the rapid computation of discrete Fourier Transforms’ values. Being one of the most popular numerical algorithms, it is used in physics, engineering, math and many other domains.</p>
<p>In terms of software engineering, the Fast Fourier Transform is a very demanding algorithm: In the .NET-framework, a naive approach would cause very low execution speeds. That’s the reason why many .NET-developers have to implement native C-libraries when it comes to <a href="http://ilnumerics.net/FFTMain.html">FFTs</a>.</p>
<p>ILNumerics uses Intel&#8217;s® MKL for Fast Fourier Transforms: That&#8217;s why our users don’t have to implement native library&#8217;s themselves for high performance FFTs. No matter if they have a scientific or an industrial background, many developers rely on ILNumerics because of its implementation of the Fast Fourier Transform. It’s the fastest you can get today – even for big amounts of data.</p>
<p>ILNumerics provides interfaces to forward and backward Fourier Transformations, for real and complex floating point data, in single and double precision, in one, two or n dimensions. In addition to the MKL&#8217;s FFTs, prepared interfaces for FFTW and for AMDs ACML exist.</p>
<p>Learn more about the ILNumerics library and its implementation of <a href="http://ilnumerics.net/FFTMain.html">Fast Fourier Transformation in C#/.NET</a> in the online documentation!</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/">High Performance Fast Fourier Transformation in .NET</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/high-performance-fast-fourier-transformation-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Putting on a Good Show with HDF5, ILNumerics, and PowerShell</title>
		<link>https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/</link>
		<comments>https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/#comments</comments>
		<pubDate>Fri, 14 Sep 2012 18:09:33 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[Usage]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[HDF]]></category>
		<category><![CDATA[HDF5]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Memory Management]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[PSH5X]]></category>
		<category><![CDATA[TypeAccelerator]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=219</guid>
		<description><![CDATA[<p>It is certainly nice to have the option to do all kinds of numeric stuff right in your .NET application layer &#8211; without the need for interfacing any unmanaged module. But for some tasks, this still seems overkill. Lets say, you went to that conference and want to give your new friends some insight into &#8230; <a href="https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/" class="more-link">Continue reading <span class="screen-reader-text">Putting on a Good Show with HDF5, ILNumerics, and PowerShell</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/">Putting on a Good Show with HDF5, ILNumerics, and PowerShell</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>It is certainly nice to have the option to do all kinds of numeric stuff right in your .NET application layer &#8211; without the need for interfacing any unmanaged module. But for some tasks, this still seems overkill.</p>
<p>Lets say, you went to that conference and want to give your new friends some insight into your brand new simulation results. The PC in the internet cafe enables you to fetch the data from your NAT storage at home. But will you be able to do <em>anything </em> with it on that <a href="http://1.bp.blogspot.com/-jURyoGkPgs0/T5Ey3J7WECI/AAAAAAAACEU/7JQGp17DyIs/s1600/PC+Express+iCafe+Solutions+Center+-+PC+Express+Shaw+Blvd.JPG" target="_blank">plain Windows PC</a>?</p>
<p>Or you want to localize a certain test data set but cannot remember its rather cryptic name. Or you might want to manage the latest measurement results from todays <a href="http://eosweb.larc.nasa.gov/">atmospheric observation satellite scans</a>. The data are huge but often require some sort of preprocessing. There should be some easy way to filter them by the meta data within the files, right?</p>
<p>Other than getting the data from some application layer, we now want to interface plain old file objects. Of course, you store your data in HDF5 format, right? You do so, because HDF5 is portable, very efficient, flexible and you are in <a href="http://www.hdfgroup.org/HDF5/users5.html" target="_blank">good company</a>.</p>
<p>Let&#8217;s see. We have a fresh Windows PC and we know every Windows installation nowadays comes with <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">Powershell</a>. Powershell itself is based on the .NET framework and hence efficiently handles any .NET assembly. It should be easy to use ILNumerics with Powershell! All we still need is some way to access the HDF5 files. ILNumerics, natively is able to read and write Matlab mat files up to version 6. It currently lags on native HDF5 support.</p>
<p>Luckily, the <a title="http://www.hdfgroup.org" href="http://www.hdfgroup.org">HDF Group</a> provides a large collection of high quality <a title="HDF5 Projects" href="http://www.hdfgroup.org/projects/" target="_blank">tools for HDF support</a>. Among them you&#8217;ll find a .NET wrapper and &#8230; a brand new Powershell module: <a title="PSH5X - A WINDOWS POWERSHELL MODULE FOR HDF5" href="http://www.hdfgroup.org/projects/PSH5X/">PSH5X</a>! Together with Gerd Heber, the leading inventor of PSH5X, we did a feasibility study with the goal to investigate the options of utilizing HDF5 and ILNumerics together in Powershell. It can be <a href="http://ilnumerics.net/blog/wp-content/uploads/2012/09/HDF5-ILNumerics-PowerShell.a4.pdf" target="_blank">downloaded here</a>. We were quite impressed by the options this brings.</p>
<p>This blog post will describe the necessary steps to setup Powershell for ILNumerics and HDF5.</p>
<h1>Getting Started</h1>
<p>Basically, the installation process for any Powershell module consists of</p>
<ol>
<li>Getting the module files and its dependencies from somewhere,</li>
<li>Deploying the module files into a special folder on your machine, and</li>
<li>Importing the module in your session.</li>
</ol>
<p>The <a title="http://www.hdfgroup.org/projects/PSH5X/" href="http://www.hdfgroup.org/projects/PSH5X/">PSH5X</a> homepage gives all information on how to get ready using the HDF5 Powershell module. Just download the package and follow the three steps on the page. At the end, HDF5 signals you a successful installation by displaying its version numbers.</p>
<p>Since ILNumerics depends on several other modules, we provide a small bootstrapper script. Just open up your favorite Powershell IDE (PowerShell_ISE.exe comes with any recent Windows) and copy/paste the following line:</p>
<pre class="brush: csharp; title: ; notranslate">(new-object Net.WebClient).DownloadString('http://ilnumerics.net/media/InstallILNumericsPSM.ps1') | iex</pre>
<p>If you are curious, what this does &#8211; just ommit the trailing <code>| iex</code> and the script is not executed but displayed for your inspection.</p>
<p>The installer will ask for the installation folder (global under System32/ or local in your user profile), fetches the latest ILNumerics package for the current platform from the official <a title="nuget" href="http://nuget.org">nuget</a> repository and install it into the selected module folder. In addition it loads the <a title="Powershell Type Accelerators" href="http://pstx.codeplex.com/">TypeAccelerator Powershell module</a> and installs it into the same module directory. Note, the accelerators have been slightly modified in order to make them work with <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34595">Powershell 3</a> and hence are fetched from our ILNumerics server. However, credits fully belong to <a href="http://poshoholic.com/">poshoholic</a> for his great work.</p>
<p>Note, the installation has to be done only once. Afterwards, on the next Powershell session, simply re-import needed modules by typing &#8211; lets say:</p>
<pre class="brush: csharp; title: ; notranslate">PS&gt; Import-Module ILNumerics </pre>
<h1>Go!</h1>
<p>If everything was setup correctly, we can now use the full spectrum of the involved modules:</p>
<pre class="brush: csharp; title: ; notranslate">PS&gt; [ilmath]::rand(4,5).ToString()
&lt;Double&gt; [5,4]
   0,72918    0,87547    0,43167    0,94942
   0,58024    0,75562    0,96125    0,83148
   0,22454    0,20583    0,82285    0,83144
   0,13300    0,40047    0,58829    0,87012
   0,50751    0,05496    0,02814    0,48764 </pre>
<p>Nice. But what about the MKL? Are the correct binaries really installed as well?</p>
<pre class="brush: csharp; title: ; notranslate">PS&gt; [ilf64] $A = [ilmath]::rand(1000,1000)
PS&gt; Measure-Command { [ilf64]$C = [ilmath]::rank($A) }
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 920
Ticks             : 9202311
TotalDays         : 1,06508229166667E-05
TotalHours        : 0,00025561975
TotalMinutes      : 0,015337185
TotalSeconds      : 0,9202311
TotalMilliseconds : 920,2311

PS&gt; $C.ToString()
1000</pre>
<p>We have almost all options from C#:</p>
<pre class="brush: csharp; title: ; notranslate">PS&gt; [ilf64] $part = $A['10:15;993:end']
PS&gt; $part.ToString()
&lt;Double&gt; [11,7]
   0,08522    0,87217    0,59997    0,57363    0,22956    0,02006    0,02359
   0,33479    0,49003    0,65269    0,97772    0,28322    0,69505    0,70372
   0,30072    0,68705    0,47112    0,68627    0,65030    0,40454    0,63026
   0,15639    0,30391    0,22992    0,69310    0,65716    0,51797    0,68110
   0,72854    0,60188    0,50740    0,74499    0,13459    0,88481    0,12445
   0,80525    0,60180    0,69256    0,74825    0,64388    0,16792    0,45266 </pre>
<p>Lets sort the first row of $part, keeping track of original positions:</p>
<pre class="brush: csharp; title: ; notranslate">PS&gt; [ilf64] $indices = 0.0
PS&gt; [ilf64] $sorted = [ilmath]::sort($part['0,1;:'],$indices,0,$false)
PS&gt; $sorted.ToString()
&lt;Double&gt; [2,7]
   0,02006    0,02359    0,08522    0,22956    0,57363    0,59997    0,87217
   0,28322    0,33479    0,49003    0,65269    0,69505    0,70372    0,97772
PS&gt; $indices.ToString()
&lt;Double&gt; [2,7]
         5          6          0          4          3          2          1
         4          0          1          2          5          6          3 </pre>
<p>This is all interactive. Of course, we can write complete functions and even complex algorithms that way.<br />
One of the best things: Even in Powershell ILNumerics saves your memory and meets all expectations regarding execution speed. Powershell allows you to consequently use ILNumerics&#8217; <a title="ILNumerics General Rules " href="http://ilnumerics.net/Support_Documentation$GeneralRules.html">typing and scoping rules</a>.</p>
<p>In our feasibility study with Gerd Heber, we show how easy it gets to access an HDF5 file, to convert its data to ILNumerics arrays (implicitly), filter and manipulate a little and even create a full interactive 3D surface graph from it. We demonstrate how to use the type accelerators and to mimic the <code>using</code> statement for artificial scoping. <a href="http://ilnumerics.net/blog/wp-content/uploads/2012/09/HDF5-ILNumerics-PowerShell.a4.pdf" target="_blank">Take a look</a> and let us know, what you think!</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/">Putting on a Good Show with HDF5, ILNumerics, and PowerShell</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/putting-on-a-good-show-with-hdf5-ilnumerics-and-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
