}
template<int SPACEDIM>
-void DataArrayDouble::FindTupleIdsNearTuplesAlg(const BBTree<SPACEDIM,int>& myTree, const double *pos, int nbOfTuples, double eps,
+void DataArrayDouble::FindTupleIdsNearTuplesAlg(const BBTreePts<SPACEDIM,int>& myTree, const double *pos, int nbOfTuples, double eps,
DataArrayInt *c, DataArrayInt *cI)
{
for(int i=0;i<nbOfTuples;i++)
* Two tuples are considered equal if the euclidian distance between the two tuples is lower than \a eps.
*
* \param [in] other a DataArrayDouble having same number of components than \a this.
- * \param [in] eps absolute precision representing euclidian distance between 2 tuples behind which 2 tuples are considered equal.
+ * \param [in] eps absolute precision representing distance (using infinite norm) between 2 tuples behind which 2 tuples are considered equal.
* \param [out] c will contain the set of tuple ids in \a this that are equal to to the tuple ids in \a other contiguously.
* \a cI allows to extract information in \a c.
* \param [out] cI is an indirection array that allows to extract the data contained in \a c.
if(!other)
throw INTERP_KERNEL::Exception("DataArrayDouble::computeTupleIdsNearTuples : input pointer other is null !");
checkAllocated();
- MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> bbox=computeBBoxPerTuple(eps);
other->checkAllocated();
int nbOfCompo=getNumberOfComponents();
int otherNbOfCompo=other->getNumberOfComponents();
{
case 3:
{
- BBTree<3,int> myTree(bbox->getConstPointer(),0,0,getNumberOfTuples(),eps/10);
+ BBTreePts<3,int> myTree(begin(),0,0,getNumberOfTuples(),eps);
FindTupleIdsNearTuplesAlg<3>(myTree,other->getConstPointer(),nbOfTuplesOther,eps,cArr,cIArr);
break;
}
case 2:
{
- BBTree<2,int> myTree(bbox->getConstPointer(),0,0,getNumberOfTuples(),eps/10);
+ BBTreePts<2,int> myTree(begin(),0,0,getNumberOfTuples(),eps);
FindTupleIdsNearTuplesAlg<2>(myTree,other->getConstPointer(),nbOfTuplesOther,eps,cArr,cIArr);
break;
}
case 1:
{
- BBTree<1,int> myTree(bbox->getConstPointer(),0,0,getNumberOfTuples(),eps/10);
+ BBTreePts<1,int> myTree(begin(),0,0,getNumberOfTuples(),eps);
FindTupleIdsNearTuplesAlg<1>(myTree,other->getConstPointer(),nbOfTuplesOther,eps,cArr,cIArr);
break;
}
template<int SPACEDIM>
static void FindClosestTupleIdAlg(const BBTreePts<SPACEDIM,int>& myTree, double dist, const double *pos, int nbOfTuples, const double *thisPt, int thisNbOfTuples, int *res);
template<int SPACEDIM>
- static void FindTupleIdsNearTuplesAlg(const BBTree<SPACEDIM,int>& myTree, const double *pos, int nbOfTuples, double eps,
+ static void FindTupleIdsNearTuplesAlg(const BBTreePts<SPACEDIM,int>& myTree, const double *pos, int nbOfTuples, double eps,
DataArrayInt *c, DataArrayInt *cI);
private:
~DataArrayDouble() { }
* \param [in] pos - pointer to coordinates of the point. This array is expected to
* be of length \a this->getSpaceDimension() at least, else the
* behavior is not warranted.
- * \param [in] eps - the lowest distance between a point and a node at which the node is
+ * \param [in] eps - the lowest distance between a point and a node (using infinite norm) at which the node is
* not returned by this method.
* \return DataArrayInt * - a new instance of DataArrayInt holding ids of nodes
* close to the point. The caller is to delete this
* behavior is not warranted.
* \param [in] nbOfPoints - number of points whose coordinates are given by \a pos
* parameter.
- * \param [in] eps - the lowest distance between a point and a node at which the node is
+ * \param [in] eps - the lowest distance between (using infinite norm) a point and a node at which the node is
* not returned by this method.
* \param [out] c - array returning ids of nodes located closer than \a eps to the
* given points. The caller
0.2,-0.3, # 1
0.3,-0.302, # 2
1.1,0.0, # 3
- 0.3,-0.303];# 4
+ 0.3,-0.30299999999999];# 4
coordsArr=DataArrayDouble.New();
coordsArr.setValues(coords,5,2);
mesh=MEDCouplingUMesh.New();
1.1, 0.002] # ~ nodes #3, #4 and #5
ids,idsIndex=mesh.getNodeIdsNearPoints(points,3,0.003);
assert ids.getValues() == [1, 3, 4, 5]
- print idsIndex.getValues()
+ assert idsIndex.getValues() == [0, 1, 1, 4]
#! [PySnippet_MEDCouplingPointSet_getNodeIdsNearPoints_2]
return
dv.alloc( 6, 1 )
dv.iota(7)
dv.rearrange( 2 )
- print dv.getTuple( 1 )
+ assert dv.getTuple( 1 ) == [9,10]
#! [Snippet_DataArrayInt_getTuple_1]
#! [Snippet_DataArrayInt_getTuple_2]
for tpl in dv: