forwardsolve.kron: Solves a triangular system with a Kronecker product structure

Description Usage Arguments Value Examples

View source: R/forwardsolve.kron.R

Description

Solves kron(A, B) x = y where A and B are lower triangular matrices.

Usage

1

Arguments

A

an m x n matrix

B

an p x q matrix

y

an mp x s matrix

Value

x

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(2018)

coord.s = matrix(runif(100), ncol=2)
coord.r = matrix(runif(50), ncol=2)

d.s = as.matrix(dist(coord.s))
d.r = as.matrix(dist(coord.r))

S1 = exp(-d.s)
S2 = exp(-d.r)

A = t(chol(S1))
B = t(chol(S2))

s = 15
  
x = matrix(runif(nrow(S1)*nrow(S2)*s), ncol=s)

y = kronecker(A,B) %*% x

x.solved = forwardsolve.kron(A, B, y)

max(abs(x - x.solved))

jmhewitt/telefit documentation built on Feb. 9, 2020, 7:15 p.m.