~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/usotao.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 CHKPT
 
4
*/
 
5
 
 
6
#include <cstdio>
 
7
#include <cstdlib>
 
8
#include <psifiles.h>
 
9
#include <libpsio/psio.hpp>
 
10
extern "C" {
 
11
        #include <libchkpt/chkpt.h>
 
12
}
 
13
#include <libchkpt/chkpt.hpp>
 
14
 
 
15
using namespace psi;
 
16
 
 
17
double **Chkpt::rd_usotao(void)
 
18
{
 
19
        double **usotao;
 
20
        int num_ao, num_so, i;
 
21
        psio_address ptr;
 
22
        char *keyword;
 
23
        keyword = build_keyword("SO->AO transmat");
 
24
 
 
25
        num_ao = rd_nao();
 
26
        num_so = rd_nso();
 
27
 
 
28
        usotao = matrix<double>(num_so,num_ao);
 
29
        ptr = PSIO_ZERO;
 
30
 
 
31
        for(i=0;i<num_so;i++)
 
32
                psio->read(PSIF_CHKPT, keyword, (char *) usotao[i], (int) num_ao*sizeof(double), ptr, &ptr);
 
33
 
 
34
        free(keyword);
 
35
        return usotao;
 
36
}
 
37
 
 
38
void Chkpt::wt_usotao(double **usotao)
 
39
{
 
40
        int num_ao, num_so, i;
 
41
        psio_address ptr;
 
42
        char *keyword;
 
43
        keyword = build_keyword("SO->AO transmat");
 
44
 
 
45
        num_ao = rd_nao();
 
46
        num_so = rd_nso();
 
47
 
 
48
        ptr = PSIO_ZERO;
 
49
        for(i=0;i<num_so;i++)
 
50
                psio->write(PSIF_CHKPT, keyword, (char *) usotao[i], (int) num_ao*sizeof(double), ptr, &ptr);
 
51
 
 
52
        free(keyword);
 
53
}
 
54
 
 
55
extern "C" {
 
56
/*!
 
57
** chkpt_rd_usotao(): Read in the SO to AO transformation matrix 
 
58
**
 
59
** takes no arguments.
 
60
**
 
61
** returns: usotao = A num_so by num_ao matrix of doubles
 
62
** 
 
63
** \ingroup CHKPT
 
64
*/
 
65
        double **chkpt_rd_usotao(void)
 
66
        {
 
67
                return _default_chkpt_lib_->rd_usotao();
 
68
        }
 
69
 
 
70
/*!
 
71
** chkpt_wt_usotao(): Writes out the SO to AO transformation matrix 
 
72
**
 
73
** \param usotao = A num_so by num_ao matrix of doubles
 
74
**
 
75
** returns: none
 
76
**
 
77
** \ingroup CHKPT
 
78
*/
 
79
        void chkpt_wt_usotao(double **usotao)
 
80
        {
 
81
                _default_chkpt_lib_->wt_usotao(usotao);
 
82
        }
 
83
}