~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/bin/detci/form_ov.c

  • 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
 
** FORM_OV.C
3
 
**
4
 
** Form the OV arrays of Bendazzoli and Evangelisti, JCP 98, 3141 (1993)
5
 
**
6
 
** David Sherrill
7
 
** University of Georgia
8
 
** 8 April 1996
9
 
**
10
 
*/
11
 
 
12
 
#include <stdio.h>
13
 
#include <stdlib.h>
14
 
#include <libciomr/libciomr.h>
15
 
#include "structs.h"
16
 
#define EXTERN
17
 
#include "globals.h"
18
 
 
19
 
/*
20
 
** FORM_OV()
21
 
** This will only work for Full CI's right now (where Parameters.fci=true)
22
 
*/
23
 
void form_ov(struct stringwr **alplist)
24
 
{
25
 
 
26
 
   int i, j, nirreps, norbs;
27
 
   int irrep, strnum, strsym, cnt=0;
28
 
   int fullij, idx, ovcnt;
29
 
   struct stringwr *strlist;
30
 
   int signmask,nsignmask;
31
 
 
32
 
 
33
 
   /* bitwise sign stuff */
34
 
 
35
 
   signmask = 1 << (sizeof(int)*8-1);
36
 
   nsignmask = ~signmask;
37
 
 
38
 
 
39
 
   /* allocate memory for OV[list][fullij][string] */
40
 
 
41
 
   norbs = CalcInfo.num_ci_orbs;
42
 
   nirreps = AlphaG->nirreps;
43
 
   OV = (int ***) malloc (sizeof(int **) * nirreps);
44
 
   for (i=0; i<nirreps; i++) {
45
 
      OV[i] = (int **) malloc (sizeof(int *) * norbs * norbs);
46
 
      for (j=0; j<norbs*norbs; j++) {
47
 
         OV[i][j] = (int *) malloc (sizeof(int) * AlphaG->max_str_per_irrep+1);
48
 
         OV[i][j][0] = 0;
49
 
         }
50
 
      }
51
 
 
52
 
 
53
 
   /* now fill up OV by walking through the stringwr lists */
54
 
 
55
 
   for (irrep=0; irrep < nirreps; irrep++) {
56
 
      strnum = AlphaG->sg[irrep][0].num_strings;
57
 
      cnt=0;
58
 
      strlist = alplist[irrep];
59
 
      while (cnt != strnum) { 
60
 
         for (strsym=0; strsym < nirreps; strsym++) {
61
 
            for (i=0; i<strlist->cnt[strsym]; i++) {
62
 
               fullij = strlist->oij[strsym][i];
63
 
               /* idx = cnt + 1; */
64
 
               idx = cnt;
65
 
               if (strlist->sgn[strsym][i] != 1) idx = idx | signmask;
66
 
               ovcnt = OV[irrep][fullij][0];
67
 
               ovcnt++;
68
 
               OV[irrep][fullij][ovcnt] = idx;
69
 
               OV[irrep][fullij][0] = ovcnt;
70
 
               }  
71
 
            }
72
 
         strlist++;
73
 
         cnt++;
74
 
         }
75
 
      }
76
 
 
77
 
 
78
 
   /* print out the OV data */
79
 
 
80
 
   if (Parameters.print_lvl > 3) {
81
 
      for (irrep=0; irrep < nirreps; irrep++) {
82
 
         for (fullij=0; fullij<norbs*norbs; fullij++) {
83
 
            fprintf(outfile, "OV[irrep=%d][oij=%d]:  ", irrep, fullij);
84
 
            for (i=0; i<OV[irrep][fullij][0]; i++) {
85
 
               idx = OV[irrep][fullij][i+1];
86
 
               fprintf(outfile, "%c", (idx & signmask) ? '-' : '+');
87
 
               idx = idx & nsignmask;
88
 
               fprintf(outfile, "%2d ", idx);
89
 
               }
90
 
            fprintf(outfile, "\n");
91
 
            }
92
 
         }
93
 
      }
94
 
 
95
 
 
96
 
}
97
 
 
98