Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
matrix_eigen.cpp File Reference

Eigen analysis. More...

#include "matrix_eigen.h"
#include "utilities.h"

Go to the source code of this file.

Functions

int rotate (int n, double *a, double s, double tau, int i, int j, int k, int l)
 
int jacobian_rotation (int n, double *a, double *d, double *v)
 Computes all eigenvalues and eigenvectors of a real symmetric matrix. More...
 
void eigen_sort (int n, double *d, double *v)
 Sorts eigenvalues into descending order and rearranges matrix columns accordingly. More...
 
Vector3< float > principal_axes (Vector3< float > avg, Vector3< float > avg2, Vector3< float > avgx, Vector3< float > *eigenvec)
 Calculates the principal axes of 3D coordinates. More...
 

Variables

int verbose
 

Detailed Description

Eigen analysis.

Author
Achilleas Frangakis and Bernard Heymann
Date
Created: 20020803
Modified: 20110810 (BH)

Definition in file matrix_eigen.cpp.

Function Documentation

void eigen_sort ( int  n,
double *  d,
double *  v 
)

Sorts eigenvalues into descending order and rearranges matrix columns accordingly.

This method uses straight insertion. Reference: Press W.H. et al (1992) Numerical Recipes in C.

Parameters
intn number of eigenvalues = size of matrix.
double*d eigenvalues.
double*v eigenvectors in columns.
Returns
int 0.

Definition at line 149 of file matrix_eigen.cpp.

int jacobian_rotation ( int  n,
double *  a,
double *  d,
double *  v 
)

Computes all eigenvalues and eigenvectors of a real symmetric matrix.

The superdiagonal elements of the input matrix is modified. Reference: Press W.H. et al (1992) Numerical Recipes in C.

Parameters
intn size of matrix: n x n.
double*a real symmetric matrix.
double*d eigenvalues.
double*v eigenvectors in columns.
Returns
int number of rotations needed to achieve convergence, <0 on error.

Definition at line 40 of file matrix_eigen.cpp.

Vector3<float> principal_axes ( Vector3< float >  avg,
Vector3< float >  avg2,
Vector3< float >  avgx,
Vector3< float > *  eigenvec 
)

Calculates the principal axes of 3D coordinates.

Reference: Press W.H. et al (1992) Numerical Recipes in C.

Parameters
Vector3<float>avg average of vectors.
Vector3<float>avg2 average of squared vectors.
Vector3<float>avgx average of cross products {xy, xz, yz}.
Vector3<float>*eigenvec 3 return eigen vectors (can be NULL).
Returns
Vector3<float> principal axes.

Definition at line 182 of file matrix_eigen.cpp.

int rotate ( int  n,
double *  a,
double  s,
double  tau,
int  i,
int  j,
int  k,
int  l 
)

Definition at line 15 of file matrix_eigen.cpp.

Variable Documentation

int verbose