Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dhgeqz and Dlapy3 #1897

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add Dhgeqz and Dlapy3 #1897

wants to merge 3 commits into from

Conversation

soypat
Copy link
Contributor

@soypat soypat commented Sep 7, 2023

Part of #1651.

Dhgeqz's eigenvalues do not seem to be a solution for the GNEP using input or resulting H and T matrices as far as I can tell. I'm guessing I need direct input from Dggbal? I've run comparisons of eigenvalues with reference and I'm getting identical up to tol=1e-14 results.

This is how I tried to test the solution no GNEP:

        // Compute right and left hand sides of
	//   H*x = lambda*T*x
	// Where lambda are the eigenvalues computed by Dhgeqz.
	lhs := blas64.Vector{N: n, Data: make([]float64, n), Inc: 1}
	rhs := blas64.Vector{N: n, Data: make([]float64, n), Inc: 1}
	x := blas64.Vector{
		N:    n,
		Data: randomSlice(n, rnd),
		Inc:  1,
	}
	blas64.Gemv(blas.NoTrans, 1, hCopy, x, 0, lhs)
	for i := 0; i < n; i++ {
		if alphar[i] == 0 && alphai[i] == 0 && beta[i] == 0 {
			continue // singular EV.
		}
		lambdar := alphar[i]
		lambdai := alphai[i]
		if beta[i] != 0 {
			lambdai /= beta[i]
			lambdar /= beta[i]
		}
		if lambdai != 0 {
			continue // Imag EV.
		}

		blas64.Gemv(blas.NoTrans, lambdar, tCopy, x, 0, rhs)
		if !floats.EqualApprox(lhs.Data, rhs.Data, tol) {
			t.Error("H*x != lambda*T*x", i, complex(lambdar, 0), lhs.Data, rhs.Data)
		}
       }

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Patch coverage: 78.48% and project coverage change: +0.01% 🎉

Comparison is base (93223b4) 74.00% compared to head (494271a) 74.02%.
Report is 12 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1897      +/-   ##
==========================================
+ Coverage   74.00%   74.02%   +0.01%     
==========================================
  Files         526      530       +4     
  Lines       63210    63850     +640     
==========================================
+ Hits        46778    47263     +485     
- Misses      13854    13995     +141     
- Partials     2578     2592      +14     
Files Changed Coverage Δ
lapack/gonum/dhgeqz.go 78.44% <78.44%> (ø)
lapack/gonum/dlapy3.go 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

@soypat soypat mentioned this pull request Mar 24, 2024
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants