~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libciomr/eigout.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file
 
3
  \brief Print eigenvectors and eigenvalues
 
4
  \ingroup CIOMR
 
5
*/
 
6
 
 
7
#include <cstdio>
 
8
 
 
9
extern "C" {
 
10
 
 
11
/*!
 
12
** eigout(): Print out eigenvectors and eigenvalues.  
 
13
**
 
14
** Prints an n x m matrix of eigenvectors.  Under each eigenvector, 
 
15
** the corresponding elements of two arrays, b and c, will also be printed.  
 
16
** This is useful for printing, for example, the SCF eigenvectors with 
 
17
** their associated eigenvalues (orbital energies) and also the population.
 
18
**
 
19
** \param a    = matrix of eigenvectors (eigenvectors are columns)
 
20
** \param b    = first array to print under eigenvectors (e.g., eigenvalues)
 
21
** \param c    = second array to print under eigenvectors (e.g., populations)
 
22
** \param m    = number of rows in matrix a
 
23
** \param n    = number of columns in matrix a (and length of b and c)
 
24
** \param out = file pointer for output
 
25
**
 
26
** Returns: none
 
27
**
 
28
** \ingroup CIOMR
 
29
*/
 
30
void eigout(double **a, double *b, double *c, int m, int n, FILE *out)
 
31
   {
 
32
      int ii,jj,kk,nn;
 
33
      int i,j;
 
34
 
 
35
      ii=0;jj=0;
 
36
L200:
 
37
      ii++;
 
38
      jj++;
 
39
      kk=10*jj;
 
40
      nn=n;
 
41
      if (nn > kk) nn=kk;
 
42
      fprintf (out,"\n");
 
43
      for (i=ii; i <= nn; i++) fprintf(out,"       %5d",i);
 
44
      fprintf (out,"\n");
 
45
      for (i=0; i < m; i++) {
 
46
         fprintf (out,"\n%5d",i+1);
 
47
         for (j=ii-1; j < nn; j++) {
 
48
            fprintf (out,"%12.7f",a[i][j]);
 
49
            }
 
50
         }
 
51
      fprintf (out,"\n");
 
52
      fprintf (out,"\n     ");
 
53
      for (j=ii-1; j < nn; j++) {
 
54
         fprintf(out,"%12.7f",b[j]);
 
55
         }
 
56
      fprintf (out,"\n");
 
57
      fprintf (out,"\n     ");
 
58
      for (j=ii-1; j < nn; j++) {
 
59
         fprintf(out,"%12.7f",c[j]);
 
60
         }
 
61
      fprintf (out,"\n");
 
62
      if (n <= kk) {
 
63
         fflush(out);
 
64
         return;
 
65
         }
 
66
      ii=kk; goto L200;
 
67
      }
 
68
 
 
69
} /* extern "C" */