Matrix multiplication methods, including diffnet
objects. This function creates a generic method for %*%
allowing for multiplying diffnet objects.
x %*% y # S3 method for default %*%(x, y) # S3 method for diffnet %*%(x, y)
x | Numeric or complex matrices or vectors, or |
---|---|
y | Numeric or complex matrices or vectors, or |
In the case of diffnet
objects performs matrix multiplication
via mapply
using x$graph
and y$graph
as arguments,
returnling a diffnet
. Otherwise returns the default according to
%*%
.
This function can be usefult to generate alternative graphs, for
example, users could compute the n-steps graph by doing net %*% net
(see examples).
Other diffnet methods:
as.array.diffnet()
,
c.diffnet()
,
diffnet-arithmetic
,
diffnet-class
,
diffnet_index
,
plot.diffnet()
,
summary.diffnet()
# Finding the Simmelian Ties network ---------------------------------------- # Random diffnet graph set.seed(773) net <- rdiffnet(100, 4, seed.graph='small-world', rgraph.args=list(k=8)) netsim <- net # According to Dekker (2006), Simmelian ties can be computed as follows netsim <- net * t(net) # Keeping mutal netsim <- netsim * (netsim %*% netsim) # Checking out differences (netsim should have less) nlinks(net)#> $`1` #> [1] 800 #> #> $`2` #> [1] 800 #> #> $`3` #> [1] 800 #> #> $`4` #> [1] 800 #>nlinks(netsim)#> $`1` #> [1] 510 #> #> $`2` #> [1] 350 #> #> $`3` #> [1] 370 #> #> $`4` #> [1] 404 #>#> 1 2 3 4 #> 290 450 430 396