# bug #66049: add cluster ordering to ordqz

 Submitter: Anders Helmersson Submitted: Wed 31 Jul 2024 03:07:59 PM UTC Category: Octave Function Severity: 3 - Normal Priority: 5 - Normal Item Group: Feature Request Status: None Assigned to: None Originator Name: Anders Helmersson Open/Closed:  * Open Release:  * stable Operating System:  * Any Fixed Release: None Planned Release: None
* Mandatory Fields

Add a New Comment Rich Markup

## Discussion

Wed 31 Jul 2024 03:07:59 PM UTC, original submission:

The function "ordqz" can be called with a logical select vector to order the the corresponding eigenvalues up front, in the example below it moves the 1st, 4th and 5th eigenvalue to the left.

>> select = [1 0 0 1 1 0];
>> [ar, br, qr, zr] = ordqz (aa, bb, q, z, select)

In Matlab, it is possible to order the eigenvalues in clusters. For instance, in the example below, it moves the 1st, 4th and 5th eigenvalue to the left followed by the 6th eigenvalue and then the remaining ones.

>> cluster = [1 3 3 1 1 2];
>> [ar, br, qr, zr] = ordqz (aa, bb, q, z, cluster)

It seems possible to achieve this by calling ordqz several times using appropriate logical select vectors, but this assumes that unaffected eigenvalues are not moved during the call. However, this is not documented, so it cannot be relied upon.

>> [ar, br, qr, zr] = ordqz (aa, bb, q, z, [1 0 0 1 1 0])
>> [arr, brr, qrr, zrr] = ordqz (ar, br, qr, zr, [1 1 1 0 0 1])

Using the proposed cluster feature, would make it possible to group eigenvalues in a flexible way.

## Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
•