<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-forward-container"><br>
sorry, forgot to reply to the list<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Subject:
</th>
<td>Re: [Dune] get cell from index?</td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Date: </th>
<td>Fri, 25 Aug 2017 15:11:52 +0200</td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">From: </th>
<td>Gregor Corbin <a class="moz-txt-link-rfc2396E" href="mailto:corbin@mathematik.uni-kl.de"><corbin@mathematik.uni-kl.de></a></td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">To: </th>
<td>Jö Fahlke <a class="moz-txt-link-rfc2396E" href="mailto:jorrit@jorrit.de"><jorrit@jorrit.de></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Basically, I want to precompute an extended stencil for each cell for
quick access to its surroundings ( more than just the direct neighbors).
So, having to search is not really an option. I also want to have as
little storage overhead as possible. Its seems like EntitySeeds are the
best option for me. How big are they compared to an int? And how fast is
this grid.entity(entitySeed) method compared to a vector access?
Thanks for the quick reply,
Gregor
On 25.08.2017 14:52, Jö Fahlke wrote:
> Am Fr, 25. Aug 2017, 14:44:09 +0200 schrieb Gregor Corbin:
>> when I have a mapper (e.g. SCSG) of a GridView, is it possible to get a cell
>> from an index?
>>
>> To ask differently, if i do this:
>>
>> int idx = mapper.index(cell);
>>
>> can i go back like this:
>>
>> auto cell = (elements(grid_view))[idx];
> Nope, sorry. Possible alternatives, depending on what you really want to
> achieve:
>
> - iterating through `elements(grid_view)`, search for a cell with
> `mapper.index(cell)==idx`
>
> - copying and storing the cell
>
> - using `EntitySeed`s.
>
> Regards,
> Jö.
>
</pre>
</div>
</body>
</html>