Computes the eigenvalues and eigenvectors of a matrix. More...
Computes the eigenvalues and eigenvectors of a matrix.
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. 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.-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... | |
#define EIGENTESTC_ENORM 0 |
Normal exit.
Definition at line 93 of file EigenTest.c.
#define EIGENTESTC_ESUB 1 |
Subroutine failed.
Definition at line 94 of file EigenTest.c.
#define EIGENTESTC_EARG 2 |
Error parsing arguments.
Definition at line 95 of file EigenTest.c.
#define EIGENTESTC_EMEM 3 |
Out of memory.
Definition at line 96 of file EigenTest.c.
#define EIGENTESTC_EFILE 4 |
Could not open file.
Definition at line 97 of file EigenTest.c.
#define EIGENTESTC_EFMT 5 |
Bad input file format.
Definition at line 98 of file EigenTest.c.