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

« back to all changes in this revision

Viewing changes to src/lib/libciomr/add_mat.c

  • 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 add_mat.c
3
 
** \ingroup (CIOMR)
4
 
*/
5
 
 
6
 
#include "includes.h"
7
 
 
8
 
/*!
9
 
** add_mat(): Add matrices a and b into c for n rows and m columns
10
 
**
11
 
** \ingroup (CIOMR)
12
 
*/
13
 
void add_mat(double **a, double **b, double **c, int n, int m)
14
 
   {
15
 
      register int i,j;
16
 
 
17
 
      if (n != m) {
18
 
         for (i=0; i < n ; i++) {
19
 
            for (j=0; j < m ; j++) {
20
 
               c[i][j] = a[i][j]+b[i][j];
21
 
               }
22
 
            }
23
 
         }
24
 
      else {
25
 
         for (i=0; i < n; i++) {
26
 
            for (j=0; j < i; j++) {
27
 
               c[i][j] = a[i][j]+b[i][j];
28
 
               c[j][i] = a[j][i]+b[j][i];
29
 
               }
30
 
            c[i][i] = a[i][i]+b[i][i];
31
 
            }
32
 
         }
33
 
      }