Boost logo

Ublas :

Subject: Re: [ublas] Question/request for matrix powers and other stuff
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-10-21 15:25:57

Daryle Walker schrieb:
> On Sep 29, 2008, at 5:45 PM, Gunter Winkler wrote:
>> Computing an integer power of a matrix efficiently requires an quite
>> involved algorithm. Thus we decided that uBLAS does not need such a
>> feature. However it should not be too difficult to write such a
>> function for positive exponents:
> If it's so complicated, isn't that more reason to centralize the
> routine so a bunch of people don't try and fail to write the function
> effectively?
Yes. However the ultimate source for such algorithms is LAPACK (or The focus of uBLAS is the BLAS (basic linear algebra
subroutines). For convenience we include some advanced operations.
However, the matrix potential if far off our scope.

In general you can use the following procedure:

given: square matrix A
compute a the jacobi matrix A = X^T J X
compute J^n
compute A^n = X^T J^n X

The main problem is the first step which requires the solution of a
generalized eigenvalue problem ...

BTW: Why do you want to compute A^n ? Maybe there is a chance to avoid this.