# commons-issues mailing list archives

##### Site index · List index
Message view
Top
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MATH-435) Efficient matrix power
Date Sun, 20 Mar 2011 18:50:29 GMT
```
[ https://issues.apache.org/jira/browse/MATH-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008938#comment-13008938
]

Phil Steitz commented on MATH-435:
----------------------------------

+1 to commit this.  Maybe add warning to javadoc about stability for higher powers.

> Efficient matrix power
> ----------------------
>
>                 Key: MATH-435
>                 URL: https://issues.apache.org/jira/browse/MATH-435
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Mikkel Meyer Andersen
>            Assignee: Mikkel Meyer Andersen
>             Fix For: 3.0
>
>         Attachments: MATH435-patch1
>
>   Original Estimate: 4m
>  Remaining Estimate: 4m
>
> For symmetric matrices A it is easy to find A^n also for large n by making an eigenvalue/-vector
decomposition.
> In general, if the structure of the matrix is not know and the n'th power is needed,
A*A*...*A is way too inefficient. By using a binary representation and powers of 2, powers
can be found far faster similar to finding 5^14 as 5^14 = 5^8 * 5^4 = ((5^2)^2)^2 * (5^2)^2
= x3 * x2 where x1 = 5^2, x2 = x1^2, and x3 = x2^2, thus saving a lot of computations.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

```
Mime
View raw message