# Tag Info

8

The matrix B (M in the documentation) needs to positive definite according to the documentation: "If sigma is None, M is positive definite", this is in addition to the first requirement "M must represent a real, symmetric matrix if A is real" which your B follows. The eigenvalues of your current matrix B are -1, 1 and 6. So matrix B is ...

7

When one says an algorithm is of order $O(n)$, that may mean that the complexity is given by: $c + b*n$. With every new element you add you increase in runtime (effectively). What mathematically minded people often forget is that these statements do not include how large the constants are. That of course carries over to $O(n²)$ and such. I can not answer ...

7

I think you are overestimating the overhead of computing L. There are zero extra operations needed; the only additional cost is writing to RAM some numbers that you have already computed anyway. The algorithms commonly used (in Lapack, for instance) to compute U also compute L along the way, and you'd save 0 flops by omitting it. For instance, if you think ...

6

The trick is trying to find out why that matrix has real eigenvalues in the first place. Usually it is because a suitable set of conjugations turns it into a symmetric matrix, and then you can reduce to a symmetric computation. Multiplying and dividing by $(AC)^{-1}$ you can rewrite $$D_1 = C^{-1}BAC (C^{-1}BAC+I)^{-1},$$ so your computation is equivalent ...

5

The other answers already tell you what went wrong, but I will add a terminology note: the term for what is happening is that the pencil $A - \lambda B$ is a singular matrix pencil, i.e., $\det (A - \lambda B)$ is identically equal to zero. So there are no generalized eigenvalues (or, at least, they cannot be defined as usual as the roots of the generalized ...

4

As far as I know, there are no such methods in LAPACK. Since LAPACK is the linear algebra package, no nonlinear solvers are included. However, you can use the underlying BLAS for implementing iterative methods. For nonlinear solvers using Jacobians (e.g., Newton's method), the matrix factorizations of LAPACK may come in handy. You may want to have a look at ...

4

LAPACK doesn't have a specialized routine for computing the eigenvalues of a unitary matrix, so you'd have to use a general-purpose eigenvalue routine for complex non-hermitian matrices. This is slower than using a routine for the eigenvalues of a complex hermitian matrix, although I'm surprised that you're seeing a factor of 20 difference in run times. ...

3

I suspect the root of your trouble is what has been detected in the comments by Vibe: For any number $\omega\in \mathbb{K}$ (with $\mathbb{K}= \mathbb{R}$ or $\mathbb{C}$) you can find $\boldsymbol{X}$ such that $AX = \omega BX$ (with $A$ and $B$ taken in your concrete example). You have already decomposed the problem in 4 blocks of 3 variables. Then let us ...

3

It would help if your question included the matrix written down in the usual format. In addition, it looks like there is a typo in your equation (the last $\sigma_i$ should be $\sigma_{i+1}$?) Anyhow, if I guess correctly what you mean, your matrix is weakly diagonally dominant and irreducible, so by a corollary of Gershgorin's circle theorem 0 is an ...

3

LAPACK doesn't include any iterative solvers. The routines in LAPACK are for eigenvalues, matrix factorizations, and solutions of systems of equations involving dense matrices while iterative methods are generally used for matrices that are large and sparse.

2

Fortunately, LAPACK provides routines to deal with the $\mathbf Q$ factor from the $\mathbf A = \mathbf Q \mathbf R$ decomposition, [dgeqrf]. To find the projection of an arbitrary $\mathbf B$ onto the space orthogonal to $\mathrm {range}(\mathbf A)$, you want to form $\mathbf C = \left(\mathbf I - \mathbf Q \mathbf Q^T\right) \mathbf B$. Here are two ...

2

Base case: Computing the factorization requires $\frac 2 3n^3$ operations and the inverse requires $\frac 4 3n^3$ operations. Computing the trace adds $O(n)$. Let's round that to $2n^3$. LU case: Computing the factorization requires $\frac 2 3n^3$ operations. If you were to compute $L^{-1}$ and $U^{-1}$, those operations each require $\frac 1 3n^3$ ...

1

PETSC might be a good option. Not super user friendly, but its good with lots of options.

Only top voted, non community-wiki answers of a minimum length are eligible