Eigen(3) NYH Eigen(3)
Version 1.0
NAME
Eigen - Package for finding the largest eigenvalues of a real
symmetric matrix and corresponding eigenvectors
SYNOPSIS
#include <eigen.h>
extern int smoothing;
matrix matrixalloc(size)
int size;
void matrixfree(m,size)
int size;
matrix rectalloc(rows,cols)
int rows, cols;
vector vectoralloc(size)
int size;
void vectorfree(v)
vector v;
void eigen(m, s, vals, vecs, n)
matrix m;
int s;
matrix vecs;
vector vals;
int n;
DESCRIPTION
This is the manual for the C language implementation of the algorithm
to find the largest eigenvalues of a real symmetric matrix and
corresponding eigenvectors described in Nadav Harel's report "Finding
the largest eigenvalues of a real symmetric matrix, and corresponding
eigenvectors". This manual only serves as an explanation for the C
language implementation of the algorithm, and it is assumed that you
have read the report for the mathematical discussion.
The main routine defined in this package is eigen. To define the
symmetric matrix m whose eigenvalues and eigenvectors are to be found,
first allocate a matrix of the wanted size with the matrixalloc
function. Next, assign the matrix the wanted values. Notice that the
matrix m should be treated like a two dimensional array: m[i][j] is
the value in the i'th row and j'th column of the matrix (where i and j
are between 0 and size-1). Note that only values where j<=i should be
defined, since only that half of the symmetric matrix is looked at.
The parameter s of eigen is the size of the matrix m, and the
parameter n is the number of wanted eigenvalues. Next you should
allocate a vector vals of length n using vectoralloc, in which the
- 1 - Formatted: December 22, 2025
Eigen(3) NYH Eigen(3)
Version 1.0
eigenvalues are returned. Also, using rectalloc(n,s), allocate a
rectangular matrix vecs in which the eigenvectors will be put (e.g.,
vecs[0] is the vector corresponding to vals[0] which is the biggest
eigenvalue).
To free unused matrices and vectors, use the freeing functions listed
above. Note that the size given to matrixalloc must be again given to
matrixfree. Failing to do that, or giving a wrong number may have
fatal results. To free a rectangular matrix, just use matrixfree,
with the number of rows as the parameter.
Note that after eigen returns, the matrix given in m will be
overwritten, so m should be freed after eigen returns, so save memory.
To choose between the smoothing methods (see report for more
explanation), set smoothing to POWERSMOOTH or ADAPTIVESMOOTH, which
are defined in eigen.h. If ,I smoothing is not set, then the default
is ADAPTIVESMOOTH.
COPYRIGHT
Copyright (C) 1992 by Nadav Har'El,
E-mail: nyh@gauss.technion.ac.il
All Rights Reserved
- 2 - Formatted: December 22, 2025