# lapeighvi¶

## Purpose¶

Computes selected eigenvalues and eigenvectors of a real symmetric or complex Hermitian matrix.

## Format¶

{ ve, va } = lapeighvi(x, il, iu, abstol)
Parameters: x (NxN matrix) – real symmetric or complex Hermitian. il (scalar) – index of the smallest desired eigenvalue ranking them from smallest to largest. iu (scalar) – index of the largest desired eigenvalue, iu must be greater than il. abstol (scalar) – the absolute error tolerance for the eigenvalues. An approximate eigenvalue is accepted as converged when it is determined to lie in an interval $$[a, b]$$ of width less than or equal to $$abstol + EPS*max(|a|, |b|)$$, where EPS is machine precision. If abstol is less than or equal to zero, then $$EPS*||T||$$ will be used in its place, where T is the tridiagonal matrix obtained by reducing the input matrix to tridiagonal form. ve ((iu-il+1)x1 vector) – eigenvalues. va (Nx(iu-il+1) matrix) – eigenvectors.

## Examples¶

// Assign x
x = { 5 2 1,
2 6 2,
1 2 9 };

// Index of smallest desired eigenvalue
il = 2;

// Index of largest desired eigenvalue
iu = 3;

// Compute eigenvalues with indices between
// il and iu and the corresponding eigenvectors
{ ve, va } = lapeighvi(x, il, iu, 0);
print "ve = " ve;
print "va = " va;

ve =
6.0000
10.6056

va =
-0.5774   0.3197
-0.5774   0.4908
0.5774   0.8105


## Remarks¶

lapeighvi() computes $$iu-il+1$$ eigenvalues and eigenvectors given a range of indices, i.e., the ith to jth eigenvalues, ranking them from smallest to largest. To find eigenvalues and eigenvectors within a specified range see lapeighvb(). lapeighvi() is based on the LAPACK drivers DSYEVX and ZHEEVX. Further documentation of these functions may be found in the LAPACK User’s Guide.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7259032726287842, "perplexity": 2600.987726558849}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363336.93/warc/CC-MAIN-20211207045002-20211207075002-00494.warc.gz"}