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) :: ! ... ! ! 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.