<?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: Float vs. Double</title>
	<atom:link href="http://virtuallyshocking.com/2008/01/14/float-vs-double/feed/" rel="self" type="application/rss+xml" />
	<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/</link>
	<description>Not actually all that shocking.</description>
	<lastBuildDate>Tue, 07 Feb 2012 17:19:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: owatheowais</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-78199</link>
		<dc:creator>owatheowais</dc:creator>
		<pubDate>Sat, 31 Dec 2011 17:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-78199</guid>
		<description>Great example..!</description>
		<content:encoded><![CDATA[<p>Great example..!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim's blag</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-76656</link>
		<dc:creator>Tim's blag</dc:creator>
		<pubDate>Mon, 27 Jun 2011 21:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-76656</guid>
		<description>&lt;strong&gt;Machiner precision: float vs double...&lt;/strong&gt;

I found a small code snippet on machine precision for float and double datatypes in C....</description>
		<content:encoded><![CDATA[<p><strong>Machiner precision: float vs double&#8230;</strong></p>
<p>I found a small code snippet on machine precision for float and double datatypes in C&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ever wonder the difference between double vs float</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-74792</link>
		<dc:creator>Ever wonder the difference between double vs float</dc:creator>
		<pubDate>Fri, 13 Nov 2009 02:05:49 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-74792</guid>
		<description>[...] http://virtuallyshocking.com/2008/01/14/float-vs-double/ Wikipedia - Double [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://virtuallyshocking.com/2008/01/14/float-vs-double/" rel="nofollow">http://virtuallyshocking.com/2008/01/14/float-vs-double/</a> Wikipedia &#8211; Double [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quoc</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-74791</link>
		<dc:creator>Quoc</dc:creator>
		<pubDate>Fri, 13 Nov 2009 01:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-74791</guid>
		<description>Brilliant.   Thank you for elaborating it.</description>
		<content:encoded><![CDATA[<p>Brilliant.   Thank you for elaborating it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anitha</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-74528</link>
		<dc:creator>anitha</dc:creator>
		<pubDate>Tue, 09 Jun 2009 02:22:50 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-74528</guid>
		<description>I am getting error here for the following code i hope i will get proper guidance here to remove my error ..
the error is 

ani@ani-desktop:~/Desktop/executedfiles$ javac retrievalGabor.java 
retrievalGabor.java:54: incompatible types
found   : double[]
required: float[]
query= new double[]     		{0.1544465f ,0.54298925f ,0.73340774f ,0.017640665f ,0.085013896f ,0.095653236f ,0.0 ,0.4047619f ,0.36394557f ,0.21768707f ,0.09863946f ,0.088435374f ,0.08163265f ,0.06462585f ,0.05782313f ,0.27210885f ,0.26870748f ,0.10204082f ,0.0 ,0.010204081f ,0.0034013605f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.023809524f ,0.010204081f ,0.0 ,0.0 ,0.17687075f ,0.32312927f ,0.0 ,0.0 ,0.09863946f ,0.6632653f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.013605442f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.08163265f ,0.0 ,0.0 ,0.0 ,0.49659863f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.010204081f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0};
       ^
1 error

code here:

//The alignment of the features is assumed to be AVG, VAR, CSD, GABOR

import java.io.*;
import javax.imageio.*;
import java.awt.*;
import java.awt.image.*;

class retrievalGabor
{
	public static void main(String args[])
	{
		if(args.length!=6 &amp;&amp; args.length!=7)
		{
			System.out.println(&quot;The parameters are {Query Image} {Query Gabor file} {Features File} {Gabor Text File} [blocks] {Relevant Features} {EPS directory}&quot;);
			System.exit(0);
		}
		
		int BLOCKS=1, FEATURES=15, SCALE=3, ORIENTATION=4;
		BufferedImage bi, bi1;
		GraphicsEnvironment ge= GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice gd=ge.getDefaultScreenDevice();
		GraphicsConfiguration gc=gd.getDefaultConfiguration();
		Graphics2D g2D=null;
		ColorModel cm=null;
		DataInputStream dis, dis1;
		BufferedReader br, br1;

		float features[][], diff[], query[], tmp=0;
		String names[], tmps=null, tokens[];
		int images=0, wt[], bitcount=0;
		char ch;

		try{
			bi=ImageIO.read(new File(args[0]));
			bi1=gc.createCompatibleImage(bi.getWidth(null), bi.getHeight(null));
			g2D=bi1.createGraphics();
			g2D.drawImage(bi, null, 0, 0);
			bi=bi1;

			dis=new DataInputStream(new FileInputStream(args[2]));//opening the features file
			br=new BufferedReader(new FileReader(args[3]));//opening the texture features file

			
			if(args.length==7)
			{
				BLOCKS=Integer.parseInt(args[4]);
				dis1=new DataInputStream(new FileInputStream(args[5]));//opening the relevant features file
			}
			else
				dis1=new DataInputStream(new FileInputStream(args[4]));//opening the relevant features file

			
			//query=myFinalToolkit.computeColorSampleImage(bi, BLOCKS, SCALE*ORIENTATION);
query= new double[]     		{0.1544465f ,0.54298925f ,0.73340774f ,0.017640665f ,0.085013896f ,0.095653236f ,0.0 ,0.4047619f ,0.36394557f ,0.21768707f ,0.09863946f ,0.088435374f ,0.08163265f ,0.06462585f ,0.05782313f ,0.27210885f ,0.26870748f ,0.10204082f ,0.0 ,0.010204081f ,0.0034013605f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.023809524f ,0.010204081f ,0.0 ,0.0 ,0.17687075f ,0.32312927f ,0.0 ,0.0 ,0.09863946f ,0.6632653f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.013605442f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.08163265f ,0.0 ,0.0 ,0.0 ,0.49659863f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.010204081f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0};

			br1=new BufferedReader(new FileReader(args[1]));//opening the Query texture file
			tokens=(br1.readLine()).split(&quot; &quot;);
			for(int i=3;i&lt;2*BLOCKS*SCALE*ORIENTATION;i++)
				query[BLOCKS*6+120+i-3]=Float.parseFloat(tokens[i]);
			br1.close();

			//reading the features file
			images=dis.readInt();
			features=new float[images][BLOCKS*(6+SCALE*ORIENTATION*2)+120];
			names=new String[images];

			for(int i=0;i&lt;images;i++)
			{
				names[i]=new String();
				while((ch=dis.readChar())!=&#039;\n&#039;)
					names[i]+=ch;
				
				for(int j=0; j&lt;BLOCKS*6+120;j++)
					features[i][j]=dis.readFloat();		
				dis.readChar();

				tokens=(br.readLine()).split(&quot; &quot;);
				for(int j=3;j&lt;BLOCKS*2*SCALE*ORIENTATION;j++)
					features[i][BLOCKS*6+120+j-3]=Float.parseFloat(tokens[j]);
			}
			dis.close();
			br.close();

			//reading the feature relevancy
			wt=new int[BLOCKS*(FEATURES-1)+1];
			for(int i=0;i&lt;BLOCKS*(FEATURES-1)+1;i++)
			{
				wt[i]=dis1.readInt();
				System.out.print(wt[i]+&quot; &quot;);
			}
			System.out.println();
			dis1.close();

			diff=new float[images];
			for(int i=0;i&lt;images;i++)
			{	
				//average and variance in color
				for(int j=0;j&lt;BLOCKS;j++)
				{
					for(int k=0;k&lt;2;k++)
					{
						tmp=0;
						if(wt[j*(FEATURES-1)+k]==1)
						{
							for(int	l=0;l&lt;3;l++)
								tmp+=Math.abs(query[j*6+k*3+l]-features[i][j*6+k*3+l]);
							
							diff[i]+=tmp/3;
						}
					}
				}

				//CSD
				tmp=0;
				if(wt[BLOCKS*(FEATURES-1)]==1)
				{
					for(int k=0;k&lt;120;k++)
						tmp+=Math.abs(query[BLOCKS*6+k]-features[i][BLOCKS*6+k]);
					
					diff[i]+=tmp/120;
				}
				
				//texture features
				for(int j=0;j&lt;BLOCKS;j++)
					for(int k=0;k&lt;SCALE*ORIENTATION;k++)
					{
						tmp=0;
						if(wt[j*(FEATURES-1)+2+k]==1)
							for(int l=0;l&lt;2;l++)
								{
									tmp+=Math.abs(query[BLOCKS*6+120+j*SCALE*ORIENTATION+2*k+l]-features[i][BLOCKS*6+120+j*SCALE*ORIENTATION+2*k+l]);
								}
							diff[i]+=tmp/2;
					}
				
			}


			//sort the entries in the sorted order
			for(int i=0;i&lt;images-1;i++)
				for(int	j=0;j&lt;images-i-1;j++)
				{
					if(diff[j+1]&lt;diff[j])
					{
						tmp=diff[j];
						diff[j]=diff[j+1];
						diff[j+1]=tmp;

						tmps=names[j];
						names[j]=names[j+1];
						names[j+1]=tmps;
						
						tmps=null;
					}
				}
			
/*			//sort the entries in the sorted order by name
			for(int i=0;i&lt;29;i++)
				for(int	j=0;j0)
					{
						tmp=diff[j];
						diff[j]=diff[j+1];
						diff[j+1]=tmp;

						tmps=names[j];
						names[j]=names[j+1];
						names[j+1]=tmps;
						
						tmps=null;
					}
				}
*/
				
			Runtime rt=Runtime.getRuntime();
			String arr[]=new String[3], dir[]=new String[2];
			
			dir[0]=new String(&quot;/bin/mkdir&quot;);
			if(args.length==6)
				dir[1]=new String(&quot;/tmp/&quot;+args[5]+args[0].substring(args[0].lastIndexOf(&#039;/&#039;)+1, args[0].lastIndexOf(&#039;.&#039;)));
			else
			    dir[1]=new String(&quot;/tmp/&quot;+args[6]+args[0].substring(args[0].lastIndexOf(&#039;/&#039;)+1, args[0].lastIndexOf(&#039;.&#039;)));

			rt.exec(dir);

			arr[0]=new String(&quot;/bin/cp&quot;);		
			for(int i=0;i&lt;30;i++)
			{
				System.out.println(names[i]+&quot; &quot;+diff[i]);
				arr[1]=new String(args[0].substring(0,args[0].lastIndexOf(&quot;/&quot;)+1)+names[i]);

				if(i&lt;10)
				arr[2]=new String(dir[1]+&quot;/0&quot;+i+&quot;.jpg&quot;);
				else
					arr[2]=new String(dir[1]+&quot;/&quot;+i+&quot;.jpg&quot;);
				rt.exec(arr);
			}	
			
		}
		catch(Exception e)
		{
			e.printStackTrace();
			System.exit(0);
		}
	}
}</description>
		<content:encoded><![CDATA[<p>I am getting error here for the following code i hope i will get proper guidance here to remove my error ..<br />
the error is </p>
<p>ani@ani-desktop:~/Desktop/executedfiles$ javac retrievalGabor.java<br />
retrievalGabor.java:54: incompatible types<br />
found   : double[]<br />
required: float[]<br />
query= new double[]     		{0.1544465f ,0.54298925f ,0.73340774f ,0.017640665f ,0.085013896f ,0.095653236f ,0.0 ,0.4047619f ,0.36394557f ,0.21768707f ,0.09863946f ,0.088435374f ,0.08163265f ,0.06462585f ,0.05782313f ,0.27210885f ,0.26870748f ,0.10204082f ,0.0 ,0.010204081f ,0.0034013605f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.023809524f ,0.010204081f ,0.0 ,0.0 ,0.17687075f ,0.32312927f ,0.0 ,0.0 ,0.09863946f ,0.6632653f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.013605442f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.08163265f ,0.0 ,0.0 ,0.0 ,0.49659863f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.010204081f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0};<br />
       ^<br />
1 error</p>
<p>code here:</p>
<p>//The alignment of the features is assumed to be AVG, VAR, CSD, GABOR</p>
<p>import java.io.*;<br />
import javax.imageio.*;<br />
import java.awt.*;<br />
import java.awt.image.*;</p>
<p>class retrievalGabor<br />
{<br />
	public static void main(String args[])<br />
	{<br />
		if(args.length!=6 &amp;&amp; args.length!=7)<br />
		{<br />
			System.out.println(&#8220;The parameters are {Query Image} {Query Gabor file} {Features File} {Gabor Text File} [blocks] {Relevant Features} {EPS directory}&#8221;);<br />
			System.exit(0);<br />
		}</p>
<p>		int BLOCKS=1, FEATURES=15, SCALE=3, ORIENTATION=4;<br />
		BufferedImage bi, bi1;<br />
		GraphicsEnvironment ge= GraphicsEnvironment.getLocalGraphicsEnvironment();<br />
		GraphicsDevice gd=ge.getDefaultScreenDevice();<br />
		GraphicsConfiguration gc=gd.getDefaultConfiguration();<br />
		Graphics2D g2D=null;<br />
		ColorModel cm=null;<br />
		DataInputStream dis, dis1;<br />
		BufferedReader br, br1;</p>
<p>		float features[][], diff[], query[], tmp=0;<br />
		String names[], tmps=null, tokens[];<br />
		int images=0, wt[], bitcount=0;<br />
		char ch;</p>
<p>		try{<br />
			bi=ImageIO.read(new File(args[0]));<br />
			bi1=gc.createCompatibleImage(bi.getWidth(null), bi.getHeight(null));<br />
			g2D=bi1.createGraphics();<br />
			g2D.drawImage(bi, null, 0, 0);<br />
			bi=bi1;</p>
<p>			dis=new DataInputStream(new FileInputStream(args[2]));//opening the features file<br />
			br=new BufferedReader(new FileReader(args[3]));//opening the texture features file</p>
<p>			if(args.length==7)<br />
			{<br />
				BLOCKS=Integer.parseInt(args[4]);<br />
				dis1=new DataInputStream(new FileInputStream(args[5]));//opening the relevant features file<br />
			}<br />
			else<br />
				dis1=new DataInputStream(new FileInputStream(args[4]));//opening the relevant features file</p>
<p>			//query=myFinalToolkit.computeColorSampleImage(bi, BLOCKS, SCALE*ORIENTATION);<br />
query= new double[]     		{0.1544465f ,0.54298925f ,0.73340774f ,0.017640665f ,0.085013896f ,0.095653236f ,0.0 ,0.4047619f ,0.36394557f ,0.21768707f ,0.09863946f ,0.088435374f ,0.08163265f ,0.06462585f ,0.05782313f ,0.27210885f ,0.26870748f ,0.10204082f ,0.0 ,0.010204081f ,0.0034013605f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.023809524f ,0.010204081f ,0.0 ,0.0 ,0.17687075f ,0.32312927f ,0.0 ,0.0 ,0.09863946f ,0.6632653f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.013605442f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.08163265f ,0.0 ,0.0 ,0.0 ,0.49659863f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.010204081f ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0};</p>
<p>			br1=new BufferedReader(new FileReader(args[1]));//opening the Query texture file<br />
			tokens=(br1.readLine()).split(&#8221; &#8220;);<br />
			for(int i=3;i&lt;2*BLOCKS*SCALE*ORIENTATION;i++)<br />
				query[BLOCKS*6+120+i-3]=Float.parseFloat(tokens[i]);<br />
			br1.close();</p>
<p>			//reading the features file<br />
			images=dis.readInt();<br />
			features=new float[images][BLOCKS*(6+SCALE*ORIENTATION*2)+120];<br />
			names=new String[images];</p>
<p>			for(int i=0;i&lt;images;i++)<br />
			{<br />
				names[i]=new String();<br />
				while((ch=dis.readChar())!=&#8217;\n&#8217;)<br />
					names[i]+=ch;</p>
<p>				for(int j=0; j&lt;BLOCKS*6+120;j++)<br />
					features[i][j]=dis.readFloat();<br />
				dis.readChar();</p>
<p>				tokens=(br.readLine()).split(&#8221; &#8220;);<br />
				for(int j=3;j&lt;BLOCKS*2*SCALE*ORIENTATION;j++)<br />
					features[i][BLOCKS*6+120+j-3]=Float.parseFloat(tokens[j]);<br />
			}<br />
			dis.close();<br />
			br.close();</p>
<p>			//reading the feature relevancy<br />
			wt=new int[BLOCKS*(FEATURES-1)+1];<br />
			for(int i=0;i&lt;BLOCKS*(FEATURES-1)+1;i++)<br />
			{<br />
				wt[i]=dis1.readInt();<br />
				System.out.print(wt[i]+&#8221; &#8220;);<br />
			}<br />
			System.out.println();<br />
			dis1.close();</p>
<p>			diff=new float[images];<br />
			for(int i=0;i&lt;images;i++)<br />
			{<br />
				//average and variance in color<br />
				for(int j=0;j&lt;BLOCKS;j++)<br />
				{<br />
					for(int k=0;k&lt;2;k++)<br />
					{<br />
						tmp=0;<br />
						if(wt[j*(FEATURES-1)+k]==1)<br />
						{<br />
							for(int	l=0;l&lt;3;l++)<br />
								tmp+=Math.abs(query[j*6+k*3+l]-features[i][j*6+k*3+l]);</p>
<p>							diff[i]+=tmp/3;<br />
						}<br />
					}<br />
				}</p>
<p>				//CSD<br />
				tmp=0;<br />
				if(wt[BLOCKS*(FEATURES-1)]==1)<br />
				{<br />
					for(int k=0;k&lt;120;k++)<br />
						tmp+=Math.abs(query[BLOCKS*6+k]-features[i][BLOCKS*6+k]);</p>
<p>					diff[i]+=tmp/120;<br />
				}</p>
<p>				//texture features<br />
				for(int j=0;j&lt;BLOCKS;j++)<br />
					for(int k=0;k&lt;SCALE*ORIENTATION;k++)<br />
					{<br />
						tmp=0;<br />
						if(wt[j*(FEATURES-1)+2+k]==1)<br />
							for(int l=0;l&lt;2;l++)<br />
								{<br />
									tmp+=Math.abs(query[BLOCKS*6+120+j*SCALE*ORIENTATION+2*k+l]-features[i][BLOCKS*6+120+j*SCALE*ORIENTATION+2*k+l]);<br />
								}<br />
							diff[i]+=tmp/2;<br />
					}</p>
<p>			}</p>
<p>			//sort the entries in the sorted order<br />
			for(int i=0;i&lt;images-1;i++)<br />
				for(int	j=0;j&lt;images-i-1;j++)<br />
				{<br />
					if(diff[j+1]&lt;diff[j])<br />
					{<br />
						tmp=diff[j];<br />
						diff[j]=diff[j+1];<br />
						diff[j+1]=tmp;</p>
<p>						tmps=names[j];<br />
						names[j]=names[j+1];<br />
						names[j+1]=tmps;</p>
<p>						tmps=null;<br />
					}<br />
				}</p>
<p>/*			//sort the entries in the sorted order by name<br />
			for(int i=0;i&lt;29;i++)<br />
				for(int	j=0;j0)<br />
					{<br />
						tmp=diff[j];<br />
						diff[j]=diff[j+1];<br />
						diff[j+1]=tmp;</p>
<p>						tmps=names[j];<br />
						names[j]=names[j+1];<br />
						names[j+1]=tmps;</p>
<p>						tmps=null;<br />
					}<br />
				}<br />
*/</p>
<p>			Runtime rt=Runtime.getRuntime();<br />
			String arr[]=new String[3], dir[]=new String[2];</p>
<p>			dir[0]=new String(&#8220;/bin/mkdir&#8221;);<br />
			if(args.length==6)<br />
				dir[1]=new String(&#8220;/tmp/&#8221;+args[5]+args[0].substring(args[0].lastIndexOf(&#8216;/&#8217;)+1, args[0].lastIndexOf(&#8216;.&#8217;)));<br />
			else<br />
			    dir[1]=new String(&#8220;/tmp/&#8221;+args[6]+args[0].substring(args[0].lastIndexOf(&#8216;/&#8217;)+1, args[0].lastIndexOf(&#8216;.&#8217;)));</p>
<p>			rt.exec(dir);</p>
<p>			arr[0]=new String(&#8220;/bin/cp&#8221;);<br />
			for(int i=0;i&lt;30;i++)<br />
			{<br />
				System.out.println(names[i]+&#8221; &#8220;+diff[i]);<br />
				arr[1]=new String(args[0].substring(0,args[0].lastIndexOf(&#8220;/&#8221;)+1)+names[i]);</p>
<p>				if(i&lt;10)<br />
				arr[2]=new String(dir[1]+&#8221;/0&#8243;+i+&#8221;.jpg&#8221;);<br />
				else<br />
					arr[2]=new String(dir[1]+&#8221;/&#8221;+i+&#8221;.jpg&#8221;);<br />
				rt.exec(arr);<br />
			}	</p>
<p>		}<br />
		catch(Exception e)<br />
		{<br />
			e.printStackTrace();<br />
			System.exit(0);<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Blake</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-42752</link>
		<dc:creator>Rob Blake</dc:creator>
		<pubDate>Tue, 15 Jan 2008 16:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-42752</guid>
		<description>Here&#039;s some matlab code to prove my point:


n=10000000;
h=1/(n-1);
a = zeros(n,1);
b=[0:n-1]&#039;*h;
for i=2:n
    a(i) = a(i-1)+h;
end

error = a-b;

plot([0:n-1]&#039;, error);
title &#039;Error a_i-b_i, a_i=a_{i-1}+h, b_i=i*h&#039;
xlabel &#039;i&#039;
ylabel &#039;error&#039;

This code has been written so that the final value for a and b is 1.  Therefore, the error in this result will give you an idea of how many digits of error you can expect for different values of n.

Doubles have about 16 digits of precision.  After 10 million iterations, you&#039;ve lost 6 digits of precision.  In floating point arithmetic, you will have lost almost all your digits of precision.

Here&#039;s the plot:
&lt;img src=&quot;http://dis.cs.uiuc.edu/twiki/pub/Rob/ImagePage/float_iteration_error.png&quot; alt=&quot;float iteration error graph&quot; /&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s some matlab code to prove my point:</p>
<p>n=10000000;<br />
h=1/(n-1);<br />
a = zeros(n,1);<br />
b=[0:n-1]&#8216;*h;<br />
for i=2:n<br />
    a(i) = a(i-1)+h;<br />
end</p>
<p>error = a-b;</p>
<p>plot([0:n-1]&#8216;, error);<br />
title &#8216;Error a_i-b_i, a_i=a_{i-1}+h, b_i=i*h&#8217;<br />
xlabel &#8216;i&#8217;<br />
ylabel &#8216;error&#8217;</p>
<p>This code has been written so that the final value for a and b is 1.  Therefore, the error in this result will give you an idea of how many digits of error you can expect for different values of n.</p>
<p>Doubles have about 16 digits of precision.  After 10 million iterations, you&#8217;ve lost 6 digits of precision.  In floating point arithmetic, you will have lost almost all your digits of precision.</p>
<p>Here&#8217;s the plot:<br />
<img src="http://dis.cs.uiuc.edu/twiki/pub/Rob/ImagePage/float_iteration_error.png" alt="float iteration error graph" /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-42695</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:47:55 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-42695</guid>
		<description>this form will have the minimum amount of round-off error possible.</description>
		<content:encoded><![CDATA[<p>this form will have the minimum amount of round-off error possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://virtuallyshocking.com/2008/01/14/float-vs-double/comment-page-1/#comment-42694</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://virtuallyshocking.com/2008/01/14/float-vs-double/#comment-42694</guid>
		<description>ugh, of don’t use doubles as a counter at all. Here’s what I recommend:


double inc = 1.e-5;
for (int iter=0; iter &lt; 900; iter++) {
  double dnumber = inc*iter;
}
</description>
		<content:encoded><![CDATA[<p>ugh, of don’t use doubles as a counter at all. Here’s what I recommend:</p>
<p>double inc = 1.e-5;<br />
for (int iter=0; iter &lt; 900; iter++) {<br />
  double dnumber = inc*iter;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

