Learn R Programming

pcds (version 0.1.8)

Idom.num2PEbasic.tri: The indicator for two points being a dominating set for Proportional Edge Proximity Catch Digraphs (PE-PCDs) - standard basic triangle case

Description

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 in the standard basic triangle \(T_b=T((0,0),(1,0),(c_1,c_2))\), that is, returns 1 if {p1,p2} is a dominating set of PE-PCD, and returns 0 otherwise.

PE proximity regions are defined with respect to \(T_b\). In the standard basic triangle, \(T_b\), \(c_1\) is in \([0,1/2]\), \(c_2>0\) and \((1-c_1)^2+c_2^2 \le 1\).

Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.

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 a standard basic triangle \(T_b\); default is \(M=(1,1,1)\), i.e., the center of mass of \(T_b\). Point, p1, is in the vertex region of vertex rv1 (default is NULL); and point, p2, is in the vertex region of vertex rv2 (default is NULL); vertices are labeled as \(1,2,3\) in the order they are stacked row-wise.

ch.data.pnts is for checking whether points p1 and p2 are both data points in Xp or not (default is FALSE), so by default this function checks whether the points p1 and p2 would constitute a dominating set if they both were actually in the data set.

See also (ceyhan:Phd-thesis,ceyhan:dom-num-NPE-Spat2011;textualpcds).

Usage

Idom.num2PEbasic.tri(
  p1,
  p2,
  Xp,
  r,
  c1,
  c2,
  M = c(1, 1, 1),
  rv1 = NULL,
  rv2 = NULL,
  ch.data.pnts = FALSE
)

Value

\(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.

Arguments

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.

r

A positive real number which serves as the expansion parameter in PE proximity region; must be \(\ge 1\).

c1, c2

Positive real numbers which constitute the vertex of the standard basic triangle. adjacent to the shorter edges; \(c_1\) must be in \([0,1/2]\), \(c_2>0\) and \((1-c_1)^2+c_2^2 \le 1\).

M

A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of the standard basic triangle \(T_b\) or the circumcenter of \(T_b\) which may be entered as "CC" as well; default is \(M=(1,1,1)\), i.e., the center of mass of \(T_b\).

rv1, rv2

The indices of the vertices whose regions contains p1 and p2, respectively. They take the vertex labels as \(1,2,3\) as in the row order of the vertices in \(T_b\) (default is NULL for both).

ch.data.pnts

A logical argument for checking whether points p1 and p2 are data points in Xp or not (default is FALSE).

Author

Elvan Ceyhan

References

See Also

Idom.num2PEtri, Idom.num2ASbasic.tri, and Idom.num2AStri

Examples

Run this code
# \donttest{
c1<-.4; c2<-.6;
A<-c(0,0); B<-c(1,0); C<-c(c1,c2);
Tb<-rbind(A,B,C)
n<-10  #try also n<-20

set.seed(1)
Xp<-runif.basic.tri(n,c1,c2)$g

M<-as.numeric(runif.basic.tri(1,c1,c2)$g)  #try also M<-c(.6,.3)

r<-2

Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M)

Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M)
Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M,
ch.data.pnts = TRUE)

ind.gam2<-vector()
for (i in 1:(n-1))
  for (j in (i+1):n)
  {if (Idom.num2PEbasic.tri(Xp[i,],Xp[j,],Xp,r,c1,c2,M)==1)
   ind.gam2<-rbind(ind.gam2,c(i,j))}
ind.gam2

#or try
rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv;
rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv;
Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1,rv2)

#or try
rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv;
Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1)

#or try
rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv;
Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv2=rv2)

Idom.num2PEbasic.tri(c(1,2),Xp[2,],Xp,r,c1,c2,M,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE since not both points are data points in Xp
# }

Run the code above in your browser using DataLab