Thanks Tim. I did not declare it with float index type. Now corrected and it works.<br><br><div class="gmail_quote">On Mon Nov 24 2014 at 9:26:38 PM Tim Armstrong <<a href="mailto:tim.g.armstrong@gmail.com">tim.g.armstrong@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Was fdf_proc_vn declared with [float] as the index type?<br><br><a href="http://swift-lang.org/guides/trunk/userguide/userguide.html#_associative_arrays" target="_blank">http://swift-lang.org/guides/trunk/userguide/userguide.html#_associative_arrays</a><br><br></div>- Tim<br></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 24, 2014 at 8:19 PM, Ketan Maheshwari <span dir="ltr"><<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div><br></div>I need to iterate over a float range between 0.1 and 1.0 with a step size of 0.1. <div><br></div><div>My foreach loop looks like:</div><div><br></div><div><div>foreach i in [0.1:1.0:0.1]</div><div>{</div><div>/* == generate fdfs for different voltages == */</div><div>fdf_proc_vn[i]=gen_fdf(i,fdf_proc_v1);</div></div><div>}</div><div><br></div><div>I am getting the following error:</div><div><br></div><div>Supplied array index type (float) does not match the declared index type (int)<br></div><div><br></div><div>How to declare/define array such that it can accept float index type?</div><div><br></div><div>Thanks,</div><div>Ketan</div><div><br></div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
Swift-user mailing list<br>
<a href="mailto:Swift-user@ci.uchicago.edu" target="_blank">Swift-user@ci.uchicago.edu</a><br>
<a href="https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user" target="_blank">https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user</a><br></blockquote></div></div>
______________________________<u></u>_________________<br>
Swift-user mailing list<br>
<a href="mailto:Swift-user@ci.uchicago.edu" target="_blank">Swift-user@ci.uchicago.edu</a><br>
<a href="https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user" target="_blank">https://lists.ci.uchicago.edu/<u></u>cgi-bin/mailman/listinfo/<u></u>swift-user</a></blockquote></div>