%*%,Dyadic,Dyadic-method {DyadiCarma} | R Documentation |
Matrix multiplication of dyadic objects
Description
The standard matrix multiplication of two Dyadic
-objects.
Usage
## S4 method for signature 'Dyadic,Dyadic'
x %*% y
Arguments
x |
|
y |
|
Details
Both orders of multiplication are implemented: (scalar * dyadic)
and (dyadic * scalar)
.
Value
Either a Dyadic
-object or a regular matrix depending on the structure type
of the input objects. The matrix outcome of multiplication is also
reported as a message in the command line.
References
Kos, M., Podgórski, K., & Wu, H. (2025). Dyadic Factorization and Efficient Inversion of Sparse Positive Definite Matrices. arXiv. https://arxiv.org/abs/2505.08144
See Also
Dyadic-class
for the definition of the Dyadic
-class;
dyadFac
for the dyadic decomposition of dyadic matrices;
Examples
#--------------------------------------------------#
#------- Multiplication of dyadic matrices --------#
#--------------------------------------------------#
N <- 4
k <- 3
# Construct four types of dyadic matrices with made of 1's
V <- construct(N, k, type = "vert") # vertical
H <- construct(N, k, type = "horiz") # horizontal
S <- construct(N, k, type = "symm") # symmetric
AS <- construct(N, k, type = "asymm") # asymmetric
# Convert the dyadic matrices to matrix format
mat_V <- as.matrix(V)
mat_H <- as.matrix(H)
mat_S <- as.matrix(S)
mat_AS <- as.matrix(AS)
# Multiplication of dyadic matrices
VV <- V %*% V # vertical * vertical = vertical
HH <- H %*% H # horizontal * horizontal = horizontal
HS <- H %*% S # horizontal * symmetric = asymmetric
HV <- H %*% V # horizontal * vertical = asymmetric
ASV <- AS %*% V # asymmetric * vertical = asymmetric
VH <- V %*% H # vertical * horizontal = non-dyadic
VS <- V %*% S # vertical * symmetric = non-dyadic
VAS <- V %*% AS # vertical * asymmetric = non-dyadic
SS <- S %*% S # symmetric * symmetric = non-dyadic
ASAS <- AS %*% AS # asymmetric * asymmetric = non-dyadic
ASH <- AS %*% H # asymmetric * horizontal = non-dyadic
dim(ASAS) # regular matrix
[Package DyadiCarma version 1.0.1 Index]