source("marginal.ERGM.fct.r")
# source("construct.A.r")

equal<-NULL

sts<-NULL
nnz<-NULL
Ns<-NULL
ns<-NULL

for(n in c(300,400,500)){

ns<-c(ns,n)  
  
N<-max(n*(n-1)/2,1) #number dyads of undirected network
  
st1 <- system.time(A1<-get.A(n))

st2 <- system.time(A2<-get.A.rec(n))

sts<-c(sts,st2[1])
nnz<-c(nnz,sum(A2))
Ns<-c(Ns,N)

equal<-c(equal,sum(abs(A1-A2)))

ratio <-  sum(A2)/max((N*(N-1)),1) # N*(N-1) number of correlations in A2

cat(n," & ",N," & ",sum(A2)/2," & ",format(round(ratio,3),nsmall=3)," & ",st1[1]," & ",st2[1],"\\\\\n")
}#end 

sts<-as.numeric(sts)

lm(log(sts)~log(Ns))

lm(log(nnz)~log(Ns))

save(sts,Ns,ns,nnz,file="nonzers.RData")
