<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Programming for Multiple Datatypes</title>
	<atom:link href="http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-29820</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Sun, 19 Oct 2008 17:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-29820</guid>
		<description>Chris-

I think you can use function pointers in Fortran somehow but my Fortran is rusty.  I don&#039;t know if the newest Fortran language versions have a concept of templates.  If so, they may help.  Otherwise, I think you&#039;re stuck doing something similar to what you are currently doing.

Maybe someone else who is more current on Fortran can add suggestions.

--Loren</description>
		<content:encoded><![CDATA[<p>Chris-</p>
<p>I think you can use function pointers in Fortran somehow but my Fortran is rusty.  I don&#8217;t know if the newest Fortran language versions have a concept of templates.  If so, they may help.  Otherwise, I think you&#8217;re stuck doing something similar to what you are currently doing.</p>
<p>Maybe someone else who is more current on Fortran can add suggestions.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Mejia</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-29819</link>
		<dc:creator>Chris Mejia</dc:creator>
		<pubDate>Sun, 19 Oct 2008 14:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-29819</guid>
		<description>I find myself in a situation where I wrote a MEX-file for efficiency and now need a single-precision version.  My current solution is to have the gateway routine select between two computational routines, and the two computational routines are identical except I&#039;ve replaced all of the &quot;double&quot; keywords with &quot;float&quot;.  Is there a more elegant solution?

Thanks in advance,
--Chris</description>
		<content:encoded><![CDATA[<p>I find myself in a situation where I wrote a MEX-file for efficiency and now need a single-precision version.  My current solution is to have the gateway routine select between two computational routines, and the two computational routines are identical except I&#8217;ve replaced all of the &#8220;double&#8221; keywords with &#8220;float&#8221;.  Is there a more elegant solution?</p>
<p>Thanks in advance,<br />
&#8211;Chris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: StephenLL</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-16019</link>
		<dc:creator>StephenLL</dc:creator>
		<pubDate>Fri, 12 Jan 2007 17:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-16019</guid>
		<description>I think this is where MATLAB shines vs other languages.  When we were on the topic of scalar expansion I wrote code in c++ to do the expansion.  My problem is that I am not a strong c/c++ programmer and my code only handled double precision numbers.  Yes, it is possible to write c++ to handle all the possibilities, but I found MATLAB to naturally handle them.

One of the main reasons I think twice about recoding bottlenecks in c or c++ is the issue with dealing with multiple precisions and data types. This advise I pass on to  anyone looking to use MEX.

Thankfully the MATLAB language evolves over time and those bottlenecks go away.

Stephen</description>
		<content:encoded><![CDATA[<p>I think this is where MATLAB shines vs other languages.  When we were on the topic of scalar expansion I wrote code in c++ to do the expansion.  My problem is that I am not a strong c/c++ programmer and my code only handled double precision numbers.  Yes, it is possible to write c++ to handle all the possibilities, but I found MATLAB to naturally handle them.</p>
<p>One of the main reasons I think twice about recoding bottlenecks in c or c++ is the issue with dealing with multiple precisions and data types. This advise I pass on to  anyone looking to use MEX.</p>
<p>Thankfully the MATLAB language evolves over time and those bottlenecks go away.</p>
<p>Stephen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Catellier</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-4219</link>
		<dc:creator>Andrew Catellier</dc:creator>
		<pubDate>Fri, 28 Jul 2006 22:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-4219</guid>
		<description>As I made my way further into my program, it turns out that the function &quot;bitshift&quot; is not defined for use with singles.  For now I can recast them, but I thought this might be useful for future type expansion.

Regards,

Andrew</description>
		<content:encoded><![CDATA[<p>As I made my way further into my program, it turns out that the function &#8220;bitshift&#8221; is not defined for use with singles.  For now I can recast them, but I thought this might be useful for future type expansion.</p>
<p>Regards,</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Catellier</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-4038</link>
		<dc:creator>Andrew Catellier</dc:creator>
		<pubDate>Tue, 25 Jul 2006 21:18:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-4038</guid>
		<description>So far the MATLAB functions have been very well behaved.  Of course, hindsight is 20/20, and I should have imported all of my arrays and constants as singles in the first place.  However, in the interest of time, I was wondering if there was a way I could salvage some of my work.  I now know that my first idea does not exist, and I will find another way to finish the work.

Thanks for your insight,
Andrew</description>
		<content:encoded><![CDATA[<p>So far the MATLAB functions have been very well behaved.  Of course, hindsight is 20/20, and I should have imported all of my arrays and constants as singles in the first place.  However, in the interest of time, I was wondering if there was a way I could salvage some of my work.  I now know that my first idea does not exist, and I will find another way to finish the work.</p>
<p>Thanks for your insight,<br />
Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-4023</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 25 Jul 2006 15:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-4023</guid>
		<description>Andrew-
&lt;p&gt;
There is no way to force MATLAB to make all variables single.
&lt;p&gt;
In MATLAB itself, (i.e., I&#039;m NOT covering toolboxes with this statement), we have tried to make sure the functions that are most likely to be used with singles work correctly with them.  If you write code &quot;generically,&quot; such as we have done in many of our math functions (especially look in the ones in &lt;kbd&gt;$MATLABROOT/toolbox/matlab/funfun&lt;/kbd&gt;), then singles should propogate through correctly.
&lt;p&gt;
It would be interesting in your application to see what happens if you start off with singles and then see where the first double creeps in.  If it&#039;s in a MATLAB function (one we supply), it would be a candidate for updating to be more generic.
&lt;p&gt;</description>
		<content:encoded><![CDATA[<p>Andrew-</p>
<p>
There is no way to force MATLAB to make all variables single.</p>
<p>
In MATLAB itself, (i.e., I&#8217;m NOT covering toolboxes with this statement), we have tried to make sure the functions that are most likely to be used with singles work correctly with them.  If you write code &#8220;generically,&#8221; such as we have done in many of our math functions (especially look in the ones in <kbd>$MATLABROOT/toolbox/matlab/funfun</kbd>), then singles should propogate through correctly.</p>
<p>
It would be interesting in your application to see what happens if you start off with singles and then see where the first double creeps in.  If it&#8217;s in a MATLAB function (one we supply), it would be a candidate for updating to be more generic.</p>
<p>
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Catellier</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-4016</link>
		<dc:creator>Andrew Catellier</dc:creator>
		<pubDate>Tue, 25 Jul 2006 15:05:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-4016</guid>
		<description>I have an interesting problem.  I&#039;m trying to make MATLAB behave like a C program using 32 bit floats.  I&#039;ve written the code I need and I&#039;m in the process of verifying it.  I realized that the accuracy of my code is near perfect when I cast all my variables to singles.  However, I have many, many variables, and was wondering if there was a way to force MATLAB to create and use single precision variables.  This, of course, would allow me to avoid the sheer pain of converting the variables in nearly 60 .m files.  Any insight or pointers would be of great interest to me.  

Thanks for your time,

Andrew</description>
		<content:encoded><![CDATA[<p>I have an interesting problem.  I&#8217;m trying to make MATLAB behave like a C program using 32 bit floats.  I&#8217;ve written the code I need and I&#8217;m in the process of verifying it.  I realized that the accuracy of my code is near perfect when I cast all my variables to singles.  However, I have many, many variables, and was wondering if there was a way to force MATLAB to create and use single precision variables.  This, of course, would allow me to avoid the sheer pain of converting the variables in nearly 60 .m files.  Any insight or pointers would be of great interest to me.  </p>
<p>Thanks for your time,</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leslie Mehrez</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-2828</link>
		<dc:creator>Leslie Mehrez</dc:creator>
		<pubDate>Fri, 07 Jul 2006 14:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-2828</guid>
		<description>Hi David,
We don&#039;t have any plans to add 64-bit support for PowerMacs. We are focusing our Mac resources on Intel Mac support. Once Apple formally announces their 64-bit roadmap for Intel Macs we&#039;ll be able to start planning for 64-bit Mac support.

Leslie Mehrez
Product Manager, Platforms, Installation &amp; Licensing
The MathWorks</description>
		<content:encoded><![CDATA[<p>Hi David,<br />
We don&#8217;t have any plans to add 64-bit support for PowerMacs. We are focusing our Mac resources on Intel Mac support. Once Apple formally announces their 64-bit roadmap for Intel Macs we&#8217;ll be able to start planning for 64-bit Mac support.</p>
<p>Leslie Mehrez<br />
Product Manager, Platforms, Installation &amp; Licensing<br />
The MathWorks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Jones</title>
		<link>http://blogs.mathworks.com/loren/2006/05/24/programming-for-multiple-datatypes/#comment-2809</link>
		<dc:creator>David Jones</dc:creator>
		<pubDate>Thu, 06 Jul 2006 20:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=38#comment-2809</guid>
		<description>Hi Loren,

I found your article about single / double data types useful.
Since you invited comments, ... I am running up against the current
memory limitations in MATLAB and I might need to switch from double
to single to try to reduce memory consumption.  Do you know when Mathworks
plans to upgrade MATLAB to have an address space that is larger than 32 bits?
I am running Mac OS X 10.4 on a G5 with 4 GB of RAM, but poor MATLAB can only address 2 GB at a time.

thanks,
  David Jones</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>I found your article about single / double data types useful.<br />
Since you invited comments, &#8230; I am running up against the current<br />
memory limitations in MATLAB and I might need to switch from double<br />
to single to try to reduce memory consumption.  Do you know when Mathworks<br />
plans to upgrade MATLAB to have an address space that is larger than 32 bits?<br />
I am running Mac OS X 10.4 on a G5 with 4 GB of RAM, but poor MATLAB can only address 2 GB at a time.</p>
<p>thanks,<br />
  David Jones</p>
]]></content:encoded>
	</item>
</channel>
</rss>

