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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
function InitializeLibraryAnnotations(FileInfoDatFile)
// function InitializeLibraryAnnotations(FileInfoDatFile)
// -----------------------------------------------------------------
// This function initializes the SCI2C and USER library annotation
// files.
// For each Scilab function a .ann file is created where the function
// annotations are listed into it.
//
// Input data:
// FileInfoDatFile: name of the .dat file containing the FileInfo structure.
//
// Output data:
//
// Status:
// 12-Jun-2007 -- Nutricato Raffaele: Author.
// -----------------------------------------------------------------
// ---------------------
// --- Load section. ---
// ---------------------
// --- Load File Info Structure. ---
load(FileInfoDatFile,'FileInfo');
// --- Load Shared Info Structure. ---
load(FileInfo.SharedInfoDatFile,'SharedInfo');
// -------------------------
// --- End load section. ---
// -------------------------
PrintStepInfo('Initialize Library Annotation Files.',...
FileInfo.GeneralReport,'both');
OutDir = FileInfo.SCI2CLibAnnDirName;
SCI2CCreateDir(OutDir);
// ------------------------------------------------------
// --- Add elementary functions to the SCI2C library. ---
// ------------------------------------------------------
PrintStringInfo('Adding elementary functions to the SCI2C library.',...
FileInfo.GeneralReport,'both','y');
//RN non so comet trattare la equal
AnnStyle = 'INON';
//RN equal funziona come le sin ma occorre fare diversi controlli per capire se l'output
//e' compatibile con l'input. Per ora la lascio cosi'.
NewFunctionName = 'Equal';
PrintStringInfo(' Adding function ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
// ----------------------
// --- Style: 'I1O1'. ---
// ----------------------
AnnStyle = 'I1O1';
NewFunctionName = 'sin';
PrintStringInfo(' Adding function ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
NewFunctionName = 'cos';
PrintStringInfo(' Adding function ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
// SCI2CLib = AddElementaryFunction("tan",SCI2CLib);
// SCI2CLib = AddElementaryFunction("cotg",SCI2CLib);
// SCI2CLib = AddElementaryFunction("asin",SCI2CLib);
// SCI2CLib = AddElementaryFunction("acos",SCI2CLib);
// SCI2CLib = AddElementaryFunction("sinh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("cosh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("tanh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("asinh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("acosh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("atanh",SCI2CLib);
// SCI2CLib = AddElementaryFunction("exp",SCI2CLib);
// SCI2CLib = AddElementaryFunction("log",SCI2CLib);
// SCI2CLib = AddElementaryFunction("log10",SCI2CLib);
// SCI2CLib = AddElementaryFunction("abs",SCI2CLib);
// SCI2CLib = AddElementaryFunction("inv",SCI2CLib);
// SCI2CLib = AddElementaryFunction("sqrtR",SCI2CLib);
// ----------------------
// --- Style: 'DET'. ---
// ----------------------
AnnStyle = 'DET';
NewFunctionName = 'det';
PrintStringInfo(' Adding function ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
// ----------------------------------------------------------
// --- End add elementary functions to the SCI2C library. ---
// ----------------------------------------------------------
// ----------------------------------------------------
// --- Add operator functions to the SCI2C library. ---
// ----------------------------------------------------
PrintStringInfo('Adding operator functions to the SCI2C library.',...
FileInfo.GeneralReport,'both','y');
// ----------------------
// --- Style: 'I2O1'. ---
// ----------------------
AnnStyle = 'I2O1';
NewFunctionName = 'OpPlus';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
NewFunctionName = 'OpMinus';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
NewFunctionName = 'OpMul';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
NewFunctionName = 'OpDiv';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
// -----------------------
// --- Style: 'TRANS'. ---
// -----------------------
AnnStyle = 'TRANS';
NewFunctionName = 'OpTrans';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
NewFunctionName = 'OpTransConj';
PrintStringInfo(' Adding operator ""'+NewFunctionName+'"".',FileInfo.GeneralReport,'both','y');
GenAnnotationFile(AnnStyle,NewFunctionName,OutDir);
// --------------------------------------------------------
// --- End add operator functions to the SCI2C library. ---
// --------------------------------------------------------
if (1==2)
// determinant function
[FuncStruct, CINFO, NumFunc] = AddLeafDet("det");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// sqrt function
[FuncStruct, CINFO, NumFunc] = AddLeafSqrt("sqrt");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// I add the function with 2 Input
// dot function
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotAdd");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotSub");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotMul");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotDiv");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// op function
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpAdd");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpSub");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpMul");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
[FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpDiv");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// atan function
[FuncStruct, CINFO, NumFunc] = AddLeafAtan("atan");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// convol function
[FuncStruct, CINFO, NumFunc] = AddLeafConvol("convol");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// fft function
[FuncStruct, CINFO, NumFunc] = AddLeafFFT("fft");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
// ifft function
[FuncStruct, CINFO, NumFunc] = AddLeafIFFT("ifft");
for ind = 1 : NumFunc,
SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) );
end
end // end if (1==2)
endfunction
|