STATPACK overview

You will find several subdirectories under the STATPACK library directory: sources, examples, tests, doc, interfaces, makeincs and myprograms.

The content and use of these subdirectories are briefly described in this chapter.

sources directory

All the constants, variables, subroutines and functions available in the STATPACK library are organized and grouped in Fortran 90 modules. All the modules available in the library are located in the sources subdirectory of the STATPACK directory.

The table below gives a brief overview of the STATPACK modules:

STATPACK modules and their contents
Module (file name)
Content
The_Kinds (Module_The_Kinds.F90)
Exports symbolic names for kinds of logical, integer and real/complex data types available at the hardware level
Select_Parameters (Module_Select_Parameters.F90)
Selects and exports parameterized logical (lgl), integer (i4b, …) and real/complex (stnd and extd) data types and other default parameters for the current version of STATPACK
Derived_Types (Module_Derived_Types.F90)
Defines and exports parameterized derived data types for sparse real and complex matrices of kind stnd and extd
Reals_Constants (Modules_Constants.F90)
Defines and exports names for almost all the literal real values of kind stnd and extd used in STATPACK
Logical_Constants (Modules_Constants.F90)
Defines and exports the logical constants true and false of kind lgl
Char_Constants (Modules_Constants.F90)
Exports character constants, strings and errors messages for routines available in STATPACK
Num_Constants (Modules_Constants.F90)
Exports constants and functions for the machine dependent constants of real type of kind stnd
Sort_Procedures (Module_Sort_Procedures.F90)
Exports sorting and ranking utilities for real and integer arrays of kind stnd and i4b
Print_Procedures (Module_Print_Procedures.F90)
Exports printing utilities
String_Procedures (Module_String_Procedures.F90)
Exports utilities for manipulating strings and character data
Time_Procedures (Module_Time_Procedures.F90)
Exports utilities for manipulating dates and time
Utilities (Module_Utilities.F90)
Exports simple computing routines (matrix multiplication, transposition, norms, …)
Random (Module_Random.F90)
Exports routines for random number and array generation, randomized linear algebra and related procedures
Giv_Procedures (Module_Giv_Procedures.F90)
Exports routines for computing and applying Givens rotations and reflections
Hous_Procedures (Module_Hous_Procedures.F90)
Exports routines for computing and applying Householder reflectors
QR_Procedures (Module_QR_Procedures.F90)
Exports routines for computing QR, QRCP and LQ decompositions and related factorizations/computations
EIG_Procedures (Module_EIG_Procedures.F90)
Exports routines for solving the symmetric eigenvalues/eigenvectors problem and related factorizations/computations. Both standard and randomized routines are available
SVD_Procedures (Module_SVD_Procedures.F90)
Exports routines for computing the Singular Value Decomposition of a matrix and related factorizations/computations. Both standard and randomized routines are available
Lin_Procedures (Module_Lin_Procedures.F90)
Exports routines for solving linear systems, computing the inverse and determinant of a matrix and related decompositions (LU, Cholesky, …)
LLSQ_Procedures (Module_LLSQ_Procedures.F90)
Exports routines for solving linear least square problems and related computations
Prob_Procedures (Module_Prob_Procedures.F90)
Exports routines for probability distribution functions and their inverses
Stat_Procedures (Module_Stat_Procedures.F90)
Exports routines for univariate statistical computations
Mul_Stat_Procedures (Module_Mul_Stat_Procedures.F90)
Exports routines for multivariate statistical computations
FFT_Procedures (Module_FFT_Procedures.F90)
Exports routines for (fast) Fourier transform computations
Time_Series_Procedures (Module_Time_Series_Procedures.F90)
Exports routines for time series analysis
BLAS_interfaces (Module_BLAS_interfaces.F90)
Exports generic interfaces for selected routines in the BLAS library
Lapack_interfaces (Module_Lapack_interfaces.F90)
Exports generic interfaces for selected routines in the LAPACK library
Statpack (Module_Statpack.F90)
Exports all the public entities available in STATPACK

The content of each STATPACK module and the purpose of the public entities exported by this module are fully described in the chapter STATPACK reference manual. For more information on the use of a specific routine available in STATPACK, you must consult the reference section for the module exporting the routine or the appropriate STATPACK manual for this module.

The sources subdirectory also contains the Fortran programs alphabet.f90, test_kind.F90 and mach_char.F90:

  • alphabet.f90 can be used for a simple check of your Fortran compiler. You can use this Fortran program as soon as you have built your own make.inc file, as described in the section Basic installation. To compile and execute this program, simply execute the following make command:

    $ make alphabet
    

    in the main STATPACK directory (e.g., in $STATPACKDIR) or sources subdirectory. This program will simply display the ASCII characters on the standard output of the program (e.g., the screen).

  • test_kind.f90 can be used to test and display informations on the different real/complex, integer and logical kind types available on your platform. You can use this Fortran program as soon as you have built your own make.inc file, as described in the section Basic installation. To compile and execute this program, simply execute the following make command:

    $ make test_kind
    

    in the main STATPACK directory (e.g., in $STATPACKDIR) or sources subdirectory. Informations about the available integer, real and logical kind types available on your computer at the hardware level and their properties will be displayed on the standard output of the program (e.g., the screen).

  • mach_char.f90 can be used to test and display detailed numerical properties of a specific real/complex kind type available at the hardware level on your computer. You can use this Fortran program as soon as you have built your own make.inc file, as described in the section Basic installation. To compile and execute this program, simply execute the following make command:

    $ make mach_char
    

    in the main STATPACK directory (e.g., in $STATPACKDIR) or sources subdirectory. By default, the program will determine the parameters of the floating-point arithmetic system for double-precision real/complex data, which is available on all platforms, and will display these parameters on the screen. In order to obtain information about machine-specific parameters for another real/complex kind type, it is necessary to edit the file mach_char.f90 and to comment out all but one of the following use statements, before compiling the program:

    !
    !   use The_Kinds, only : stnd=>sp
    !
    use The_Kinds, only : stnd=>dp
    !
    !   use The_Kinds, only : stnd=>qp
    !
    !   use The_Kinds, only : stnd=>low
    !
    !   use The_Kinds, only : stnd=>normal
    !
    !   use The_Kinds, only : stnd=>extended
    

The following make commands are available in the sources subdirectory to manage the STATPACK source code:

  • To create or update the library, enter the make command:

    $ make lib
    

    Alternatively, the make command:

    $ make
    

    without any arguments creates also the STATPACK library. The library is called lib$(LIB).a, where LIB is specified in your $STATPACKDIR/make.inc file.

  • To create a shared version of the library, enter the make command:

    $ make dynlib
    

    The shared library is installed in the directory that you have specified in DIRLIB defined in your $STATPACKDIR/make.inc file.

  • On some systems, you can force the source files to be recompiled by entering the make command:

    $ make lib FRC=FRC
    
  • To check the fortran syntax in a single module, for example the Hous_Procedures module in the Module_Hous_Procedures.F90, enter the make command:

    $ make Module_Hous_Procedures.check
    

    This make command will work properly only if you have defined properly the Shell variable CHECKFLAGS in your $STATPACKDIR/make.inc file.

  • To check the fortran syntax in all STATPACK modules, enter the make command:

    $ make check_all
    

    This make command will work properly only if you have defined properly the Shell variable CHECKFLAGS in your $STATPACKDIR/make.inc file.

  • Finally, to clean the sources subdirectory after building the library, enter the make command:

    $ make clean
    

tests directory

The subdirectory tests contains all the testing programs for the routines available in the STATPACK library.

The name of the test programs is determined by the STATPACK routine, which is tested by the program. As an illustration, the test program test_svd_cmp.F90 is the test program for the svd_cmp() STATPACK subroutine.

Instructions for running these test programs can be found in the header of the makefile in this subdirectory.

The following make commands are available in the tests subdirectory to compile/execute/manage the STATPACK test programs:

  • To see the list of all the test programs, enter the make command:

    $ make list
    
  • To compile and run a particular test program in this list, enter the make command (for example):

    $ make test_svd_cmp
    

    The program and the results are printed on the screen and stored in the current directory (e.g., tests) in the file named test_svd_cmp.output.

  • To run all the installation tests, enter the make command:

    $ make test_install
    

    Alternatively, the make command:

    $ make
    

    without any arguments runs also all the installation tests. The results of the tests are stored in the tests directory in the file named test_install.output.

  • Additional tests are available for some routines and can be performed by entering the make command:

    $ make test_more
    

    The results of these tests are stored in the tests directory in the file named test_more.output.

  • To see the list of all (test) programs which can be compiled in this directory, enter the make command:

    $ make list_compil
    
  • To compile a particular test program in this list, enter the make command (for example):

    $ make test_svd_cmp.compil
    

    The executable is generated in the current directory and is called a.out.

  • To clean the tests directory, enter the make command:

    $ make clean
    

examples directory

Many sample Fortran 95/2003 programs that illustrate the use of STATPACK routines are available in the examples subdirectory of the STATPACK directory. The name of the programs is determined by the STATPACK routine, whose use is illustrated by the program. As two illustrations, the program ex1_svd_cmp.F90 is the first example for the svd_cmp() STATPACK subroutine and the program ex1_lapack_ormtr.F90 is the first example of the generic interface ormtr() for the LAPACK subroutines sormtr(), dormtr(), cormtr() and zormtr() (see the description of the Lapack_interfaces module for more details).

Instructions for compiling and running these example programs can be found in the header of the makefile in this subdirectory.

The following make commands are available in the examples subdirectory to compile/execute/manage the STATPACK example programs:

  • To see the list of all the example programs, enter the make command:

    $ make list
    
  • To compile and run a particular example or program in this list, enter the make command (for example):

    $ make ex1_svd_cmp
    

    The program and the results are printed on the screen and stored in the current directory (e.g., examples) in the file named ex1_svd_cmp.output.

  • To see the list of all (example) programs which can be compiled in this directory, enter the make command:

    $ make list_compil
    
  • To compile a particular program in this list, enter the make command (for example):

    $ make ex1_svd_cmp.compil
    

    The executable is generated in the current directory and is called a.out

  • To clean the examples directory, enter the make command:

    $ make clean
    

You can also put your own Fortran 95/2003 programs using the STATPACK library in the examples subdirectory and use the above make commands to compile easily these programs without the need to create your own makefile. However, it it better to use the myprograms subdirectory described below for this purpose.

doc directory

The subdirectory doc contains some STATPACK documentation in different formats (e.g., pdf and html).

interfaces directory

The empty subdirectory interfaces can be used, at the user option, to store the .mod files generated by the compiler on some systems (e.g., NAGWare, RS6K/IBM, LINUX, Mac OSX machines). See the section Basic installation for more details on the possible use of this subdirectory.

makeincs directory

The subdirectory makeincs contains examples and templates of make.inc files for different compilers/machines, which can be useful to build your own make.inc file. See the section Basic installation for more details.

Templates are currently provided for the gfortran (make.inc.GNU), ifort (make.inc.INTEL), pgfortran (make.inc.PGI), xlf95 (make.inc.IBM) and nagfor (make.inc.NAG) compilers.

Some make.inc examples really used on some machines are also provided.

myprograms directory

You can put your own Fortran 95/2003 programs using the STATPACK library in the subdirectory myprograms. See the following chapter Using the STATPACK library for more details.

Flag Counter