File: transc.c

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (95 lines) | stat: -rw-r--r-- 2,309 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <string.h>
#ifdef __STDC__
#include <stdlib.h>
#else
#include <malloc.h>
#endif


#include "../machine.h"

void C2F(transc)(lp1,lpft,ls1,lsft,m,lsftdim,lpftdim,n)
int *lp1,**lpft,*ls1,**lsft,*m,*lsftdim,*lpftdim,*n;
{
  int n1,sdim,mftdim;
  int *cfcl,*cfcp,*cw,*inf,nc,*nfcomp,*nn,*num,
  *p,*p1,*pile,*s,*som,*suc;
  int isize = sizeof(int);

  n1 = *n + 1;
  sdim = (*n * (*n - 1))/2 + 1;
  mftdim = (*n * (*n - 1)) + 1;

  if ((*lpft = (int *)malloc(n1 * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((*lsft = (int *)malloc(mftdim * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }

  if ((cfcl = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((cfcp = (int *)malloc(n1 * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((cw = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((inf = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((nfcomp = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((nn = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((num = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((p = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((p1 = (int *)malloc(n1 * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((pile = (int *)malloc(*n * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((s = (int *)malloc(sdim * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((som = (int *)malloc(n1 * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  if ((suc = (int *)malloc(*m * isize)) == NULL) {
    cerro("Running out of memory");
    return;
  }
  
  F2C(frmtrs)(cfcl,cfcp,cw,inf,lp1,*lpft,ls1,*lsft,m,
	  &mftdim,n,&nc,nfcomp,nn,num,p,p1,pile,s,
	  &sdim,som,suc);

  free(inf); free(cw); free(nfcomp);free(cfcp); 
  free(cfcl); free(nn); free(num); free(p); free(p1); 
  free(pile); free(s); free(som); free(suc);

  *lpftdim = n1;
  *lsftdim = (*lpft)[*n] - 1;
}