Idom.num2PEtri | R Documentation |
Returns I(
{p1,p2
} is
a dominating set of the PE-PCD)
where the vertices of the PE-PCD are the 2D data set Xp
,
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
) and point, p2
, is
in the region of vertex rv2
(default is NULL
); vertices (and hence rv1
and rv2
)
are labeled as 1,2,3
in the order they are stacked
row-wise in tri
.
PE proximity regions are defined
with respect to the triangle tri
and vertex regions
are based on center M=(m_1,m_2)
in Cartesian coordinates
or M=(\alpha,\beta,\gamma)
in barycentric coordinates
in the interior of the triangle tri
or circumcenter of tri
;
default is M=(1,1,1)
, i.e., the center of mass of tri
.
ch.data.pnts
is
for checking whether points p1
and p2
are data points
in Xp
or not
(default is FALSE
),
so by default this function checks
whether the points p1
and p2
would be a
dominating set if they actually were in the data set.
See also (\insertCiteceyhan:Phd-thesis,ceyhan:masa-2007,ceyhan:dom-num-NPE-Spat2011,ceyhan:mcap2012;textualpcds).
Idom.num2PEtri(
p1,
p2,
Xp,
tri,
r,
M = c(1, 1, 1),
rv1 = NULL,
rv2 = NULL,
ch.data.pnts = FALSE
)
p1 , p2 |
Two 2D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the PE-PCD. |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center in the interior of the triangle |
rv1 , rv2 |
The indices of the vertices
whose regions contains |
ch.data.pnts |
A logical argument for
checking whether points |
I(
{p1,p2
} is a dominating set of the PE-PCD)
where the vertices of the PE-PCD are the 2D data set Xp
,
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
Elvan Ceyhan
Idom.num2PEbasic.tri
, Idom.num2AStri
,
and Idom.num2PEtetra
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
n<-10 #try also n<-20
set.seed(1)
Xp<-runif.tri(n,Tr)$g
M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0)
r<-1.5 #try also r<-2
Idom.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M)
ind.gam2<-vector()
for (i in 1:(n-1))
for (j in (i+1):n)
{if (Idom.num2PEtri(Xp[i,],Xp[j,],Xp,Tr,r,M)==1)
ind.gam2<-rbind(ind.gam2,c(i,j))}
ind.gam2
#or try
rv1<-rel.vert.tri(Xp[1,],Tr,M)$rv;
rv2<-rel.vert.tri(Xp[2,],Tr,M)$rv
Idom.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M,rv1,rv2)
Idom.num2PEtri(Xp[1,],c(1,2),Xp,Tr,r,M,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE
#since not both points, p1 and p2, are data points in Xp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.