expm (version 0.99-1.1)

balance: Balance a Square Matrix via LAPACK's DGEBAL

Description

Balance a square matrix via LAPACK's DGEBAL. This is an Rinterface, mainly used for experimentation.

This LAPACK routine is used internally for Eigenvalue decompositions, but also, in Ward(1977)'s algorithm for the matrix exponential.

The name balance() is preferred nowadays, where dgebal will probably become deprecated.

Usage

balance(A, job = c("B", "P", "S"))
 dgebal(A, job = c("B", "P", "S"))

Arguments

A
a square ($n\times n$) numeric matrix.
job
a one-letter string specifying the job for DGEBAL. [object Object],[object Object],[object Object]

Value

  • A list with components
  • zthe transformation of matrix A, after permutation and or scaling.
  • scalenumeric vector of length $n$, containing the permutation and/or scale vectors applied.
  • i1,i2integers (length 1) in ${1,2,\dots,n}$, denoted by ILO and IHI respectively in the LAPACK documentation. Only relevant for "P" or "B", they describe where permutations and where scaling took place; see the Details section.

Details

An excerpt of the LAPACK documentation about DGEBAL(), describing the result [object Object],[object Object],[object Object] Look at the LAPACK documentation for more details.

References

LAPACK Reference Manual

See Also

eigen, expm.

Examples

Run this code
m4 <- rbind(c(-1,-1, 0, 0),
            c( 0, 0,10,10),
            c( 0, 0,10, 0),
            c( 0,10, 0, 0))
(b4 <- balance(m4))

## --- for testing and didactical reasons : ----

demo(balanceTst) # also defines the balanceTst() function
                # which in its tests ``defines'' what
                # the return value means, notably (i1,i2,scale)

Run the code above in your browser using DataLab