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

« back to all changes in this revision

Viewing changes to src/bin/mcscf/scf_S_inverse_sqrt.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
#include <cmath>
 
2
 
 
3
#include "scf.h"
 
4
 
 
5
namespace psi{ namespace mcscf{
 
6
 
 
7
void SCF::construct_S_inverse_sqrt()
 
8
{
 
9
  SBlockVector lambda("lambda",nirreps,sopi);
 
10
  SBlockMatrix L("L",nirreps,sopi,sopi);
 
11
  SBlockMatrix Lambda("Lambda",nirreps,sopi,sopi);
 
12
 
 
13
  S.diagonalize(L,lambda);
 
14
 
 
15
//   lambda->print();
 
16
//   L->print();
 
17
 
 
18
  for(int h = 0; h < nirreps; ++h){
 
19
    for(int i = 0; i < sopi[h]; ++i){
 
20
      Lambda->set(h, i, i, 1.0 / sqrt(lambda->get(h,i)) );
 
21
    }
 
22
  }
 
23
 
 
24
 
 
25
  T.multiply(false,true,Lambda,L);
 
26
  S_sqrt_inv.multiply(false,false,L,T);
 
27
 
 
28
  for(int h = 0; h < nirreps; ++h){
 
29
    for(int i = 0; i < sopi[h]; ++i){
 
30
      Lambda->set(h, i, i, sqrt(lambda->get(h,i)) );
 
31
    }
 
32
  } 
 
33
 
 
34
  T.multiply(false,true,Lambda,L);
 
35
  S_sqrt.multiply(false,false,L,T);
 
36
}
 
37
 
 
38
}} /* End Namespaces */