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

« back to all changes in this revision

Viewing changes to src/lib/libiwl/rdtwo.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file rdtwo.c
 
3
  \ingroup (IWL)
 
4
*/
 
5
#include <stdio.h>
 
6
#include <math.h>
 
7
#include <libciomr/libciomr.h>
 
8
#include "iwl.h"
 
9
 
 
10
#define MIN0(a,b) (((a)<(b)) ? (a) : (b))
 
11
#define MAX0(a,b) (((a)>(b)) ? (a) : (b))
 
12
 
 
13
/*!
 
14
** iwl_rdtwo(): read two electron ints from the given file.
 
15
** The "iwl" stands for "integrals with labels," and this is the proposed
 
16
** new standard for storing two-electron integrals and their (absolute)
 
17
** orbital labels.
 
18
**
 
19
**    \param itap     = unit to read from
 
20
**    \param ints     = two electron integrals (already allocated)
 
21
**    \param ioff     = the old ioff array for lexical ordering
 
22
**    \param norbs    = number of orbitals
 
23
**    \param nfzc     = number of frozen core orbitals
 
24
**    \param nfzv     = number of frozen virtual orbitals
 
25
**    \param printflg = print integrals as they're read 
 
26
**    \param outfile  = output file pointer
 
27
**
 
28
** David Sherrill, 1995
 
29
** \ingroup (IWL)
 
30
*/
 
31
void iwl_rdtwo(int itap, double *ints, int *ioff, int norbs, 
 
32
      int nfzc, int nfzv, int printflg, FILE *outfile)
 
33
{
 
34
  struct iwlbuf Buf;
 
35
  
 
36
  iwl_buf_init(&Buf, itap, 0.0, 1, 1);
 
37
  if ((nfzc == 0) && (nfzv == 0))
 
38
    iwl_buf_rd_all(&Buf, ints, ioff, ioff, 0, ioff, printflg, outfile);
 
39
  else
 
40
    iwl_buf_rd_all_act(&Buf, ints, ioff, ioff, 0, ioff, nfzc, norbs-nfzv-1,
 
41
                       printflg, outfile);
 
42
  iwl_buf_close(&Buf, 1);
 
43
}
 
44
 
 
45