Learn R Programming

simest (version 0.4-1-1)

solve.pentadiag: Pentadiagonal Linear Solver

Description

A function to solve pentadiagonal system of linear equations.

Usage

solve_pentadiag(a, b)
## method  solve.pentadiag(a, b, ...)  is __deprecated__ now (Nov.18 2025)

Value

A vector containing the solution.

Arguments

a

a numeric square matrix with pentadiagonal rows. The function does NOT check for pentadiagonal matrix.

b

a numeric vector of the same length as nrows(a). This argument cannot be a matrix.

Author

Arun Kumar Kuchibhotla

Details

This function is written mainly for use in this package. It may not be the most efficient code.

Originally it was documented (and declared) as an S3 method for solve(), and class pentadiagonal and as function named solve.pentadiag, but such classed objects were never used.

Examples

Run this code
A <- matrix(c(2,1,1,0,0,
              1,2,1,1,0,
              1,1,2,1,1,
              0,1,1,2,1,
              0,0,1,1,2), nrow = 5)
b <- 1:5
tools::assertWarning(tmp <- solve.pentadiag(A, b), verbose=TRUE) # deprecated
tmp # 0.5 0.75 -0.75 0.75 2.5
stopifnot( identical(tmp,   solve_pentadiag(A, b)))

Run the code above in your browser using DataLab