Learn R Programming

pcds (version 0.1.6)

funsCSGamTe: The function GamkCSTe is for \(k\) (\(k=2,3,4,5\)) points constituting a dominating set for Central Similarity Proximity Catch Digraphs (CS-PCDs) - standard equilateral triangle case

Description

Four indicator functions: Gam2CSTe, Gam3CSTe, Gam4CSTe, Gam5CSTe and Gam6CSTe.

The function GamkCSTe returns I({p1,...,pk} is a dominating set of the CS-PCD) where vertices of CS-PCD are the 2D data set Xp, that is, returns 1 if {p1,...,pk} is a dominating set of CS-PCD, returns 0 otherwise for \(k=2,3,4,5,6\).

CS proximity region is constructed with respect to \(T_e=T(A,B,C)=T((0,0),(1,0),(1/2,\sqrt{3}/2))\) with expansion parameter \(t>0\) and edge regions are based on center of mass \(CM=(1/2,\sqrt{3}/6)\).

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

See also (ceyhan:Phd-thesis,ceyhan:comp-geo-2010,ceyhan:mcap2012;textualpcds).

Usage

Gam2CSTe(p1, p2, Xp, t, ch.data.pnts = FALSE)

Gam3CSTe(p1, p2, p3, Xp, t, ch.data.pnts = FALSE)

Gam4CSTe(p1, p2, p3, p4, Xp, t, ch.data.pnts = FALSE)

Gam5CSTe(p1, p2, p3, p4, p5, Xp, t, ch.data.pnts = FALSE)

Gam6CSTe(p1, p2, p3, p4, p5, p6, Xp, t, ch.data.pnts = FALSE)

Value

The function GamkCSTe returns {p1,...,pk} is a dominating set of the CS-PCD) where vertices of the CS-PCD are the 2D data set Xp), that is, returns 1 if {p1,...,pk} is a dominating set of CS-PCD, returns 0 otherwise.

Arguments

p1, p2, p3, p4, p5, p6

The points {\(p1,\ldots,pk\)} are \(k\) 2D points (for \(k=2,3,4,5,6\)) to be tested for constituting a dominating set of the CS-PCD.

Xp

A set of 2D points which constitutes the vertices of the CS-PCD.

t

A positive real number which serves as the expansion parameter in CS proximity region.

ch.data.pnts

A logical argument for checking whether points {\(p1,\ldots,pk\)} are data points in Xp or not (default is FALSE).

Author

Elvan Ceyhan

See Also

Gam1CSTe, Gam2PEtri and Gam2PEtetra

Examples

Run this code
if (FALSE) {
set.seed(123)
#Examples for Gam2CSTe
t<-1.5
n<-10 #try also 10, 20 (it may take longer for larger n)

set.seed(1)
Xp<-runif.std.tri(n)$gen.points

Gam2CSTe(Xp[1,],Xp[2,],Xp,t)
Gam2CSTe(c(.2,.2),Xp[2,],Xp,t)

ind.gam2<-vector()
for (i in 1:(n-1))
 for (j in (i+1):n)
 {if (Gam2CSTe(Xp[i,],Xp[j,],Xp,t)==1)
  ind.gam2<-rbind(ind.gam2,c(i,j))}

ind.gam2
}

if (FALSE) {
#Examples for Gam3CSTe
t<-1.5
n<-10 #try also 10, 20 (it may take longer for larger n)

set.seed(1)
Xp<-runif.std.tri(n)$gen.points

Gam3CSTe(Xp[1,],Xp[2,],Xp[3,],Xp,t)

ind.gam3<-vector()
for (i in 1:(n-2))
 for (j in (i+1):(n-1))
   for (k in (j+1):n)
   {if (Gam3CSTe(Xp[i,],Xp[j,],Xp[k,],Xp,t)==1)
    ind.gam3<-rbind(ind.gam3,c(i,j,k))}

ind.gam3
}

if (FALSE) {
#Examples for Gam4CSTe
t<-1.5
n<-10 #try also 10, 20 (it may take longer for larger n)

set.seed(1)
Xp<-runif.std.tri(n)$gen.points

Gam4CSTe(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp,t)

ind.gam4<-vector()
for (i in 1:(n-3))
 for (j in (i+1):(n-2))
   for (k in (j+1):(n-1))
     for (l in (k+1):n)
     {if (Gam4CSTe(Xp[i,],Xp[j,],Xp[k,],Xp[l,],Xp,t)==1)
      ind.gam4<-rbind(ind.gam4,c(i,j,k,l))}

ind.gam4

Gam4CSTe(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp,t,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp
}

if (FALSE) {
#Examples for Gam5CSTe
t<-1.5
n<-10 #try also 10, 20 (it may take longer for larger n)

set.seed(1)
Xp<-runif.std.tri(n)$gen.points

Gam5CSTe(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t)

ind.gam5<-vector()
for (i1 in 1:(n-4))
 for (i2 in (i1+1):(n-3))
   for (i3 in (i2+1):(n-2))
     for (i4 in (i3+1):(n-1))
       for (i5 in (i4+1):n)
       {if (Gam5CSTe(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp,t)==1)
        ind.gam5<-rbind(ind.gam5,c(i1,i2,i3,i4,i5))}

ind.gam5

Gam5CSTe(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp
}

if (FALSE) {
#Examples for Gam6CSTe
t<-1.5
n<-10 #try also 10, 20 (it may take longer for larger n)

set.seed(1)
Xp<-runif.std.tri(n)$gen.points

Gam6CSTe(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t)

ind.gam6<-vector()
for (i1 in 1:(n-5))
 for (i2 in (i1+1):(n-4))
   for (i3 in (i2+1):(n-3))
     for (i4 in (i3+1):(n-2))
       for (i5 in (i4+1):(n-1))
         for (i6 in (i5+1):n)
         {if (Gam6CSTe(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp[i6,],Xp,t)==1)
          ind.gam6<-rbind(ind.gam6,c(i1,i2,i3,i4,i5,i6))}

ind.gam6

Gam6CSTe(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t,ch.data.pnts = FALSE)
#gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp
}

Run the code above in your browser using DataLab