~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libqt/dirprd_block.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file dirprd_block.c
 
3
  \ingroup (QT)
 
4
*/
 
5
 
 
6
/*!
 
7
 
 
8
  dirprd_block()
 
9
 
 
10
  This function takes two block matrices A and B and multiplies
 
11
  each element of B by the corresponding element of A
 
12
 
 
13
  \param **A: block matrix A
 
14
  \param **B: block matrix B 
 
15
  \param nrows: number of rows of A and B
 
16
  \param ncols: number of columns of A and B
 
17
 
 
18
  \ingroup (QT)
 
19
*/
 
20
void dirprd_block(double **A, double **B, int rows, int cols)
 
21
{
 
22
  register long int i;
 
23
  double *a, *b;
 
24
  long size;
 
25
 
 
26
  size = ((long) rows) * ((long) cols);
 
27
 
 
28
  if(!size) return;
 
29
 
 
30
  a = A[0]; b= B[0];
 
31
 
 
32
  for(i=0; i < size; i++, a++, b++) (*b) = (*a) * (*b);
 
33
}