LAL  7.5.0.1-89842e6

Computes the eigenvalues and eigenvectors of a matrix. More...

Detailed Description

Computes the eigenvalues and eigenvectors of a matrix.

Author
Creighton, T. D.

Usage

EigenTest [-n size | -i infile] [-o outfile] [-v] [-t] [-s] [-d debuglevel]

Description

This program computes the eigenvalues and eigenvectors of a symmetric real matrix using the routines in Module Eigen.c. The following option flags are accepted:

  • [-n] Generates a random symmetric size \(\times\)size metric. If this option is not given, -n 3 is assumed. This option (or its default) is overridden by the -i option, below.
  • [-i] Reads a matrix from an input file infile using the function LALSReadVector(). If the input file is specified as stdin, the data is read from standard input (not a file named stdin).
  • [-o] Writes the eigenvalues (and eigenvectors, if -v is specified below) to an output file outfile. If the output file is specified as stdout or stderr, the data is written to standard output or standard error (not to files named stdout or stderr). The eigenvalues are written as a single row of whitespace-separated numbers, and the eigenvectors as a square matrix where each column is the eigenvector of the corresponding eigenvalue. If this option is not specified, no output is written.
  • [-v] Specifies that eigenvectors are to be computed as well as eigenvalues.
  • [-t] Specifies that the computation is to be timed; timing information is written to stderr.
  • [-s] Specifies that the calculations are to be done to single-precision (REAL4) rather than double-precision (REAL8).
  • [-d] Sets the debug level to debuglevel. If not specified, level 0 is assumed.
Input format:
If an input file or stream is specified, it should consist of \(N\) consecutive lines of \(N\) whitespace-separated numbers, that will be parsed using LALDReadVector(), or LALSReadVector() if the -s option was given. The data block may be preceded by blank or comment lines (lines containing no parseable numbers), but once a parseable number is found, the rest should follow in a contiguous block. If the lines contain different numbers of data columns, or if there are fewer lines than columns, then an error is returned; if there are more lines than columns, then the extra lines are ignored.
Output format:
If an output file or stream is specified, the input matrix is first written as \(N\) consecutive lines of \(N\) whitespace-separated numbers. This will be followed with a blank line, then a single line of \(N\) whitespace-separated numbers representing the eigenvalues. If the -v option is specified, another blank line will be appended to the output, followed by \(N\) lines of \(N\) columns specifying the eigenvectors: the column under each eigenvalue is the corresponding eigenvector.

Definition in file EigenTest.c.

Go to the source code of this file.

Macros

Error Codes
#define EIGENTESTC_ENORM   0
 Normal exit. More...
 
#define EIGENTESTC_ESUB   1
 Subroutine failed. More...
 
#define EIGENTESTC_EARG   2
 Error parsing arguments. More...
 
#define EIGENTESTC_EMEM   3
 Out of memory. More...
 
#define EIGENTESTC_EFILE   4
 Could not open file. More...
 
#define EIGENTESTC_EFMT   5
 Bad input file format. More...
 

Macro Definition Documentation

◆ EIGENTESTC_ENORM

#define EIGENTESTC_ENORM   0

Normal exit.

Definition at line 93 of file EigenTest.c.

◆ EIGENTESTC_ESUB

#define EIGENTESTC_ESUB   1

Subroutine failed.

Definition at line 94 of file EigenTest.c.

◆ EIGENTESTC_EARG

#define EIGENTESTC_EARG   2

Error parsing arguments.

Definition at line 95 of file EigenTest.c.

◆ EIGENTESTC_EMEM

#define EIGENTESTC_EMEM   3

Out of memory.

Definition at line 96 of file EigenTest.c.

◆ EIGENTESTC_EFILE

#define EIGENTESTC_EFILE   4

Could not open file.

Definition at line 97 of file EigenTest.c.

◆ EIGENTESTC_EFMT

#define EIGENTESTC_EFMT   5

Bad input file format.

Definition at line 98 of file EigenTest.c.