summaryrefslogtreecommitdiffstats
path: root/scilab/modules/metanet
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2009-09-28 09:29:50 +0200
committerSylvestre Ledru <sylvestre.ledru@scilab.org>2009-09-28 09:29:50 +0200
commitf0f478989dece2807c0d310a235e15580c9efd0f (patch)
tree0e4a348fa6b80fdc4b97bc8c3f81b0132b0ca814 /scilab/modules/metanet
parent2381e260bb57380b7123ff4ca209e76d01263eb6 (diff)
parent59397dd3fd7d4a633df8808b8b6fe4b2ffc05222 (diff)
downloadscilab-f0f478989dece2807c0d310a235e15580c9efd0f.zip
scilab-f0f478989dece2807c0d310a235e15580c9efd0f.tar.gz
Merge commit 'origin/master' into scilab-macosx
Diffstat (limited to 'scilab/modules/metanet')
-rw-r--r--scilab/modules/metanet/macros/graph_tools/bandwr.sci2
-rw-r--r--scilab/modules/metanet/macros/graph_tools/graph_simp.sci2
-rw-r--r--scilab/modules/metanet/macros/graph_tools/knapsack.sci8
-rw-r--r--scilab/modules/metanet/macros/graph_tools/make_graph.sci2
-rw-r--r--scilab/modules/metanet/macros/graph_tools/mat_2_graph.sci4
-rw-r--r--scilab/modules/metanet/macros/graph_tools/neighbors.sci2
-rw-r--r--scilab/modules/metanet/src/c/connex.c4
-rw-r--r--scilab/modules/metanet/src/c/connex.h10
-rw-r--r--scilab/modules/metanet/src/c/dmtree.c105
-rw-r--r--scilab/modules/metanet/src/c/dmtree.h22
-rw-r--r--scilab/modules/metanet/src/c/files.c37
-rw-r--r--scilab/modules/metanet/src/c/hashtable_metanet.c2
-rw-r--r--scilab/modules/metanet/src/c/loadg.c16
-rw-r--r--scilab/modules/metanet/src/c/loadg.h4
-rw-r--r--scilab/modules/metanet/src/c/metanet.vcproj20
-rw-r--r--scilab/modules/metanet/src/c/paths.h13
-rw-r--r--scilab/modules/metanet/src/c/saveg.h3
-rw-r--r--scilab/modules/metanet/src/c/transc.c6
-rw-r--r--scilab/modules/metanet/src/c/transc.h11
19 files changed, 166 insertions, 107 deletions
diff --git a/scilab/modules/metanet/macros/graph_tools/bandwr.sci b/scilab/modules/metanet/macros/graph_tools/bandwr.sci
index 6535f39..e44b03e 100644
--- a/scilab/modules/metanet/macros/graph_tools/bandwr.sci
+++ b/scilab/modules/metanet/macros/graph_tools/bandwr.sci
@@ -83,7 +83,7 @@ function [iperm,mrepi,profil,ierr]=bandwr(a,b,c,d)
83 ii=int((rand()+1./k)*k); 83 ii=int((rand()+1./k)*k);
84 b=[b a(ii)];a(ii)=[]; 84 b=[b a(ii)];a(ii)=[];
85 end; 85 end;
86 [ss,sk]=sort(b); 86 [ss,sk]=gsort(b);
87 back=sk($:-1:1); 87 back=sk($:-1:1);
88 a=amem+amem'; 88 a=amem+amem';
89 a=a(b,b);a=triu(a); 89 a=a(b,b);a=triu(a);
diff --git a/scilab/modules/metanet/macros/graph_tools/graph_simp.sci b/scilab/modules/metanet/macros/graph_tools/graph_simp.sci
index ca786c3..1b4c592 100644
--- a/scilab/modules/metanet/macros/graph_tools/graph_simp.sci
+++ b/scilab/modules/metanet/macros/graph_tools/graph_simp.sci
@@ -19,7 +19,7 @@ function g1=graph_simp(g)
19 [ir ic]=find(ta==he); 19 [ir ic]=find(ta==he);
20 ta(ic)=[];he(ic)=[]; 20 ta(ic)=[];he(ic)=[];
21 p=round(log(n)/log(10));q=10^(p+4); 21 p=round(log(n)/log(10));q=10^(p+4);
22 w=ta'*q+he';[w1 iw]=sort(w); 22 w=ta'*q+he';[w1 iw]=gsort(w);
23 ww=w1(2:$)-w1(1:($-1)); 23 ww=w1(2:$)-w1(1:($-1));
24 [ir ic]=find(ww==0); 24 [ir ic]=find(ww==0);
25 index=iw(ir); 25 index=iw(ir);
diff --git a/scilab/modules/metanet/macros/graph_tools/knapsack.sci b/scilab/modules/metanet/macros/graph_tools/knapsack.sci
index 95f355b..da311e4 100644
--- a/scilab/modules/metanet/macros/graph_tools/knapsack.sci
+++ b/scilab/modules/metanet/macros/graph_tools/knapsack.sci
@@ -42,13 +42,13 @@ function [earn,ind]=knapsack(profit,weight,capa,bck)
42 weight = matrix(weight,1,-1) 42 weight = matrix(weight,1,-1)
43 capa = matrix(capa,1,-1) 43 capa = matrix(capa,1,-1)
44 //preprocess the data 44 //preprocess the data
45 [s,k]=sort(profit./weight); 45 [s,k]=gsort(profit./weight);
46 [ss,kk]=sort(-k); 46 [ss,kk]=gsort(-k);
47 p=profit(k);w=weight(k); 47 p=profit(k);w=weight(k);
48 np1=n+1; 48 np1=n+1;
49 m=size(capa,2); 49 m=size(capa,2);
50 [s1,k1]=sort(capa); 50 [s1,k1]=gsort(capa);
51 [s2,k2]=sort(k1); 51 [s2,k2]=gsort(k1);
52 kap=s1($:-1:1); 52 kap=s1($:-1:1);
53 mn=m*n;mnp1=m*np1; 53 mn=m*n;mnp1=m*np1;
54 [xstar,vstar]=m6knapsk(n,m,np1,mn,mnp1,p,w,kap,bck); 54 [xstar,vstar]=m6knapsk(n,m,np1,mn,mnp1,p,w,kap,bck);
diff --git a/scilab/modules/metanet/macros/graph_tools/make_graph.sci b/scilab/modules/metanet/macros/graph_tools/make_graph.sci
index fd9b6aa..d4fee6a 100644
--- a/scilab/modules/metanet/macros/graph_tools/make_graph.sci
+++ b/scilab/modules/metanet/macros/graph_tools/make_graph.sci
@@ -45,7 +45,7 @@ function g=make_graph(name,directed,n,tail,head)
45 nodename=string(1:n) 45 nodename=string(1:n)
46 else 46 else
47 ij=[tail' head']; 47 ij=[tail' head'];
48 tri=[ij(:,1)' ij(:,2)'];[atri,indic]=sort(-tri); 48 tri=[ij(:,1)' ij(:,2)'];[atri,indic]=gsort(-tri);
49 atri=-atri; 49 atri=-atri;
50 n1=size(atri,2); 50 n1=size(atri,2);
51 atri1=atri-[0 atri(1:n1-1)]; 51 atri1=atri-[0 atri(1:n1-1)];
diff --git a/scilab/modules/metanet/macros/graph_tools/mat_2_graph.sci b/scilab/modules/metanet/macros/graph_tools/mat_2_graph.sci
index dd2483b..459f594 100644
--- a/scilab/modules/metanet/macros/graph_tools/mat_2_graph.sci
+++ b/scilab/modules/metanet/macros/graph_tools/mat_2_graph.sci
@@ -47,9 +47,9 @@ function g=mat_2_graph(a,directed,mat)
47 end 47 end
48 48
49 he=ij(itab,:); ta=ij(jtab,:) 49 he=ij(itab,:); ta=ij(jtab,:)
50 [s,k]=sort(he(:,2)); he=he(k,:); he=he(:,1) 50 [s,k]=gsort(he(:,2)); he=he(k,:); he=he(:,1)
51 ma=prod(size(k)); he=he(ma:-1:1) 51 ma=prod(size(k)); he=he(ma:-1:1)
52 [s,k]=sort(ta(:,2)); ta=ta(k,:); ta=ta(:,1) 52 [s,k]=gsort(ta(:,2)); ta=ta(k,:); ta=ta(:,1)
53 ma=prod(size(k)); ta=ta(ma:-1:1) 53 ma=prod(size(k)); ta=ta(ma:-1:1)
54 g=make_graph('foo',1,n,he',ta') 54 g=make_graph('foo',1,n,he',ta')
55 55
diff --git a/scilab/modules/metanet/macros/graph_tools/neighbors.sci b/scilab/modules/metanet/macros/graph_tools/neighbors.sci
index 1a18236..401e83c 100644
--- a/scilab/modules/metanet/macros/graph_tools/neighbors.sci
+++ b/scilab/modules/metanet/macros/graph_tools/neighbors.sci
@@ -21,5 +21,5 @@ function d=neighbors(i,g)
21 d1=he(ic); 21 d1=he(ic);
22 [ir,ic]=find(he==i); 22 [ir,ic]=find(he==i);
23 d2=ta(ic); 23 d2=ta(ic);
24 d=-sort(-[d1 d2]); 24 d=-gsort(-[d1 d2]);
25endfunction 25endfunction
diff --git a/scilab/modules/metanet/src/c/connex.c b/scilab/modules/metanet/src/c/connex.c
index ca6963c..7f7664f 100644
--- a/scilab/modules/metanet/src/c/connex.c
+++ b/scilab/modules/metanet/src/c/connex.c
@@ -11,6 +11,10 @@
11 * 11 *
12 */ 12 */
13 13
14#include <string.h>
15#include <stdlib.h>
16#include "MALLOC.h"
17#include "cerro.h"
14#include "connex.h" 18#include "connex.h"
15#include "localization.h" 19#include "localization.h"
16 20
diff --git a/scilab/modules/metanet/src/c/connex.h b/scilab/modules/metanet/src/c/connex.h
index 17bfe76..0cf8c83 100644
--- a/scilab/modules/metanet/src/c/connex.h
+++ b/scilab/modules/metanet/src/c/connex.h
@@ -23,15 +23,9 @@
23#ifndef __CONNEX_H__ 23#ifndef __CONNEX_H__
24#define __CONNEX_H__ 24#define __CONNEX_H__
25 25
26#include <string.h>
27#include <stdlib.h>
28
29#include "MALLOC.h"
30
31#include "cerro.h"
32
33#include "machine.h" 26#include "machine.h"
27#include "dynlib_metanet.h"
34 28
35void C2F(concom)(int *icomp, int *n, int *ncomp, int **ns, int *nsize); 29METANET_IMPEXP void C2F(concom)(int *icomp, int *n, int *ncomp, int **ns, int *nsize);
36 30
37#endif /* ! __CONNEX_H__ */ 31#endif /* ! __CONNEX_H__ */
diff --git a/scilab/modules/metanet/src/c/dmtree.c b/scilab/modules/metanet/src/c/dmtree.c
index 8146e9e..c7a689e 100644
--- a/scilab/modules/metanet/src/c/dmtree.c
+++ b/scilab/modules/metanet/src/c/dmtree.c
@@ -10,65 +10,76 @@
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11 * 11 *
12 */ 12 */
13 13/*--------------------------------------------------------------------------*/
14#include <string.h> 14#include <string.h>
15#include <stdlib.h> 15#include <stdlib.h>
16#include "machine.h" 16#include "dmtree.h"
17extern void cerro();
18
19#include "MALLOC.h" 17#include "MALLOC.h"
20#include "localization.h" 18#include "localization.h"
19/*--------------------------------------------------------------------------*/
20extern void cerro();
21 21
22#ifdef _MSC_VER 22#ifdef _MSC_VER
23extern int F2C(arbor)(); 23extern int F2C(arbor)();
24#endif 24#endif
25 25/*--------------------------------------------------------------------------*/
26void C2F(dmtree)(int *i0, int *la1, int *lp1, int *ls1, int *m, int *n, int *pred, int *w) 26void C2F(dmtree)(int *i0, int *la1, int *lp1, int *ls1, int *m, int *n, int *pred, int *w)
27{ 27{
28 int i,nndim; 28 int i = 0,nndim = 0;
29 int *alphi,*beta,*f,*g,*ind,*pred1; 29 int *alphi = NULL,*beta = NULL,*f = NULL,*g = NULL,*ind = NULL,*pred1 = NULL;
30 double *z,*zsom; 30 double *z = NULL,*zsom = NULL;
31 int isize,dsize; 31 int isize = 0,dsize = 0;
32 isize = sizeof(int); dsize = sizeof(double); 32
33 isize = sizeof(int);
34 dsize = sizeof(double);
33 35
34 nndim = 2 * *n; 36 nndim = 2 * *n;
35 if ((alphi = (int *)MALLOC(nndim * isize)) == NULL) { 37 if ((alphi = (int *)MALLOC(nndim * isize)) == NULL)
36 cerro(_("Running out of memory")); 38 {
37 return; 39 cerro(_("Running out of memory"));
38 } 40 return;
39 if ((beta = (int *)MALLOC(nndim * isize)) == NULL) { 41 }
40 cerro(_("Running out of memory")); 42 if ((beta = (int *)MALLOC(nndim * isize)) == NULL)
41 return; 43 {
42 } 44 cerro(_("Running out of memory"));
43 if ((f = (int *)MALLOC(nndim * isize)) == NULL) { 45 return;
44 cerro(_("Running out of memory")); 46 }
45 return; 47 if ((f = (int *)MALLOC(nndim * isize)) == NULL)
46 } 48 {
47 if ((g = (int *)MALLOC(nndim * isize)) == NULL) { 49 cerro(_("Running out of memory"));
48 cerro(_("Running out of memory")); 50 return;
49 return; 51 }
50 } 52 if ((g = (int *)MALLOC(nndim * isize)) == NULL)
51 if ((ind = (int *)MALLOC(nndim * isize)) == NULL) { 53 {
52 cerro(_("Running out of memory")); 54 cerro(_("Running out of memory"));
53 return; 55 return;
54 } 56 }
55 if ((pred1 = (int *)MALLOC(nndim * isize)) == NULL) { 57 if ((ind = (int *)MALLOC(nndim * isize)) == NULL)
56 cerro(_("Running out of memory")); 58 {
57 return; 59 cerro(_("Running out of memory"));
58 } 60 return;
59 if ((z = (double *)MALLOC(nndim * dsize)) == NULL) { 61 }
60 cerro(_("Running out of memory")); 62 if ((pred1 = (int *)MALLOC(nndim * isize)) == NULL)
61 return; 63 {
62 } 64 cerro(_("Running out of memory"));
63 if ((zsom = (double *)MALLOC(nndim * dsize)) == NULL) { 65 return;
64 cerro(_("Running out of memory")); 66 }
65 return; 67 if ((z = (double *)MALLOC(nndim * dsize)) == NULL)
66 } 68 {
69 cerro(_("Running out of memory"));
70 return;
71 }
72 if ((zsom = (double *)MALLOC(nndim * dsize)) == NULL)
73 {
74 cerro(_("Running out of memory"));
75 return;
76 }
67 77
68 F2C(arbor)(alphi,beta,f,g,i0,ind,la1,lp1,ls1,m,n,&nndim,pred1,w,z,zsom); 78 F2C(arbor)(alphi,beta,f,g,i0,ind,la1,lp1,ls1,m,n,&nndim,pred1,w,z,zsom);
69 79
70 for (i = 0; i < *n; i++) pred[i] = pred1[i]; 80 for (i = 0; i < *n; i++) pred[i] = pred1[i];
71 81
72 FREE(alphi); FREE(beta); FREE(f); FREE(g); FREE(ind); 82 FREE(alphi); FREE(beta); FREE(f); FREE(g); FREE(ind);
73 FREE(pred1); FREE(z); FREE(zsom); 83 FREE(pred1); FREE(z); FREE(zsom);
74} 84}
85/*--------------------------------------------------------------------------*/ \ No newline at end of file
diff --git a/scilab/modules/metanet/src/c/dmtree.h b/scilab/modules/metanet/src/c/dmtree.h
new file mode 100644
index 0000000..05867e6
--- /dev/null
+++ b/scilab/modules/metanet/src/c/dmtree.h
@@ -0,0 +1,22 @@
1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2009 - DIGITEO - Allan CORNET
4 *
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 *
11 */
12/*--------------------------------------------------------------------------*/
13#ifndef __DMTREE_H__
14#define __DMTREE_H__
15
16#include "machine.h"
17#include "dynlib_metanet.h"
18
19METANET_IMPEXP void C2F(dmtree)(int *i0, int *la1, int *lp1, int *ls1, int *m, int *n, int *pred, int *w);
20
21#endif /* __DMTREE_H__ */
22/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/metanet/src/c/files.c b/scilab/modules/metanet/src/c/files.c
index 1ffa6dc..c6995b8 100644
--- a/scilab/modules/metanet/src/c/files.c
+++ b/scilab/modules/metanet/src/c/files.c
@@ -47,23 +47,26 @@ int CheckGraphName(char *name,char *dir)
47 47
48char *StripGraph(char *name) 48char *StripGraph(char *name)
49{ 49{
50 char *s; 50 char *s = NULL;
51 int i; 51 int i = 0;
52 char *t; 52 char *t = NULL;
53 53
54 s = name; 54 s = name;
55 i = 0; 55 i = 0;
56 t = (char *)MALLOC((unsigned)strlen(name)+1); 56 t = (char *)MALLOC((unsigned)strlen(name)+1);
57 while ( (t[i++] = *s++) ) { 57 while ( (t[i++] = *s++) )
58 if (*s == '.') { 58 {
59 if (strcmp(++s,"graph") == 0) { 59 if (*s == '.')
60 t[i] = '\0'; 60 {
61 return t; 61 if (strcmp(++s,"graph") == 0)
62 } 62 {
63 t[i++] = '.'; 63 t[i] = '\0';
64 } 64 return t;
65 } 65 }
66 return name; 66 t[i++] = '.';
67 }
68 }
69 return name;
67} 70}
68 71
69#ifndef _MSC_VER 72#ifndef _MSC_VER
diff --git a/scilab/modules/metanet/src/c/hashtable_metanet.c b/scilab/modules/metanet/src/c/hashtable_metanet.c
index 9be8066..a854e57 100644
--- a/scilab/modules/metanet/src/c/hashtable_metanet.c
+++ b/scilab/modules/metanet/src/c/hashtable_metanet.c
@@ -53,7 +53,9 @@ static unsigned int hashfromkey_string(void *ky)
53 str=k->Key_String; 53 str=k->Key_String;
54 54
55 while ((c = *(str++))) 55 while ((c = *(str++)))
56 {
56 hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ 57 hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
58 }
57 59
58 return hash; 60 return hash;
59} 61}
diff --git a/scilab/modules/metanet/src/c/loadg.c b/scilab/modules/metanet/src/c/loadg.c
index d353616..f5d9d71 100644
--- a/scilab/modules/metanet/src/c/loadg.c
+++ b/scilab/modules/metanet/src/c/loadg.c
@@ -23,6 +23,8 @@
23#include "strdup_windows.h" 23#include "strdup_windows.h"
24#endif 24#endif
25 25
26#include "files.h"
27
26static int CompString(char **s1,char **s2) 28static int CompString(char **s1,char **s2)
27{ 29{
28 return strcmp((char*)*s1,(char*)*s2); 30 return strcmp((char*)*s1,(char*)*s2);
@@ -41,20 +43,20 @@ void C2F(loadg)(char *path, int *lpath, char **name, int *lname, int *directed,
41 int *default_edge_hi_width, int *default_font_size, 43 int *default_edge_hi_width, int *default_font_size,
42 int *ndim, int *ma) 44 int *ndim, int *ma)
43{ 45{
44 FILE *fg; 46 FILE *fg = NULL;
45#ifndef _MSC_VER 47#ifndef _MSC_VER
46 DIR *dirp=NULL; 48 DIR *dirp = NULL;
47#endif 49#endif
48 char fname[2 * MAXNAM]; 50 char fname[2 * MAXNAM];
49 char line[5 * MAXNAM]; 51 char line[5 * MAXNAM];
50 char strname[MAXNAM], head_name[MAXNAM], tail_name[MAXNAM]; 52 char strname[MAXNAM], head_name[MAXNAM], tail_name[MAXNAM];
51 int isize,dsize; 53 int isize = 0,dsize = 0;
52 int i,s; 54 int i = 0,s = 0;
53 ENTRY node; 55 ENTRY node;
54 ENTRY *found=NULL; 56 ENTRY *found = NULL;
55 char dir[PATH_MAX]; 57 char dir[PATH_MAX];
56 char *pname=NULL; 58 char *pname = NULL;
57 char **lar=NULL; 59 char **lar = NULL;
58 60
59 path[*lpath] = '\0'; 61 path[*lpath] = '\0';
60#ifndef _MSC_VER 62#ifndef _MSC_VER
diff --git a/scilab/modules/metanet/src/c/loadg.h b/scilab/modules/metanet/src/c/loadg.h
index 5b5deca..8abc1db 100644
--- a/scilab/modules/metanet/src/c/loadg.h
+++ b/scilab/modules/metanet/src/c/loadg.h
@@ -23,9 +23,9 @@
23#ifndef __LOADG_H__ 23#ifndef __LOADG_H__
24#define __LOADG_H__ 24#define __LOADG_H__
25#include "machine.h" 25#include "machine.h"
26#include "files.h" 26#include "dynlib_metanet.h"
27 27
28void C2F(loadg)(char *path, int *lpath, char **name, int *lname, int *directed, int *n, int **tail, int **head, 28METANET_IMPEXP void C2F(loadg)(char *path, int *lpath, char **name, int *lname, int *directed, int *n, int **tail, int **head,
29 char ***node_name, 29 char ***node_name,
30 int **node_type, int **node_x, int **node_y, int **node_color, int **node_diam, int **node_border, 30 int **node_type, int **node_x, int **node_y, int **node_color, int **node_diam, int **node_border,
31 int **node_font_size, 31 int **node_font_size,
diff --git a/scilab/modules/metanet/src/c/metanet.vcproj b/scilab/modules/metanet/src/c/metanet.vcproj
index d5d8cce..c84b0dc 100644
--- a/scilab/modules/metanet/src/c/metanet.vcproj
+++ b/scilab/modules/metanet/src/c/metanet.vcproj
@@ -415,10 +415,18 @@
415 Filter="h;hpp;hxx;hm;inl" 415 Filter="h;hpp;hxx;hm;inl"
416 > 416 >
417 <File 417 <File
418 RelativePath=".\connex.h"
419 >
420 </File>
421 <File
418 RelativePath=".\defs.h" 422 RelativePath=".\defs.h"
419 > 423 >
420 </File> 424 </File>
421 <File 425 <File
426 RelativePath=".\dmtree.h"
427 >
428 </File>
429 <File
422 RelativePath="..\..\includes\dynlib_metanet.h" 430 RelativePath="..\..\includes\dynlib_metanet.h"
423 > 431 >
424 </File> 432 </File>
@@ -435,9 +443,21 @@
435 > 443 >
436 </File> 444 </File>
437 <File 445 <File
446 RelativePath=".\loadg.h"
447 >
448 </File>
449 <File
438 RelativePath=".\paths.h" 450 RelativePath=".\paths.h"
439 > 451 >
440 </File> 452 </File>
453 <File
454 RelativePath=".\saveg.h"
455 >
456 </File>
457 <File
458 RelativePath=".\transc.h"
459 >
460 </File>
441 </Filter> 461 </Filter>
442 <Filter 462 <Filter
443 Name="localization" 463 Name="localization"
diff --git a/scilab/modules/metanet/src/c/paths.h b/scilab/modules/metanet/src/c/paths.h
index 330a5ff..751aec2 100644
--- a/scilab/modules/metanet/src/c/paths.h
+++ b/scilab/modules/metanet/src/c/paths.h
@@ -15,6 +15,7 @@
15#define __PATHS_H__ 15#define __PATHS_H__
16 16
17#include "machine.h" 17#include "machine.h"
18#include "dynlib_metanet.h"
18 19
19 20
20/** NodesToPath converts a vector with node numbers into a path: 21/** NodesToPath converts a vector with node numbers into a path:
@@ -28,14 +29,14 @@
28 * @param lp 29 * @param lp
29 * @param ls 30 * @param ls
30*/ 31*/
31void NodesToPath(int *nodes,int **p,int *psize,int *la,int *lp,int *ls); 32METANET_IMPEXP void NodesToPath(int *nodes,int **p,int *psize,int *la,int *lp,int *ls);
32 33
33/** prevn2p_ computes a path from node i to node j from a 34/** prevn2p_ computes a path from node i to node j from a
34 * vector describing the previous nodes in path: 35 * vector describing the previous nodes in path:
35 * node i belongs to path if pln[i] > 0 36 * node i belongs to path if pln[i] > 0
36 * pln[i] is then the previous node in the sequence 37 * pln[i] is then the previous node in the sequence
37*/ 38*/
38void C2F(prevn2p)(int *i,int *j,int *m,int *n,int *la,int *lp,int *ls,int *direct,int *pln,int **p,int *psize); 39METANET_IMPEXP void C2F(prevn2p)(int *i,int *j,int *m,int *n,int *la,int *lp,int *ls,int *direct,int *pln,int **p,int *psize);
39 40
40 41
41/** ns2p_ converts a node set into a path: 42/** ns2p_ converts a node set into a path:
@@ -43,7 +44,7 @@ void C2F(prevn2p)(int *i,int *j,int *m,int *n,int *la,int *lp,int *ls,int *direc
43 * PATH = [A1,A2,...,An-1] with Ai = (Ni,Ni+1) 44 * PATH = [A1,A2,...,An-1] with Ai = (Ni,Ni+1)
44 * *psize = *nsize - 1 45 * *psize = *nsize - 1
45*/ 46*/
46void C2F(ns2p)(int *nodes,int *nsize,int **p,int *psize,int *la,int *lp,int *ls,int *n); 47METANET_IMPEXP void C2F(ns2p)(int *nodes,int *nsize,int **p,int *psize,int *la,int *lp,int *ls,int *n);
47 48
48 49
49/** p2ns_ converts a path into a node set: 50/** p2ns_ converts a path into a node set:
@@ -51,20 +52,20 @@ void C2F(ns2p)(int *nodes,int *nsize,int **p,int *psize,int *la,int *lp,int *ls,
51 * NODES = [N1,N2,...,Nn+1] => with Ai = (Ni,Ni+1) 52 * NODES = [N1,N2,...,Nn+1] => with Ai = (Ni,Ni+1)
52 * with *nsize = *psize + 1 53 * with *nsize = *psize + 1
53*/ 54*/
54void C2F(p2ns)(int *p,int *psize,int **nodes,int *nsize,int *la,int *lp,int *ls,int *direct,int *m,int *n); 55METANET_IMPEXP void C2F(p2ns)(int *p,int *psize,int **nodes,int *nsize,int *la,int *lp,int *ls,int *direct,int *m,int *n);
55 56
56 57
57 58
58/** edge2st_ computes a spanning tree (root = node 1) from 59/** edge2st_ computes a spanning tree (root = node 1) from
59 * an array alpha of connecting edge numbers 60 * an array alpha of connecting edge numbers
60 */ 61 */
61void C2F(edge2st)(int *n,int *alpha,int **tree,int *treesize); 62METANET_IMPEXP void C2F(edge2st)(int *n,int *alpha,int **tree,int *treesize);
62 63
63 64
64/** prevn2st_ computes a spanning tree (root = node i0) from 65/** prevn2st_ computes a spanning tree (root = node i0) from
65 * a vector nodes describing the previous nodes in tree 66 * a vector nodes describing the previous nodes in tree
66 */ 67 */
67 68
68void C2F(prevn2st)(int *n,int *nodes,int **tree,int *treesize,int *la,int *lp,int *ls); 69METANET_IMPEXP void C2F(prevn2st)(int *n,int *nodes,int **tree,int *treesize,int *la,int *lp,int *ls);
69 70
70#endif /* __PATHS_H__ */ 71#endif /* __PATHS_H__ */
diff --git a/scilab/modules/metanet/src/c/saveg.h b/scilab/modules/metanet/src/c/saveg.h
index 096149b..5f4dbaf 100644
--- a/scilab/modules/metanet/src/c/saveg.h
+++ b/scilab/modules/metanet/src/c/saveg.h
@@ -24,9 +24,10 @@
24#define __SAVEG_H__ 24#define __SAVEG_H__
25 25
26#include "machine.h" 26#include "machine.h"
27#include "dynlib_metanet.h"
27#include "files.h" 28#include "files.h"
28 29
29void C2F(saveg) (char *path, int *lpath, 30METANET_IMPEXP void C2F(saveg) (char *path, int *lpath,
30 char *name, int *lname,int *directed,int *node_number,int *tail,int *head, 31 char *name, int *lname,int *directed,int *node_number,int *tail,int *head,
31 char ***node_name, 32 char ***node_name,
32 int *node_type,int *node_x,int *node_y,int *node_color,int *node_diam,int *node_border, 33 int *node_type,int *node_x,int *node_y,int *node_color,int *node_diam,int *node_border,
diff --git a/scilab/modules/metanet/src/c/transc.c b/scilab/modules/metanet/src/c/transc.c
index 62b9c70..37d6072 100644
--- a/scilab/modules/metanet/src/c/transc.c
+++ b/scilab/modules/metanet/src/c/transc.c
@@ -11,8 +11,14 @@
11 * 11 *
12 */ 12 */
13 13
14#include <string.h>
15#include <stdlib.h>
14#include "transc.h" 16#include "transc.h"
17#include "MALLOC.h"
15#include "localization.h" 18#include "localization.h"
19#include "cerro.h"
20
21extern int F2C(frmtrs) ();
16 22
17void C2F(transc)(int *lp1,int **lpft,int *ls1,int **lsft,int *m,int *lsftdim,int *lpftdim,int *n) 23void C2F(transc)(int *lp1,int **lpft,int *ls1,int **lsft,int *m,int *lsftdim,int *lpftdim,int *n)
18{ 24{
diff --git a/scilab/modules/metanet/src/c/transc.h b/scilab/modules/metanet/src/c/transc.h
index b6724ae..1580ba3 100644
--- a/scilab/modules/metanet/src/c/transc.h
+++ b/scilab/modules/metanet/src/c/transc.h
@@ -23,16 +23,9 @@
23#ifndef __TRANSC_H__ 23#ifndef __TRANSC_H__
24#define __TRANSC_H__ 24#define __TRANSC_H__
25 25
26#include <string.h>
27#include <stdlib.h>
28
29#include "machine.h" 26#include "machine.h"
30#include "MALLOC.h" 27#include "dynlib_metanet.h"
31
32#include "cerro.h"
33
34extern int F2C(frmtrs) ();
35 28
36void C2F(transc)(int *lp1,int **lpft,int *ls1,int **lsft,int *m,int *lsftdim,int *lpftdim,int *n); 29METANET_IMPEXP void C2F(transc)(int *lp1,int **lpft,int *ls1,int **lsft,int *m,int *lsftdim,int *lpftdim,int *n);
37 30
38#endif /* !__TRANSC_H__ */ 31#endif /* !__TRANSC_H__ */