~ubuntu-branches/ubuntu/trusty/psicode/trusty

« back to all changes in this revision

Viewing changes to src/lib/libqt/dot_block.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
  \brief Take dot product of two block matrices
 
4
  \ingroup QT
 
5
*/
 
6
 
 
7
extern "C" {
 
8
        
 
9
/*!
 
10
** dot_block(): Find dot product of two block matrices
 
11
**
 
12
** \param A     = block matrix A
 
13
** \param B     = block matrix B 
 
14
** \param nrows = number of rows of A and B
 
15
** \param ncols = number of columns of A and B
 
16
** \param alpha = scale factor by which the dot product is multiplied
 
17
**
 
18
** Returns: dot product
 
19
** \ingroup QT
 
20
*/
 
21
double dot_block(double **A, double **B, int rows, int cols, double alpha)
 
22
{
 
23
  register long int i;
 
24
  double *a, *b;
 
25
  double value;
 
26
  long int size;
 
27
 
 
28
  size = ((long) rows) * ((long) cols);
 
29
 
 
30
  if(!size) return 0.0;
 
31
 
 
32
  a = A[0]; b = B[0];
 
33
 
 
34
  value = 0.0;
 
35
  for(i=0; i < size; i++,a++,b++) value += (*a) * (*b);
 
36
 
 
37
  return alpha*value;
 
38
}
 
39
 
 
40
} /* extern "C" */