<?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; computing</title>
	<atom:link href="https://ilnumerics.net/blog/tag/computing/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>N-dim Array Broadcasting Efficiency in ILNumerics 4.10</title>
		<link>https://ilnumerics.net/blog/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/</link>
		<comments>https://ilnumerics.net/blog/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/#comments</comments>
		<pubDate>Sun, 01 May 2016 09:47:13 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Usage]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Broadcasting]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[vectorization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=915</guid>
		<description><![CDATA[<p>Next to other great improvements in version 4.10 of ILNumerics Ultimate VS, it is especially one new feature which requires some attention: general broadcasting for n-dimensional ILArrays. Broadcasting as a concept today is found in many popular mathematical prototyping systems. The most direct correspondence probably exists in the numpy package. Matlab and Octave offer similar &#8230; <a href="https://ilnumerics.net/blog/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/" class="more-link">Continue reading <span class="screen-reader-text">N-dim Array Broadcasting Efficiency in ILNumerics 4.10</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/">N-dim Array Broadcasting Efficiency in ILNumerics 4.10</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Next to other great improvements in version 4.10 of ILNumerics Ultimate VS, it is especially one new feature which requires some attention: general broadcasting for n-dimensional ILArrays.</p>
<p>Broadcasting as a concept today is found in many popular mathematical prototyping systems. The most direct correspondence probably exists in the <a href="http://docs.scipy.org/doc/numpy-1.10.1/user/basics.broadcasting.html">numpy </a>package. Matlab and Octave offer similar functionality by means of the <a href="http://de.mathworks.com/help/matlab/ref/bsxfun.html">bsxfun function</a>.</p>
<p>The term &#8216;broadcasting&#8217; refers to a binary operator which is able to apply an elementwise operation to the elements of two n-dimensional arrays. The &#8216;operation&#8217; is often as simple as a straight addition (ILMath.add, ILMath.divide, a.s.o.). However, what is special about broadcasting is that it allows the operation even for the case where both arrays involved do not have the same number of elements.</p>
<h2>Broadcasting in ILNumerics prior Version 4.10</h2>
<p>In ILNumerics, broadcasting is available for long already. But prior version 4.10 it was limited to scalars operating on n-dim arrays and vectors operating on matrices. Therefore, we had used the term &#8216;vector expansion&#8217; instead of broadcasting. Obviously, broadcasting can be seen as a generalization of vector expansion.</p>
<p>Let&#8217;s visualize the concept by considering the following matrix A:</p>
<pre class="brush: csharp; title: ; notranslate">
A

1  5   9  13  17
2  6  10  14  18
3  7  11  15  19
4  8  12  16  20
</pre>
<p>Matrix A might represent 5 data points of a 4 dimensional dataset as columns. One common requirement is to apply a certain operation to all datapoints in a similar way. In order to, let&#8217;s say, scale/weight the components of each dimension by a certain factor, one would multiply each datapoint with a vector of length 4.</p>
<pre class="brush: csharp; title: ; notranslate">

ILArray&lt;double&gt; V = new[] { 0.5, 3.0, 0.5, 1.0 };

0.5
3.0
0.5
1.0
</pre>
<p>The traditional way of implementing this operation would be to expand the scaling vector by replicating it from a single column to a matrix matching the size of A.</p>
<pre class="brush: csharp; title: ; notranslate">
VExp = repmat(V, 1, 5); 

0.5  0.5  0.5  0.5  0.5
3.0  3.0  3.0  3.0  3.0
0.5  0.5  0.5  0.5  0.5
1.0  1.0  1.0  1.0  1.0
</pre>
<p>Afterwards, the result can be operated with A elementwise in the common way.</p>
<pre class="brush: csharp; title: ; notranslate">
ILArray&lt;double&gt; Result = VExp * A;

0.5   2.5   4.5   6.5   8.5
6.0  18.0  30.0  42.0  54.0
1.5   3.5   5.5   7.5   9.5
4.0   8.0  12.0  16.0  20.0
</pre>
<p>The problem with the above approach is that the vector data need to be expanded first. There is little advantage in doing so: a lot of new memory is being used up in order to store completely redundant data. We all know that memory is the biggest bottleneck today. We should prevent from lots of memory allocations whenever possible. This is where vector expansion comes into play. In ILNumerics, for long, one can prevent from the additional replication step and operate the vector on the matrix directly. Internally, the operation is implemented in a very efficient way, without replicating any data, without allocating new memory.</p>
<pre class="brush: csharp; title: ; notranslate">
ILArray&lt;double&gt; Result = V * A;

0.5   2.5   4.5   6.5   8.5
6.0  18.0  30.0  42.0  54.0
1.5   3.5   5.5   7.5   9.5
4.0   8.0  12.0  16.0  20.0</pre>
<h2>Generalizing for n-Dimensions</h2>
<p>Representing data as matrices is very popular in scientific computing. However, if the data are stored into arrays of other shapes, having more than two dimensions, one had to fall back to repmatting in order for the binary operation to succeed. This nuissance has been removed in version 4.10.</p>
<p>Now it is possible to apply broadcasting to two arrays of <em>any matching</em> shape &#8211; without the need for using repmat. In order for two arrays to &#8216;<em>match</em>&#8216; in the binary operation, the following rules must be fullfilled:</p>
<ol>
<li>All corresponding dimensions of both arrays must match.</li>
<li>In order for two  corresponding dimensions to match,
<ul>
<li>both dimensions must be of the same length, or</li>
<li>one of the dimensions must be of length 1.</li>
</ul>
</li>
</ol>
<p>An example of two matching arrays would be a vector running along the 3rd dimension and a 3 dimensional array:</p>
<p><a href="http://ilnumerics.net/blog/wp-content/uploads/2016/12/3D-Cubes-4-Broadcasting2.png"><img class="aligncenter size-full wp-image-929" src="http://ilnumerics.net/blog/wp-content/uploads/2016/12/3D-Cubes-4-Broadcasting2.png" alt="3D Cubes 4 Broadcasting2" width="655" height="485" /></a>In the above image the vector (green) has the same length as the corresponding dimension of the 3D array (gray). The size of the vector is [1 x 1 x 6]. The size of the 3D array is [4 x 5 x 6]. Hence, any dimension of both, the vector and the 3D array &#8216;match&#8217; in terms of broadcasting. A broadcasting operation for both, the vector and the array would give the same result as if the vector would be replicated along the 1st and the 2nd dimensions. The first element will serve all elements in the first 4 x 5 slice in the 1-2 plane. This slice is marked red in the next image: <a href="http://ilnumerics.net/blog/wp-content/uploads/2016/12/3D-Cubes-4-Broadcasting_slice1.png"><img class="aligncenter size-full wp-image-931" src="http://ilnumerics.net/blog/wp-content/uploads/2016/12/3D-Cubes-4-Broadcasting_slice1.png" alt="3D Cubes 4 Broadcasting_slice" width="812" height="633" /></a>Note that all red elements here derive from the same value &#8211; from the first element of the green vector.  The same is true for all other vector elements: they fill corresponding slices on the 3D array along the 3rd dimension.</p>
<p>Slowly, a huge performance advantage of broadcasting becomes clear: the amount of memory saved explodes when more, longer dimensions are involved.</p>
<h2> Special Case: Broadcasting on Vectors</h2>
<p>In the most general case and if broadcasting is blindly applied, the following special case potentially causes issues. Consider two vectors, one row vector and one column vector being provided as input parameters to a binary operation. In ILNumerics, every array carries at least two dimensions. A column vector of length 4 is considered an array of size [4 x 1]. A row vector of length 5 is considered an array of size [1 x 5]. In fact, <em>any</em> two vectors match according to the general  broadcasting rules.</p>
<p>As a consequence operating a row vector [1 x 5] with a column vector [4 x 1] results in a matrix [4 x 5]. The row vector is getting &#8216;replicated&#8217; (again, without really executing the replication) four times along the 1st dimension, and the column vector 5 times along the rows.</p>
<pre class="brush: csharp; title: ; notranslate">
array(new[] {1.0,2.0,3.0,4.0,5.0}, 1, 5) +array(new[] {1.0,2.0,3.0,4.0}, 4, 1)

&lt;Double&gt; [4,5]
[0]:          2          3          4          5          6
[1]:          3          4          5          6          7
[2]:          4          5          6          7          8
[3]:          5          6          7          8          9
</pre>
<p>Note, in order for the above code example to work, one needs to apply a certain switch:</p>
<pre class="brush: csharp; title: ; notranslate">
Settings.BroadcastCompatibilityMode = false;
</pre>
<p>The reason is that in the traditional version of ILNumerics (just like in Matlab and Octave) the above code would simply not execute but throw an exception instead. Originally, binary operations on vectors would ignore the fact that vectors are matrices and only take the length of the vectors into account, operating on the corresponding elements if the length of both vectors do match. Now, in order to keep compatibility for existing applications, we kept the former behavior.</p>
<p>The new switch &#8216;Settings.BroadcastCompatibilityMode&#8217; by default is set to &#8216;true&#8217;. This will cause the Computing Engine to throw an exception when two vectors of inequal length are provided to binary operators. Applying vectors of the same length (regardless of their orientation) will result in a vector of the same length.</p>
<p>If the &#8216;Settings.BroadcastCompatibilityMode&#8217; switch is set to &#8216;false&#8217; then general broadcasting is applied in all cases according to the above rules &#8211; even on vectors. For the earlier vector example this leads to the resulting matrix as shown above: operating a row on a column vector expands both vectors and gives a matrix of corresponding size.</p>
<p>Further reading: <a href="http://ilnumerics.net/Opoverload.html">binary operators, online documentation</a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/">N-dim Array Broadcasting Efficiency in ILNumerics 4.10</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/n-dim-array-broadcasting-efficiency-in-ilnumerics-4-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ILNumerics for Scientists &#8211; Going 3D</title>
		<link>https://ilnumerics.net/blog/ilnumerics-for-scientists/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-for-scientists/#comments</comments>
		<pubDate>Tue, 20 Jan 2015 15:38:39 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Interesting/ useless]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[3d visualization]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Quantum Mechanics]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=761</guid>
		<description><![CDATA[<p>Recap Last time I started with one of the easiest problems in quantum mechanics: the particle in a box. This time I’ll add 1 dimension and we’ll see a particle in a 2D box. To visualize its wave function and density we need 3D surface plots. 2D Box This time we have a particle that &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-for-scientists/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics for Scientists &#8211; Going 3D</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists/">ILNumerics for Scientists &#8211; Going 3D</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h3>Recap</h3>
<p style="text-align: justify;"><a title="ILNumerics for Scientists – An easy start" href="http://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">Last time </a>I started with one of the easiest problems in quantum mechanics: the particle in a box. This time I’ll add 1 dimension and we’ll see a particle in a 2D box. To visualize its wave function and density we need 3D surface plots.</p>
<h3>2D Box</h3>
<p style="text-align: justify;">This time we have a particle that is confined in a 2D box. The potential within the box is zero and outside the box infinity. Again the solution is well-known and can be found on <a href="https://en.wikipedia.org/wiki/Particle_in_a_box">Wikipedia</a>. This time the state of the wave function is determined by two numbers. These are typically called quantum numbers and refer to the X and the Y direction, respectively.</p>
<p style="text-align: justify;">The absolute size of the box doesn’t really matter and we didn’t worry about it in the 1D case. However, the relative size of the length and the width make a difference. The solution to our problem reads</p>
<p style="text-align: center;">$\Psi_{n,k}(x,y) = \sqrt{\frac{4}{L_x L_y}} \cdot \sin(n \cdot \pi \cdot x / L_x) \cdot \sin(k \cdot \pi \cdot y / L_y)$</p>
<h3>The Math</h3>
<p style="text-align: justify;">Very similar to the 1D case I quickly coded the wave function and the density for further plotting. I had to make sure that the arrays are fit for 3D plotting, so the code looks a little bit different compared to last post’s</p>
<pre class="brush: csharp; title: ; notranslate">
     public static ILArray&lt;double&gt; CalcWF(int EVXID, int EVYID, double LX, double LY, int MeshSize)
     {
        ILArray&lt;double&gt; X = linspace&lt;double&gt;(0, LX, MeshSize);
        ILArray&lt;double&gt; Y = linspace&lt;double&gt;(0, LY, MeshSize);

        ILArray&lt;double&gt; Y2d = 1;
        ILArray&lt;double&gt; X2d = meshgrid(X, Y, Y2d);

        ILArray&lt;double&gt; Z = sqrt(4.0 / LX / LY) * sin(EVXID * pi * X2d / LX) * sin(EVYID * pi * Y2d / LY);

        return Z.Concat(X2d,2).Concat(Y2d,2);
     }
</pre>
<p>Again, this took me like 10 minutes and I was done.</p>
<h3>The Visualization</h3>
<p>This time the user can choose the quantum numbers for X and Y direction, the ratio between the length and the width of the box and also the number of mesh points along each axis for plotting. This makes the visualization panel a little bit more involved. Nevertheless, it’s still rather simple and easy to use. This time it took me only 45 minutes – I guess I learned a lot from last time.</p>
<h3>The result</h3>
<p>Here is the result of my little program. You can click and play with it. If you’re interested, you can download the <a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.zip">Particle2DBox</a> source code. Have fun!</p>
<p style="text-align: justify;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.jpg"><img class="aligncenter wp-image-767 size-full" src="http://ilnumerics.net/blog/wp-content/uploads/2015/01/Particle2DBox.jpg" alt="Particle2DBox" width="928" height="640" /></a>This is a screenshot of the application. I chose the second quantum number along the x axis and the fourth quantum number along the y axis. The box is twice as long in y direction as it is in x direction. The mesh size is 100 in each direction. On the left hand side you see the wave function and on the right hand side the probability density.</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists/">ILNumerics for Scientists &#8211; Going 3D</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/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ILNumerics for Scientists &#8211; An easy start</title>
		<link>https://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/</link>
		<comments>https://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/#comments</comments>
		<pubDate>Wed, 07 Jan 2015 16:05:43 +0000</pubDate>
		<dc:creator><![CDATA[Jonas]]></dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[Scientific Computing]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Getting Started]]></category>
		<category><![CDATA[Quantum Mechanics]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=714</guid>
		<description><![CDATA[<p>Motivation I’ve been working as a scientist at universities for 10 years before deciding to go into industry. The one thing I hated most was coding. At the end of the day coding for scientists is like running for a football player. Obviously, you need it but it’s not what you’re here for. I really &#8230; <a href="https://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/" class="more-link">Continue reading <span class="screen-reader-text">ILNumerics for Scientists &#8211; An easy start</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">ILNumerics for Scientists &#8211; An easy start</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h3>Motivation</h3>
<p style="text-align: justify;">I’ve been working as a scientist at universities for 10 years before deciding to go into industry. The one thing I hated most was coding. At the end of the day coding for scientists is like running for a football player. Obviously, you need it but it’s not what you’re here for.</p>
<p style="text-align: justify;">I really dreaded the coding and the debugging. So much precious time for something that was so clear on paper and I just wanted the solution of my equations to see whether my idea made sense or not. More often than not scientists find that their idea was not so great and now they had spent so much time coding just to find out that the idea didn’t work.<span id="more-714"></span></p>
<p style="text-align: justify;">To make things worse even in the case that the idea was good the code was typically in a scripted language like Python or Matlab and now needed to be rewritten in Fortran or C++. Isn’t there a better way of doing things? Isn’t there a way where the idea creation and the formulation is the bottle neck and not the coding? I could’ve spent so much more time on valuable thinking instead of senseless coding.</p>
<p style="text-align: justify;">Now, obviously, I’m going to tell you how ILNumerics does exactly that. And, obviously, I do that because I work for them. Still, this is my experience and this is how easy it was. And at the end of the day, you’re not going to buy our product because of this blog post, rather because you downloaded our <a href="http://ilnumerics.net/download.html">free trial</a> and convinced yourself.</p>
<h3 style="text-align: justify;">The Problem</h3>
<p style="text-align: justify;">Let’s start with one of the simplest problems in quantum mechanics – the particle in a box. This is a quantum mechanical particle in a potential-free box with an infinite potential outside the box. In other words, the particle is forced to stay within the box. Anybody unfamiliar with this problem can read the <a href="https://en.wikipedia.org/wiki/Particle_in_a_box">Wikipedia article </a>about this.</p>
<p style="text-align: justify;">The solution to this problem is well-known and can be found analytically. As always in quantum mechanics, the solution is quantized with infinitely many solutions – also known as states. Each of the solutions consists of a wave function associated with a corresponding energy.</p>
<p style="text-align: center;">$\Psi_n(x) = \sqrt{\frac{2}{L}} \sin(n \cdot \pi \cdot  x)$</p>
<p style="text-align: justify;">In the equation above $n$ designates the $n^{th}$ state and $L$ is the length of the box, set to 1 in our case.</p>
<h3 style="text-align: justify;">The Goal</h3>
<p style="text-align: justify;">My goal is to display the wave function and the probability density of a user-chosen state. I choose a simple problem and a simple goal because I’m just getting started. Obviously, this is not one of the problems I faced as a scientist in my earlier life, but it is a nice example.</p>
<h3 style="text-align: justify;">The Solution</h3>
<p style="text-align: justify;">Let’s start with the mathematical part. First I implemented the wave function for a given state. As the wave function is supposed to be plotted it is discretized over a mesh. Here is my body of my function:</p>
<pre class="brush: csharp; title: ; notranslate">
     ILArray&lt;double&gt; X = linspace&lt;double&gt;(0,1,MeshSize);
     ILArray&lt;double&gt; Y = sqrt(2.0)*sin(EVID*pi*X);
     return vertcat(X,Y);
</pre>
<p style="text-align: justify;">The parameter EVID is the eigenvector ID, i.e. an integer greater than 0 to identify which state should be calculated. I coded the same for the density, which basically means squaring the wave function stored in vector Y.</p>
<p>Done in less than 10 minutes!!!</p>
<h3>The Graphs</h3>
<p style="text-align: justify;">The rest is all about the presentation to the user. So I created a simple Windows Form with a numeric up/down counter (to allow the user to choose the state) and two panels for simple line plots. I just needed to wire all the components to make sure that the plots were rescaled and updated after the user changes the state. This took me some more time, because it was the first time for me. Still it took me only 60 minutes and done.</p>
<h3>The Result</h3>
<p style="text-align: justify;">Here you can find the result of my simple little program. You can download the <a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/ParticleBoxBest.zip" target="_blank">source code</a> and play with it. Have fun!</p>
<p style="text-align: center;"><a href="http://ilnumerics.net/blog/wp-content/uploads/2015/01/ParticleInABox.png"><img class="alignnone wp-image-715 size-full" src="http://ilnumerics.net/blog/wp-content/uploads/2015/01/ParticleInABox.png" alt="ParticleInABox" width="900" height="603" /></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/ilnumerics-for-scientists-an-easy-start/">ILNumerics for Scientists &#8211; An easy start</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-an-easy-start/feed/</wfw:commentRss>
		<slash:comments>1</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>Intel vectorizes for OpenCL with LLVM</title>
		<link>https://ilnumerics.net/blog/intels-opencl-compiler-vectorizes/</link>
		<comments>https://ilnumerics.net/blog/intels-opencl-compiler-vectorizes/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 16:58:31 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[Comparison]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[llvm]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[vectorization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=111</guid>
		<description><![CDATA[<p>OpenCL support in ILNumerics is one of the most challenging items on our (internal) wishlist, still. The current OpenCL SDK from Intel does auto vectorization[1][2] and is based on the LLVM compiler suite. A pretty interesting approach. I must take a look at it&#8230;</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/intels-opencl-compiler-vectorizes/">Intel vectorizes for OpenCL with LLVM</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>OpenCL support in ILNumerics is one of the most challenging items on our (internal) wishlist, still. The current <a href="http://software.intel.com/en-us/articles/vcsource-tools-opencl-sdk/" target="_blank">OpenCL SDK from Intel</a> does auto vectorization[<a href="http://blog.llvm.org/2011/12/llvm-31-vector-changes.html#more" target="_blank">1</a>][<a href="http://software.intel.com/en-us/articles/auto-vectorization-of-opencl-code-with-the-intel-opencl-sdk/" target="_blank">2</a>] and is based on the LLVM compiler suite. A pretty interesting approach. I must take a look at it&#8230;</p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/intels-opencl-compiler-vectorizes/">Intel vectorizes for OpenCL with LLVM</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/intels-opencl-compiler-vectorizes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft.Numerics, Cloud Numerics for Azure &#8211; a short Review</title>
		<link>https://ilnumerics.net/blog/microsoft-numerics-cloud-numerics-for-azure-a-short-review/</link>
		<comments>https://ilnumerics.net/blog/microsoft-numerics-cloud-numerics-for-azure-a-short-review/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 19:37:38 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Cloud Numerics]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[distributed]]></category>
		<category><![CDATA[ILNumerics]]></category>
		<category><![CDATA[implementation]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=100</guid>
		<description><![CDATA[<p>Today I found some time to take a look at the Cloud Numerics project at Microsoft. I started with the overview/ introduction post by Ronnie Hoogerwerf found at the Cloud Numerics blog at msdn. The project aims at computations on very large distributed data sets and is intended for Azure. Interesting news for me: the &#8230; <a href="https://ilnumerics.net/blog/microsoft-numerics-cloud-numerics-for-azure-a-short-review/" class="more-link">Continue reading <span class="screen-reader-text">Microsoft.Numerics, Cloud Numerics for Azure &#8211; a short Review</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/microsoft-numerics-cloud-numerics-for-azure-a-short-review/">Microsoft.Numerics, Cloud Numerics for Azure &#8211; a short Review</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Today I found some time to take a look at the <a href="http://social.technet.microsoft.com/wiki/contents/articles/5993.microsoft-codename-cloud-numerics.aspx">Cloud Numerics</a> project at Microsoft. I started with the <a href="http://blogs.msdn.com/b/cloudnumerics/archive/2012/01/11/the-cloud-numerics-programming-and-runtime-execution-model.aspx">overview/ introduction post</a> by <a href="http://social.msdn.microsoft.com/profile/ronnie%20hoogerwerf%20-%20msft/">Ronnie Hoogerwerf</a> found at the Cloud Numerics blog at msdn.</p>
<p>The project aims at computations on very large distributed data sets and is intended for <a href="http://www.windowsazure.com">Azure</a>. Interesting news for me: the library shows quite some similarities to ILNumerics. It provides array classes on top of native wrappers, utilizing MPI, PBLAS and ScaLAPACK. A runtime is deployed with the project binaries: Microsoft.Numerics, which provides all the classes described here. </p>
<h2>&#8216;Local&#8217; Arrays in “Cloud Numerics”</h2>
<p>The similarity is most obvious when comparing the array implementations: Both, ILNumerics and Cloud Numerics utilize multidimensional generic arrays. Cloud Numerics arrays all derive from Microsoft.Numerics.IArray&lt;T&gt; &#8211; not to be confused with ILNumerics local arrays ILArray&lt;T&gt; ;)! </p>
<p>Important properties of arrays in ILNumerics are provided by the concrete array implementation of an array A (A.Size.NumberOfElements, A.Size.NumberOfDimensions, A.Reshape, A.T for the Transpose a.s.o.). On the Cloud Numerics side, those properties are provided by the interface IArray&lt;T&gt;: A.NumberOfDimensions, A.NumberOfElements, A.Reshape(), A.Transpose() a.s.o). </p>
<p>A similar analogy is found in the element types supported by ILArray&lt;T&gt; and Microsoft.Numerics.IArray&lt;T&gt;. Both allow the regular System numeric value types, as System.Int32, System.Double and System.Single. Interestingly &#8211; both do <strong>not </strong>rely on System.Numerics.Complex as the main double precisioin complex data element type but rather implement their own for both: single precision and double precision. </p>
<p>Both array types support vector expansion, at least Cloud Numerics promises to do so in the next release. For now, only scalar binary operations are allowed for arrays. For an explanation of the feature it refers to NumPy rather than ILNumerics though. </p>
<h2>Arrays Storage in “Cloud Numerics”</h2>
<p>The similarities end when it comes to internal array storage. Both do store multidimensional arrays as one dimensional arrays internally. But Cloud Numerics stores its elements in <strong>native </strong>one dimensional arrays. They argue with the 2GB limit introduced for .NET objects and further elaborate: </p>
<blockquote><p>Additionally, the underlying native array types in the “Cloud Numerics” runtime are sufficiently flexible that they can be easily wrapped in environments other than .NET (say Python or R) with very little additional effort.</p></blockquote>
<p>It is hard follow that view. Out of my experience, .NET arrays are perfectly suitable for such interaction with native libraries, since at the end it is just a pointer to memory passed to thoses libs. Regarding the limit of 2GB:  I assume a &#8216;problem size&#8217; of more than 2GB would hardly be handled on one node. Especially a framework for distributed memory I would have expected to switch over to shared memory about at this limit at least?</p>
<p>In the consequence, interaction between Cloud Numerics and .NET arrays becomes somehow clumsy and &#8211; if it comes to really large datasets &#8211; with an expected  performance hit (disclaimer: untested, of course). </p>
<p>Differences keep coming: indexing features are somehow basic in Cloud Numerics. By now, they support scalar element specification only and restrict the number of dimension specifier to be the same as the number of dimensions in the array. Therefore, subarrays seems to be impossible to work with. I will have an eye on it, if the project will support array features like A[full, end / 2 + 1] in one of the next releases <img src="https://ilnumerics.net/blog/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> </p>
<p>I wonder, how the memory management is done in Cloud Numerics. The library provides overloaded operators and hence faces the same problems, which have led to the sophisticated memory management in ILNumerics: if executed in tight loops, expression like </p>
<p><code>A = 0.5 * (A + A') + 0.5 * (A - A')</code> </p>
<p>on &#8216;large&#8217; arrays A will inevitably lead to memory pollution if run without deterministic disposal! Not to speak about (virtual) memory fragmentation and the problems introduced by heavy unmanaged resources in conjunction with .NET objects and the GC &#8230; I could not find the time to really test it live, but I am almost sure, the targeted audience with really large problem sizes somehow contradicts this approach. Unless there is some hidden mechanism in the runtime (which I doubt, because the use of &#8216;var&#8217; and regular C#, hence without the option to overload the assignment operator), this could evolve to a real nuissance IMO. </p>
<h2>Distributed Arrays</h2>
<p>This part seems straightforward. It follows the established scheme known from MPI but offers a nicer interface to the user. Also the Cloud Numerics Runtime wraps away the overhead of cluster management, array slicing to a good extend. However, the question of memory management again arises on the distributed side as well. Since the API exposed to the user (obviously?) does not take care of disposal of temporary arrays in a timely fashion, the performance for large arrays will most likely be suffering. </p>
<p>As soon as I find out more details about their internal memeory management I will post them here &#8211; hopefully together with some corrections of my assumptions. </p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/microsoft-numerics-cloud-numerics-for-azure-a-short-review/">Microsoft.Numerics, Cloud Numerics for Azure &#8211; a short Review</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/microsoft-numerics-cloud-numerics-for-azure-a-short-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
