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

« back to all changes in this revision

Viewing changes to src/lib/libchkpt/irr_labs.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
char **Chkpt::rd_irr_labs(void)
 
18
{
 
19
  int i,nirreps;
 
20
  char **irr_labs;
 
21
  psio_address ptr;
 
22
  char *keyword;
 
23
  keyword = build_keyword("Irrep labels");
 
24
 
 
25
  nirreps = rd_nirreps();
 
26
 
 
27
  ptr = PSIO_ZERO;
 
28
  irr_labs = (char **)malloc(sizeof(char *)*nirreps);
 
29
  for(i=0;i<nirreps;i++) {
 
30
    irr_labs[i] = (char *) malloc(4*sizeof(char));
 
31
    psio->read(PSIF_CHKPT, keyword, (char *) irr_labs[i],  
 
32
      4*sizeof(char), ptr, &ptr);
 
33
      irr_labs[i][3] = '\0';
 
34
    }
 
35
 
 
36
  free(keyword);
 
37
  return irr_labs;
 
38
}
 
39
 
 
40
void Chkpt::wt_irr_labs(char **irr_labs)
 
41
{
 
42
  int i,nirreps;
 
43
  psio_address ptr;
 
44
  char *keyword;
 
45
  keyword = build_keyword("Irrep labels");
 
46
 
 
47
  nirreps = rd_nirreps();
 
48
 
 
49
  ptr = PSIO_ZERO;
 
50
  for(i=0;i<nirreps;i++) {
 
51
    psio->write(PSIF_CHKPT, keyword, (char *) irr_labs[i], 
 
52
      4*sizeof(char), ptr, &ptr);
 
53
  }
 
54
 
 
55
  free(keyword);
 
56
}
 
57
 
 
58
extern "C" {
 
59
/*!
 
60
** chkpt_rd_irr_labs(): Read in the symmetry labels for all irreps in the 
 
61
**   point group in which the molecule is considered.
 
62
**
 
63
**   takes no arguments.
 
64
**
 
65
**   returns: irr_labs =  an array of labels (strings) which denote
 
66
**      the irreps for the point group  in which the molecule is considered,
 
67
**      _regardless_ of whether there exist any symmetry orbitals which 
 
68
**      transform as that irrep.  
 
69
** \ingroup CHKPT
 
70
*/
 
71
        char **chkpt_rd_irr_labs(void)
 
72
        {
 
73
                return _default_chkpt_lib_->rd_irr_labs();
 
74
        }
 
75
 
 
76
/*!
 
77
** chkpt_wt_irr_labs(): Write out the symmetry labels for all irreps in the 
 
78
**   point group in which the molecule is considered.
 
79
**
 
80
**  arguments: 
 
81
**  \param irr_labs = an array of labels (strings) which denote
 
82
**      the irreps for the point group  in which the molecule is considered,
 
83
**      _regardless_ of whether there exist any symmetry orbitals which 
 
84
**      transform as that irrep.  
 
85
** \ingroup CHKPT
 
86
*/
 
87
        void chkpt_wt_irr_labs(char **irr_labs)
 
88
        {
 
89
                _default_chkpt_lib_->wt_irr_labs(irr_labs);
 
90
        }
 
91
}
 
92