~ubuntu-branches/ubuntu/utopic/psicode/utopic

« back to all changes in this revision

Viewing changes to .pc/08_525758_ftbfs_with_gcc44.patch/src/bin/mcscf/sblock_matrix.cc

  • Committer: Package Import Robot
  • Author(s): Michael Banck
  • Date: 2012-03-29 01:26:55 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120329012655-8lnngrup9p40ow4z
Tags: 3.4.0-3
* debian/control: Add CC3, MRCCSD and SCS-MP2 energies, RHF hessian and
  closed-shell MP2 gradient to features, clarify that MP2-R12 is an
  explicitly correlated method.
* debian/patches/09_system_libint.dpatch: New patch, modifies the build
  system to use the system libint and not compile and link in the shipped
  libint codes.
* debian/control (Build-Depends): Added libint-dev.
* debian/rules (DEB_MAKE_CHECK_TARGET): Run quicktests target to invoke the
  test suite.
* debian/rules: Rewritten for dh.
* debian/control (Build-Depends): Bumped debhelper version to 8, removed
  cdbs and dpatch.
* debian/patches: Moved to source version 3.0 (quilt).
* debian/source/format: New file.
* debian/rules (override_dh_auto_install): Install some test suite input
  files as examples.
* debian/dirs: Added examples directory.
* debian/TODO: Updated.
* debian/control (Standards-Version): Bumped to 3.9.3.
* debian/rules (override_dh_auto_test): Do not abort build on test suite
  failure.
* debian/rules (override_dh_auto_build): New rule, build the user manual in
  addition to the main code.
* debian/control (Build-Depends): Added texlive-latex-recommended.
* debian/patches/10_makerules_doc.patch: New patch, build the postscript
  file by default and deletes some more generated files on realclean.
* debian/rules (override_dh_auto_install): Install postscript user manual
  into documentation directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <cstdlib>
 
2
#include <psifiles.h>
 
3
#include "sblock_matrix.h"
 
4
 
 
5
namespace psi{ namespace mcscf{
 
6
 
 
7
SBlockMatrix::SBlockMatrix()
 
8
 : block_matrix_(0)
 
9
{
 
10
}
 
11
 
 
12
SBlockMatrix::SBlockMatrix(std::string label, int nirreps, size_t*& rows_size, size_t*& cols_size)
 
13
 : block_matrix_(0)
 
14
{
 
15
  block_matrix_ = new BlockMatrix(label,nirreps,rows_size,cols_size);
 
16
  block_matrix_->add_reference();
 
17
}
 
18
 
 
19
SBlockMatrix::SBlockMatrix(std::string label, int nirreps, int*& rows_size, int*& cols_size)
 
20
 : block_matrix_(0)
 
21
{
 
22
  block_matrix_ = new BlockMatrix(label,nirreps,rows_size,cols_size);
 
23
  block_matrix_->add_reference();
 
24
}
 
25
 
 
26
SBlockMatrix::SBlockMatrix(BlockMatrix* block_matrix)
 
27
 : block_matrix_(block_matrix)
 
28
{
 
29
  block_matrix_->add_reference();
 
30
}
 
31
 
 
32
SBlockMatrix::SBlockMatrix(SBlockMatrix& src)
 
33
{
 
34
  block_matrix_ = src.block_matrix_;
 
35
  block_matrix_->add_reference();
 
36
}
 
37
 
 
38
void SBlockMatrix::allocate(std::string label, int nirreps, size_t*& rows_size, size_t*& cols_size) 
 
39
{
 
40
  block_matrix_ = new BlockMatrix(label,nirreps,rows_size,cols_size);
 
41
  block_matrix_->add_reference();
 
42
}
 
43
 
 
44
void SBlockMatrix::allocate(std::string label, int nirreps, int*& rows_size, int*& cols_size) 
 
45
{
 
46
  block_matrix_ = new BlockMatrix(label,nirreps,rows_size,cols_size);
 
47
  block_matrix_->add_reference();
 
48
}
 
49
 
 
50
SBlockMatrix& SBlockMatrix::operator+= (SBlockMatrix& src)
 
51
{
 
52
  check("operator+=");  src.check("operator+=");
 
53
  *(block_matrix_) += *(src.block_matrix_);
 
54
  return *this;
 
55
}
 
56
 
 
57
SBlockMatrix& SBlockMatrix::operator= (SBlockMatrix& src)
 
58
{
 
59
  check("operator=");  src.check("operator=");
 
60
  *(block_matrix_) = *(src.block_matrix_);
 
61
  // Make sure we don't copy ourself!
 
62
/*  if (block_matrix_ == src.block_matrix_) return *this;
 
63
 
 
64
  block_matrix_->subtract_reference();  // Remove reference from existing object
 
65
  block_matrix_ = src.block_matrix_;
 
66
  block_matrix_->add_reference();       // Add reference to our new object
 
67
*/
 
68
  return *this;
 
69
}
 
70
 
 
71
// void SBlockMatrix::copy(SBlockMatrix& src)
 
72
// {
 
73
//   block_matrix_->subtract_reference();
 
74
//   block_matrix_ = new BlockMatrix();
 
75
//   *block_matrix_ = *src.block_matrix_;
 
76
//   block_matrix_->add_reference();       // Add reference to our new object
 
77
// }
 
78
 
 
79
void SBlockMatrix::multiply(bool transpose_A, bool transpose_B, SBlockMatrix& A, SBlockMatrix& B)
 
80
{
 
81
  check("multiply");  A.check("multiply");  B.check("multiply");
 
82
  block_matrix_->multiply(transpose_A,transpose_B,A.getBlockMatrix(),B.getBlockMatrix());
 
83
}
 
84
 
 
85
void SBlockMatrix::diagonalize(SBlockMatrix& eigenmatrix,SBlockVector& eigenvalues)
 
86
{
 
87
  check("diagonalize"); eigenmatrix.check("diagonalize");  eigenvalues.check("multiply");
 
88
  block_matrix_->diagonalize(eigenmatrix.getBlockMatrix(),eigenvalues.getBlockVector());
 
89
}
 
90
 
 
91
double dot(SBlockMatrix& A,SBlockMatrix& B)
 
92
{
 
93
  A.check("dot");  B.check("dot");
 
94
  return( dot(A.getBlockMatrix(),B.getBlockMatrix()) );
 
95
}
 
96
 
 
97
void SBlockMatrix::check(const char* cstr)
 
98
{
 
99
  if(!is_allocated()){
 
100
    fprintf(outfile,"\n\n  Error: SBlockMatrix operation '%s' is using an uninitialized matrix",cstr);
 
101
    fflush(outfile);
 
102
    exit(PSI_RETURN_FAILURE);
 
103
  }
 
104
}
 
105
 
 
106
}}
 
 
b'\\ No newline at end of file'