This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmp←{ ⍝ compare basic arrays, results in ¯1 (⍺ precedes ⍵), 0 (⍺ is identical to ⍵), or 1 (⍺ follows ⍵) | |
| ⍝ DEFINITION: | |
| ⍝ ┌ | |
| ⍝ │ ¯1 if ⍺ strictly precedes ⍵ | |
| ⍝ ⍺ cmp ⍵ = │ 0 if ⍺ exactly matches ⍵ | |
| ⍝ │ 1 if ⍺ strictly follows ⍵ | |
| ⍝ └ | |
| ⍝ AXIOMS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ∇ vv←Eigen mat;vecs;vals;code;n | |
| n←≢mat | |
| :If Real mat | |
| :If (Sym mat)∧2≠n ⍝ symmetric | |
| (vals vecs code)←Dsyev mat | |
| :Else ⍝ general | |
| (vals vecs code)←Dgeev mat | |
| :EndIf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Eigen←{⎕IO ⎕ML←1 ⍝ Eigen values⍪vectors | |
| ⍝ graeme@dyadic.com | |
| dsyev←{ ⍝ real symmetric: | |
| args←'dsyev_'assoc↓⍉↑⌽{ ⍝ associate external fn. | |
| ⍵,⊂' <T1 ' 'V'}{ ⍝ JOBZ | |
| ⍵,⊂' <T1 ' 'L'}{ ⍝ UPLO | |
| ⍵,⊂' <I4 'n}{ ⍝ N | |
| ⍵,⊂' =F8[] '(,mat)}{ ⍝ A | |
| ⍵,⊂' <I4 'n}{ ⍝ LDA | |
| ⍵,⊂' >F8[] 'n}{ ⍝ W |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sort←{⎕ML←1 ⍝ Total array ordering (TAO) comparison. | |
| acmp←{ ⍝ array comparison. | |
| ≡/⍵:¯1 ⍝ match: equal. | |
| ~≡/⍴∘⍴¨⍵:∇ xrnk ⍵ ⍝ ranks differ: reshape with 1-axes. | |
| ⊃⊃⍷/⍵:1 ⍝ prefixes precede their continuations. | |
| ⊃⊃⍷/⌽⍵:0 ⍝ continuations follow their prefixes. | |
| ~≡/⍴¨⍵:∇ xshp ⍵ ⍝ shapes differ: stretch with fills. | |
| 0=×/⍴⊃⍵:∇⊃¨⍵ ⍝ null: comparison of proto items. | |
| ~⍵≡⊃¨⍵:∇ halves,¨⍵ ⍝ non-atomic: item-wise comparison. |
NewerOlder