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

« back to all changes in this revision

Viewing changes to src/lib/libiwl/rdone.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
  \ingroup IWL
 
4
*/
 
5
#include <cstdio>
 
6
#include <cmath>
 
7
#include <libpsio/psio.h>
 
8
#include <libciomr/libciomr.h>
 
9
#include "iwl.h"
 
10
#include "iwl.hpp"
 
11
 
 
12
using namespace psi;
 
13
  
 
14
void IWL::read_one(PSIO *psio, int itap, const char *label, double *ints, 
 
15
    int ntri, int erase, int printflg, FILE *outfile)  
 
16
{
 
17
    int nmo;
 
18
 
 
19
    psio->open(itap, PSIO_OPEN_OLD);
 
20
    psio->read_entry(itap, label, (char *) ints, ntri*sizeof(double));
 
21
    psio->close(itap, !erase);
 
22
 
 
23
    if (printflg) {
 
24
        nmo = (sqrt((double) (1 + 8 * ntri)) - 1)/2;
 
25
        print_array(ints, nmo, outfile);
 
26
    }
 
27
}
 
28
 
 
29
extern "C" {
 
30
        
 
31
/*!
 
32
** IWL_RDONE()
 
33
**
 
34
** This function reads the one-electron integrals in the MO basis
 
35
**  from disk and stores them in core.  Substantially revised on
 
36
**  29 April 1998 to filter out frozen orbitals if requested.
 
37
**  This change requires a very different argument list from the 
 
38
**  previous version of this code.
 
39
**
 
40
** David Sherrill, January 1994
 
41
** Revised by David Sherrill, April 1998
 
42
** Revised by TDC, June 2001
 
43
**
 
44
**   \param itap       = tape to read ints from
 
45
**   \param label      = the PSIO label
 
46
**   \param ints       = buffer (already allocated) to store the integrals
 
47
**   \param ntri       = number of packed integrals
 
48
**   \param erase      = erase itap (1=yes, 0=no)
 
49
**   \param printflg   = printing flag.  Set to 1 to print ints; 
 
50
**                       otherwise, set to 0
 
51
**   \param outfile    = file pointer for output of ints or error messages
 
52
** \ingroup IWL
 
53
*/
 
54
int iwl_rdone(int itap, const char *label, double *ints, int ntri, int erase, 
 
55
              int printflg, FILE *outfile)
 
56
{
 
57
 
 
58
  int nmo;
 
59
 
 
60
  psio_open(itap, PSIO_OPEN_OLD);
 
61
  psio_read_entry(itap, label, (char *) ints, ntri*sizeof(double));
 
62
  psio_close(itap, !erase);
 
63
 
 
64
  if (printflg) {
 
65
    nmo = (sqrt((double) (1 + 8 * ntri)) - 1)/2;
 
66
    print_array(ints, nmo, outfile);
 
67
  }
 
68
 
 
69
  return(1);
 
70
}
 
71
 
 
72
} /* extern "C" */