<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri",sans-serif}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="#0563C1" vlink="#954F72">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">There is no mechanism for that. I assume you are talking about dense tags, not sparse tags.<br>
If sparse tags, you will just have to retrieve one by one the tag values, with tag_get_data(()<br>
<br>
I think the most efficient way is to use tag_iterate over your elements of interest (if dense)<br>
By using tag_iterate, you will access tag values directly in memory, no copying involved<br>
You should return either a range or a standard vector, depending on how broken your output  sequence will be<br>
<br>
(so if your output will be hex1-10, hex 101-120, it is better to have a range; if it is hex1, hex 5, hex 11, (very sparse), it is better to output a vector)<br>
<br>
so your code could look like this (look in Interface.hpp comments)<br>
<br>
Range output_range;<br>
<br>
Range::iterator iter = ents.begin();<br>
 while (iter != ents.end()) {<br>
     int count;<br>
     // get contiguous block of tag dat<br>
     void* ptr;<br>
     err = mb.tag_iterate( tag, iter, ents.end(), count, ptr );<br>
     if (err) { ... }<br>
    // do something with tag data<br>
     // assume your tag is type double <br>
     double *dptr = ptr<br>
    for (int j=0; j<count; j++, dptr++)<br>
     if (*dptr<0.25 && *dptr > 0.75)<br>
   {<br>
      EntityHandle interesting_element = (*iter+j);<br>
      output_range.insert( interesting_element  )<br>
      <br>
   }<br>
      // advance to next block of data<br>
     iter += count;<br>
  }<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF507983"><font color="#000000" size="2" face="Tahoma"><b>From:</b> moab-dev-bounces@mcs.anl.gov [moab-dev-bounces@mcs.anl.gov] on behalf of Steve Balderrama [sbalderrama@eagle.org]<br>
<b>Sent:</b> Friday, May 29, 2015 9:58 AM<br>
<b>To:</b> moab-dev@mcs.anl.gov<br>
<b>Subject:</b> [MOAB-dev] MOAB search tag range<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Is there a direct function in MOAB for searching for a range of tag values, for example, looking for elements with a tag within a numeric range such as > .25 and < .75, or something similar?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">If not, what is the most efficient mechanism to do this in MOAB?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</body>
</html>