Parent: [eee8ae] (diff)

Download this file

Documentation.txt    484 lines (302 with data), 11.9 kB

  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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
This file is a very raw documentation of the library provided.
==============================================================
If I will have time I provide a TeX based document ...
First of all, this library was developed for my personl needs for
some software projects which I developed during my studies and later
"just for fun".
TODO
====
- Improve documentation
- Improve "build" instructions
- Incorporate hints for test routinens (for a big part of the
routines provided there are already test routines in place,
need to be published)
Installation
============
First of all you will need a verions of the IO library (InOut)
if you want to use modules doing some IO (see documentation below).
If these modules are not of interrest it should be sufficient to have only
a small subset available (Errors, Deklera)
Some files are provided in a form augmented with compiler directives.
It should in big parts be possible to use them directly with XDS Modula-2
if you provide the right definitions (target compiler, usage of different
verison of BLAS routines, ... )
For procession these files a preprocessor is provided (m2pp.mod). You will
need to have the InOut library and the StingTok module to get it compiled.
Both can be found in some sub-projects on this page.
A Makefile is provided which can generate all files for XDS Modula-2 and
GNU Modula-2
But at the moment you need to edit the Makefile and adjust a couple of
options.
Choose target Compilter
=======================
COMPILER={XDS|GM2}
Might be either XDS or GM2 - will check later of AWD Modula-2 under
Windows can be integrated as well if the ISO-IO binding is working
properly.
Choose IO System to be used
===========================
IOSYS={MRI|ISOIO}
MRI : use the completly independed IO stack of the author.
ISOIO : use the IO stack on top of ISO IO-Modules
Does not work properly with GM2 at the moment,
XDS seems to be OK
M2baseDir : The path to the sources of InOut
=========
My personal installation looks like
${HOME}/Modula-2/InOut/quellen.iso
$(Home}/Modula-2/Numerik/quellen.iso
$(HOME}/Modula-2/{other stuff}
BLAS
====
BLASLIB = {BLAS|BLASF77}
In modules using the BLAS (Basic Linear Algebra Subroutines) library
you can either use the Modula-2 subset, based on the reference installation
to be found at netlib or a interface to a Fortran based version.
For XDS the Fortran 77 reference installation compiled either with GNU
modula or with the Intel Fortran compiler work and give better performance.
For GNU Modula you currently can only use the Modula-2 version as the
GM2 LONGREAL does not match a FORTRAN 77 double precision nor do I find
a way to adjust with a Fortran 90+ version with a construct of
! MODULE M2kinds ! note this is a Fortran Module !!!
!
! INTEGER,parameter :: dp=SELECTED_REAL_KIND(19,4000)
! REAL (kind=dp) :: <whatever needs to be defined>
! ...
!
! END MODULE M2kinds
For XDS Modula the OpenBlas implementation as well as the ATLAS library
had been tested and show good results
Use one of the experimental dgemm versions with OpenMP
======================================================
IfOpenMP = {YES|NO}
Use NO to be on the safe side ...
How shall LinPack (Modula-2 subset) be compiled
===============================================
LinPack also has "inline" option besided the Modula-2 BLAS
and Fortran BLAS versions
BLASLIBin = {BLAS|BLASF77|inline}
GM2 Path
========
You need to define the pathes to your GNU Modula-2 installation with the
variables
GM2baseDir : Where to look for the "system" definition modules
GM2libDir : Path to the standard GM2 Modula libraries
M2baseDir : Path where you installed InOut and other stuff
Where to find the m2pp Modula-2 preprocessor
============================================
M2PP = $(HOME)/Modula-2/Werkzeuge/m2pp -b
This is my path to my installation and a activate the -b option
by default to replace unused code by blank lines.
HINT:
=====
For the XDS compiler you may need to run the make command twice with
the -i option. There is a mistake in the Makefile I did not find so far ...
If you are using the XDS compiler and want to call Fortran based BLAS
libraries you need to inculde them in your template file.
I added my xc.cfg and xc.tem file as a reference - but you need to
adjust pathes therein to reflect your personal installation.
(needs externsion)
TODO
====
There would be a high need to have a "configure" file for all that !!!
Dependencies
============
In general it is a good idea to have a look on the InOut library provided.
Most routines do not strongly depend on them as a tried to avoide IO
in them whereever possibel. A calculation routin should do a calculation,
not IO ;-)
Most of the modules do import
- Deklera : declatation of types and some constants
- Errors : procedures for error output
which can be found in the folder InOut. The import is unproblematic.
Some libraries depend on module "TestReal" for detection of NAN and INF
(LMathLib, SpezFunkt2, SpezFunkt4) - here I do not have a clue how that
to be handled with GNU Modula-2 12 or 16 byte long LONGREALS.
The module TIO is imported in a lot of modules in debug mode.
Further dependencies will be mentioned within the entire sections the
various modules are shortly descibed.
Modules
=======
This list is in alphbetical order
ApproxLib
---------
Routines for the approvimation of functions by polynominals or rational
functions and related.
BaseLib
-------
Some very basic routines (only swap at the moment)
CmplxMath
---------
Basic complex math on components
Differ
------
Module for calculation numerical derivatives of a function or a function
provided as list of values
DynMat
------
Module for the allocaion of dynamically allocated two dimensional arrays.
If we would have the Oberon dynamic open array functionality in Modula-2
that could vanish ;-)
EigenLib1
---------
Routines for the calculation of eigensystems of real symmetric matrices, either
as two dimensional arrays or in packed form (SUPERVEKTOR). Also routine for
generalized real symmetic eigenproblems (A x V = S \lambda V)
This module depends on
- FileSystem : Some low level file system related operations
(open/close file) - here the definition of the standard
error channel is all what's imported
- FIO2 : Used for error output in debug mode
EigenLib2
---------
Routines for the calculation of eigensystems of real general and complex
hermitian matrices.
EigenLib3
---------
Routines for the calculation of eigensystems of complex general matrices.
EigenLibAux
-----------
Support routines for the calculation of eigensystems. Normaly not to be
used directly.
F77func
----------------------
Some standard Fortran functions implemented in Modula-2 - manely used
for proting Fortran code
FMatEA
------
Routines for the formatted input / output of vectors and matrices on "raw" files.
Especially the matrix output routines proved a well readable form of printing
a matrix, partially along with a vector (e.g. for eigensystems) or even with
comments (used in my quantum SCF program)
This module depends on
- FileSystem : Some low level file system related operations
(open/close file) - here the definition of a file and the
close operation are used.
- FIO2 : Basic read/write operations for integers and reals on raw
files
Fourier
----------------------
Routines for concentional and fast fourier transformations. Also a fast routine
for non power of two dimensioned arrays.
IEEE
----------------------
Definition of INF and NAN for LONGREAL (8 Byte)
Integral
----------------------
Module for calculation numerical integrals of a function or a function
provided as list of values
LibDBlas
--------
Some BLAS routines implemented in Modula-2 in a manner that they can
easily be repaced by their Fortran equivalents
LibDBlasF77
----------------------
Interface to Fortan BLAS routines. Uses LibBDlasL1F77, LibDBlasL3F77 and
LibDBlasLxF77 for "hide" some aspects of Fortran
LibDBlasL1F77
-------------
"Low level" interface to some Fortran level 1 BLAS routines
Not for direct use - please refer to LibDBlasF77.
LibDBlasL3F77
----------------------
"Low level" interface to some Fortran level 3 BLAS routines.
Not for direct use - please refer to LibDBlasF77.
LibDBlasLxF77
----------------------
"Low level" interface to some Fortran BLAS routines.
Not for direct use - please refer to LibDBlasF77.
LibDBlasM2
----------------------
Some BLAS routines implemented in Modula-2 with a calling convention that
would be "normal" in Modula-2. If unsure, use these one first.
LinLib
----------------------
Routines for solving linear systems of equations
LinPack
----------------------
Routines for solving linear systems of equations ported from the
Fortran LinPack package
LMathLib
--------
Basic mathematical constants and routines not provided by LongMath.
Also some useful axcillirary function (e.g. Phytag)
LngCmplxMath
----------------------
Basis complex math based on a record type - historical ;-)
MatLib
------
Routines for matrix/vector operations and related
NumAlLib1
----------------------
Some basic vector/matrix operations from the Stichting ICW
NUMAL Algol library. Not for direct use
OpenMPF77
---------
Interface to OpenMP in Fortran for setting the number of
threads used.
OptimLib1
---------
Provides a couple of routine for optimisatin of functions in one or more
real variables without derivaties.
This module depends on
- Timer : Getting elaps timings
- FileSystem : Some low level file system related operations
(open/close file). Here only the definition of the standard
IO channel is used ...
- SFormAus : For formatted output of some intermediate results
OptimLib3
----------------------
Provides a couple of routine for optimisatin of functions in one or more
real variables with derivaties.
PMatLib
----------------------
Routines for vector / matrix operations on dynamically genereated
matrices (see DynMat).
RandomLib
----------------------
Set of random number generator ranging from weak to strong.
SMatEA
------
Routines for the formatted input / output of vectors and matrices on buffered
files (Stream). In all other aspects identical to FMatEA.
This module depends on
- Streams : Some buffered files related operations - here the definition
of a Stream and the close operation are used.
- SIO : Basic read/write operations for integers and reals on buffered
file
- StringsLib : Some strings related operations, here Length (easily to be
replaced by Strings.Length) and RmMultBlank are used.
SortLib
-------
Some sorting routines for real and integer vectors.
SpezFunkt1
----------
Some special functions and routine for the evaluation of polynominal
and rational functions
SpezFunkt2
----------
Some special functions in the area of the gamma function
SpezFunkt3
----------
Some special functions in the area of the bessel function
SpezFunkt4
----------
Various density and probability functions
StatLib
-------
Modul for some statistical functions
SVDLib1
-------
Module for calculatin the singular value decomposition for real valued
matrices and least squares soluations of systems of linear systems of
equations based on the SVD
SVDLib2
-------
Module for calculatin the singular value decomposition for a pointer based
matrix type and least squares soluations of systems of linear systems of
equations based on the SVD
SVDLib3
-------
Module for calculatin the singular value decomposition for a complex matrix
or the Takagi factorization of a complex symmetrix matrix.