File: append_dcmatrix.c

package info (click to toggle)
phcpack 2.4.90%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 142,196 kB
  • sloc: ada: 945,280; cpp: 214,980; ansic: 59,304; python: 51,902; makefile: 3,660; lisp: 444; javascript: 352
file content (29 lines) | stat: -rwxr-xr-x 613 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* file append_dcmatrix.c provides an implementation of routines in append_dcmatrix.h */
#include "dcmplx.h"


void h_append ( int n, int m1, int m2, dcmplx a[n][m1], dcmplx b[n][m2], dcmplx c[n][m1+m2])
{
  int i, j;

  for(i=0; i<n; i++)
  {
    for(j=0; j<m1; j++)
      c[i][j]=a[i][j];  
    for(j=m1; j<m1+m2; j++)
      c[i][j]=b[i][j-m1];
  }  

}

void v_append ( int n1, int n2, int m, dcmplx a[n1][m], dcmplx b[n2][m], dcmplx c[n1+n2][m])
{
  int i, j;
 
  for(i=0; i<n1; i++)
    for(j=0; j<m; j++)
      c[i][j]=a[i][j];
  for(i=n1; i<n1+n2; i++)
    for(j=0; j<m; j++)
      c[i][j]=b[i-n1][j];
}