bugGNU Octave - Bugs: bug #67740, ordschur - new forms of 3rd...

 
 

bug #67740: ordschur - new forms of 3rd argument

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Wed 26 Nov 2025 08:52:21 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Patch Submitted Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  11.1.0 (current default) Planned Release:  11.1.0 (current default)
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Jump to the original submission

Mon 01 Dec 2025 01:50:04 PM UTC, comment #6: 

Thank you for the new patch, that builds w/o a hitch.

I'll do some testing the coming days.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 30 Nov 2025 09:26:39 PM UTC, comment #5: 

Thanks for the feedback.

I removed the proprietary references and restored the original line wraps.

maybe this can make into octave 12 . (I plan to continue contributing here)

Btw my docs build was successful after adding appropriate spaces (not sure if it helped)

please find the updated patch attached



(file #57882)

jayant <jayant>
Sun 30 Nov 2025 02:19:37 PM UTC, comment #4: 

Oh and reading a bit better, we do not want direct references to, or mentioning the name of, the proprietary competition.
m.
You also removed some line breaks that should have been retained to keep lines within 80 chars length,

BTW just rebuilding to see if Texinfo errros will go away. I didn´t spot anything in your patch that might provoke them.

EDIT: no luck, still texinfo errors.
Maybe due to a GIT diff rather than a Mercurual cset ?

Philip Nienhuis <philipnienhuis>
Group Member
Sun 30 Nov 2025 01:48:11 PM UTC, comment #3: 

While building docs, I get:

:
linalg.texi:1954: @ref reference to nonexistent node `XREFordschur' (possibly involving @xseealso)
linalg.texi:2086: @ref reference to nonexistent node `XREFordschur' (possibly involving @xseealso)
linalg.texi:2108: @ref reference to nonexistent node `XREFordschur' (possibly involving @xseealso)
make[2]: *** [Makefile:32706: ../dev_p/doc/interpreter/octave.info] Error 1
make[2]: *** Waiting for unfinished jobs....


Philip Nienhuis <philipnienhuis>
Group Member
Sun 30 Nov 2025 01:26:15 PM UTC, comment #2: 

Thanks for this patch!  I'll try to build and run a few checks with it, probably a few tests I can scrape from the web.

I'm afraid it won't make it into Octave 11 anyway, as the code freeze is tomorrow and core devs are very busy.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 29 Nov 2025 11:18:44 PM UTC, comment #1: 

I have implemented the additional selector forms for the third argument of ordschur and attached a patch.

Summary of changes

-Third argument (select) now accepts:
-integer vector (existing behavior),
-logical vector (mask selecting eigenvalues),
-keyword string: "lhp", "rhp", "udi", "udo".

Keyword selector behavior (Matlab-compatible):

"lhp": real part < 0
"rhp": real part ≥ 0
"udi": |eigenvalue| < 1
"udo": |eigenvalue| ≥ 1

Eigenvalues are extracted directly from the Schur factor S in C++:

Complex Schur: from the diagonal.
Real Schur: the code walks the quasi-triangular form:

1×1 blocks → real eigenvalues
2×2 blocks → complex conjugate pairs (real part from trace, magnitude from determinant)

No call to ordeig is used, so ordschur remains self-contained.

For "udi" / "udo", a tolerance is applied:

10 * eps(double) for double precision,
10 * eps(single) for single precision.

Documentation has been updated to describe logical selectors and keyword forms.

Tests

New BISTs cover:

-logical vs numeric selector equivalence,
-each keyword vs an explicit logical mask,
-2×2 real Schur block (complex pair case),
-edge cases: 1×1 input and all-zero selection,
-error cases: invalid keyword and selector size mismatch.

All tests pass with test ordschur.

(file #57878)

jayant <jayant>
Wed 26 Nov 2025 08:52:21 PM UTC, original submission:  

Octave's ordschur function currently accepts as 3rd argument a vector of indices for reshuffling eigenvalue positions.

In the past years TMW has added two more forms for that 3rd argument, to wit:

  • a keyword, either 'lhp', 'rhp', 'udi' or 'udo'
  • a cluster selector, length equal to the size of input matrix U and composed of logical values.


Requesting to also implement these forms in Octave's ordschur function.

Philip Nienhuis <philipnienhuis>
Group Member

 

Attached Files

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by jayant (Updated the item)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-12-01 philipnienhuis Carbon-Copy- Added dasergatskov
    2025-12-01 philipnienhuis StatusNone Patch Submitted
    2025-11-30 jayant Attached File- Added 0001-libinterp-corefcn-fix-ordschur-selector-forms-bug-67.patch, #57882
    2025-11-29 jayant Attached File- Added 0001-libinterp-corefcn-fix-ordschur-selector-forms-bug-67.patch, #57878
    2025-11-26 philipnienhuis Originator NamePhilpi Nienhuis Philip Nienhuis

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code