SparseM is really intended for arbitrary sparse structure,
for banded structural there are much more efficient methods,
some of which are, if I'm not mistaken, now available in lapack.
url:www.econ.uiuc.edu/~roger/my.htmlRoger Koenker
email [EMAIL PROTECTED]
The following will create a matrix x with given sub diagonal,
diagonal and super diagonal.
# define test vectors for a, b and c
va - -(1:4); vb - 11:15; vc - 1:4
# diag.num is a matrix whose ith super diagonal equals i and
# sub diagonal equals -i
diag.num - -outer(seq(vb),seq(vb),-)
x -
diag.num - -outer(seq(vb),seq(vb),-)
x - diag(vb)
x[diag.num == -1] - va
x[diag.num == 1] - vc
From: Gabor Grothendieck [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [R] Solving a tridiagonal system
The following will create a matrix x with given sub diagonal
PROTECTED]
Subject: Re: [R] Solving a tridiagonal system
SparseM is really intended for arbitrary sparse structure,
for banded structural there are much more efficient methods,
some of which are, if I'm not mistaken, now available in lapack.
url: www.econ.uiuc.edu/~roger/my.html
equals i
diag.num - -outer(seq(vb),seq(vb),-)
x - diag(vb)
x[diag.num == -1] - va
x[diag.num == 1] - vc
From: Gabor Grothendieck [EMAIL PROTECTED]
To: [EMAIL PROTECTED],
[EMAIL PROTECTED]
Subject: RE: [R] Solving a tridiagonal system
The following will create a matrix x