home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / libblas / intro_blas.z / intro_blas
Encoding:
Text File  |  2002-10-03  |  12.6 KB  |  252 lines

  1. INTRO_BLAS(3F)                                        Last changed: 11-2-98
  2.  
  3.  
  4. NNAAMMEE
  5.      IINNTTRROO__BBLLAASS - Introduction to Basic Linear Algebra Subprograms
  6.  
  7. IIMMPPLLEEMMEENNTTAATTIIOONN
  8.      See the individual man pages for implementation details
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      BLAS is a library of routines that perform basic operations involving
  12.      matrices and vectors. They were designed as a way of achieving
  13.      efficiency in the solution of linear algebra problems. The BLAS, as
  14.      they are now commonly called, have been very successful and have been
  15.      used in a wide range of software, including LINPACK, LAPACK and many
  16.      of the algorithms published by the ACM Transactions on Mathematical
  17.      Software. They are an aid to clarity, portability, modularity and
  18.      maintenance of software, and have become the de facto standard for
  19.      elementary vector and matrix operations.
  20.  
  21.      The BLAS promote modularity by identifying frequently occurring
  22.      operations of linear algebra and by specifying a standard interface to
  23.      these operations.  Efficiency is achieved through optimization within
  24.      the BLAS without altering the higher-level code references them.
  25.  
  26.      There are three levels of BLAS:
  27.  
  28.      * Level 1: The original set of BLAS, commonly referred as the Level 1
  29.        BLAS, perform low-level operations such as dot-product and the
  30.        adding of a multiple of one vector to another.
  31.  
  32.        Typically these operations involve O(_n) floating point operations
  33.        and O(_n) data items moved (loaded or stored), where _n is the length
  34.        of the vectors. The Level 1 BLAS permit efficient implementation on
  35.        scalar machines, but the ratio of floating-point operations to data
  36.        movement is too low to be effective on most vector or parallel
  37.        hardware.
  38.  
  39.      * Level 2: The Level 2 BLAS perform matrix-vector operations that
  40.        occur frequently in the implementation of many of the most common
  41.        linear algebra algorithms.
  42.                                  2
  43.        These routines involve O(_n ) floating point operations. Algorithms
  44.        that use Level 2 BLAS can be very efficient on vector computers, but
  45.        are not well suited to computers with a hierarchy of memory (such as
  46.        cache memory).
  47.  
  48.      * Level 3:  The Level 3 BLAS are targeted at matrix-matrix operations.
  49.                        3                                                2
  50.        They involve O(_n ) floating point operations, but only create O(_n )
  51.        data movement. These operations permit efficient reuse of data that
  52.        resides in cache and create what is often called the surface-to-
  53.        volumne effect for the ratio of computations to data movement. In
  54.        addition, matrices can be partitioned into blocks, and operations on
  55.        distinct blocks can be performed in parallel, and within the
  56.        operations on each block, scalar or vector operations may be
  57.        performed in parallel.
  58.  
  59.      BLAS2 and BLAS3 modules are optimized and parallelized to take
  60.      advantage of Silicon Graphics' RISC parallel architecture. The best
  61.      performances are achieved for BLAS3 routines (for exmaple, DDGGEEMM) where
  62.      outer-loop unrolling and blocking techniques were applied to take
  63.      advantage of the memory cache. The performance of BLAS2 routines (for
  64.      example, DDGGEEMMVV) is sensitive to the size of the problem; for large
  65.      sizes the high rate of cache miss slows down the algorithms.
  66.  
  67.      LAPACK algorithms use (preferably_ BLAS3 modules and are the most
  68.      efficient.  LINPACK uses only BLAS1 modules and therefore is less
  69.      efficient than LAPACK.
  70.  
  71.      To link with lliibbbbllaass, ff7777 to load all the Fortran Libraries required;
  72.      otherwise include --llffttnn in your link line.  For R8000 and R10000 based
  73.      machines, use the MMIIPPSS44 version by using the --mmiippss44 option when
  74.      linking, as in this example:
  75.  
  76.           f77 -mips4
  77.           -o foobar.out foo.o bar.o
  78.           -lblas
  79.  
  80.      To use the parallelized version, use the --mmiippss44 option as follows:
  81.  
  82.           f77 -mips4 -mp
  83.           -o foobar.out foo.o bar.o
  84.           -lblas_mp
  85.  
  86.    IInnccrreemmeenntt aarrgguummeennttss
  87.      A vector's description consists of the name of the array (_x or _y)
  88.      followed by the storage spacing (increment) in the array of vector
  89.      elements (_i_n_c_x or _i_n_c_y).  The increment can be positive or negative.
  90.      When a vector _x consists of _n elements, the corresponding actual array
  91.      arguments must be of a length at least 1+(_n-1)*|_i_n_c_x| .  For a
  92.      negative increment, the first element of _x is assumed to be _x(1+(_n-1)*
  93.      |_i_n_c_x|) .  The standard specification of __SSCCAALL, __NNRRMM22, __AASSUUMM, and
  94.      II__AAMMAAXX does not define their behavior for negative increments, so this
  95.      functionality is an extension to the standard BLAS.
  96.  
  97.      Setting an increment argument to 0 can cause unpredictable results.
  98.  
  99.    MMuullttiippllee rroouuttiinnee mmaann ppaaggeess
  100.      Many of the routines are available in real (single-precision),
  101.      complex, double precision and double complex versions.  Often little
  102.      or no difference exists between these versions, other than the data
  103.      types of some inputs and outputs.  In this case, the routines are
  104.      described on the same man page, and that man page is named after the
  105.      real or complex routine.
  106.  
  107.      The following data types are used in these routines:
  108.  
  109.      * RREEAALL: Fortran "real" data type, 32-bit floating point; these routine
  110.        names begin with SS.
  111.  
  112.      * CCOOMMPPLLEEXX: Fortran "complex" data type, two 32-bit floating point
  113.        reals; these routine names begin with CC.
  114.  
  115.      * DDOOUUBBLLEE PPRREECCIISSIIOONN: Fortran "double precision" data type, 64-bit
  116.        floating point; these routine names begin with DD.
  117.  
  118.      * DDOOUUBBLLEE CCOOMMPPLLEEXX: Fortran "double complex" data type, two 64-bit
  119.        floating point doubles; these routine names begin with ZZ.
  120.  
  121.      The mmaann(1) command can find a man page online by either the real,
  122.      complex, double precision, or double complex name.
  123.  
  124.      The following table describes the naming conventions for these
  125.      routines:
  126.  
  127.      -------------------------------------------------------------
  128.                                                        64-bit
  129.                                                        complex
  130.                            64-bit real                 (double
  131.                            (double       32-bit        complex
  132.              32-bit real   precision)    complex       precision)
  133.      -------------------------------------------------------------
  134.      form:   SS_n_a_m_e         DD_n_a_m_e        CC_n_a_m_e         ZZ_n_a_m_e
  135.      example:SSAAXXPPYY         DDAAXXPPYY        CCAAXXPPYY         ZZAAXXPPYY
  136.      -------------------------------------------------------------
  137.  
  138.    FFoorrttrraann ttyyppee ddeeccllaarraattiioonn ffoorr ffuunnccttiioonnss
  139.      Always declare the data type of external functions.  Declaring the
  140.      data type of the complex Level 1 BLAS functions is particularily
  141.      important because, based on the first letter of their names and the
  142.      Fortran data typing rules, the default implied data type would be
  143.      REAL.
  144.  
  145. SSuummmmaarryy ooff rroouuttiinneess
  146.      The following tables list the available BLAS routines.
  147.  
  148.    BBLLAASS LLeevveell 11
  149.  -------------------------------------------------------------------------
  150.  Function                Prefix and suffix (if provided)     Man page name
  151.  -------------------------------------------------------------------------
  152.  dot product              ss--   dd--   cc--uu   cc--cc  zz--uu   zz--cc   ddoott
  153.  yy == aa**xx ++ yy              ss--   dd--         cc--         zz--    aaxxppyy
  154.  setup Givens rotation    ss--   dd--                          rroottgg
  155.  apply Givens rotation    ss--   dd--         ccss--        zzdd--   rroott
  156.  copy x into y            ss--   dd--         cc--         zz--    ccooppyy
  157.  swap x and y             ss--   dd--         cc--         zz--    sswwaapp
  158.  Euclidean norm           ss--   dd--         sscc--        ddzz--   nnrrmm22
  159.  sum of absolute values   ss--   dd--         sscc--        ddzz--   aassuumm
  160.  xx == aa**xx                  ss--   dd--   ccss--   cc--   zzdd--   zz--    ssccaall
  161.  index of max abs value  iiss--   iidd--        iicc--        iizz--   aammaaxx
  162.  -------------------------------------------------------------------------
  163.  
  164.    BBLLAASS LLeevveell 22
  165.      In the following tables, these abbreviations are used:
  166.  
  167.      MMVV   Matrix vector multiply
  168.  
  169.      RR    Rank one update to a matrix
  170.  
  171.      RR22   Rank two update to a matrix
  172.  
  173.      SSVV   Solving certain triangular matrix problems.
  174.  
  175.   single precision Level 2 BLAS     |     Double precision Level 2 BLAS
  176.   -----------------------------------------------------------------------
  177.           MV   R    R2  SV          |             MV   R    R2  SV
  178.   SGE     x    x                    |     DGE     x    x
  179.   SGB     x                         |     DGB     x
  180.   SSP     x    x    x               |     DSP     x    x    x
  181.   SSY     x    x    x               |     DSY     x    x    x
  182.   SSB     x                         |     DSB     x
  183.   STR     x              x          |     DTR     x              x
  184.   STB     x              x          |     DTB     x              x
  185.   STP     x              x          |     DTP     x              x
  186.  
  187.   complex  Level 2 BLAS             | Double precision complex Level 2 BLAS
  188.   -----------------------------------------------------------------------
  189.           MV   R     RC   RU  R2  SV|          MV   R     RC   RU  R2  SV
  190.   CGE     x          x    x         |  ZGE     x          x    x
  191.   CGB     x                         |  ZGB     x
  192.   CHE     x    x              x     |  ZHE     x    x              x
  193.   CHP     x    x              x     |  ZHP     x    x              x
  194.   CHB     x                         |  ZHB     x
  195.   CTR     x                       x |  ZTR     x                       x
  196.   CTB     x                       x |  ZTB     x                       x
  197.   CTP     x                       x |  ZTP     x                       x
  198.  
  199.    BBLLAASS LLeevveell 33
  200.      In the following tables, these abbreviations are used:
  201.  
  202.      MMMM   Matrix matrix multiply
  203.  
  204.      RRKK   Rank-k update to a matrix
  205.  
  206.      R2K  Rank-2k update to a matrix
  207.  
  208.      SSMM   Solving triangular matrix with many right-hand-sides.
  209.  
  210.   single precision Level 3 BLAS     |     Double precision Level 3 BLAS
  211.   -----------------------------------------------------------------------
  212.           MM   RK   R2K SM          |             MM   RK   R2K SM
  213.   SGE     x                         |     DGE     x
  214.   SSY     x    x    x               |     DSY     x    x    x
  215.   STR     x              x          |     DTR     x              x
  216.  
  217.   complex  Level 3 BLAS             | Double precision complex Level 3 BLAS
  218.   -----------------------------------------------------------------------
  219.           MM   RK   R2K SM          |             MM   RK   R2K SM
  220.   CGE     x                         |     ZGE     x
  221.   CSY     x    x    x               |     ZSY     x    x    x
  222.   CHE     x    x    x               |     ZHE     x    x    x
  223.   CTR     x              x          |     ZTR     x              x
  224.  
  225. FFIILLEESS
  226.      //uussrr//lliibb//lliibbbbllaass..aa
  227.      //uussrr//lliibb//lliibbbbllaass__mmpp..aa
  228.      //uussrr//iinncclluuddee//ccbbllaass..hh
  229.  
  230. NNOOTTEESS
  231.      lliibbbbllaass does not currently support reshaped arrays.
  232.  
  233. SSEEEE AALLSSOO
  234.      S.P. Datardina, J.J. Du Croz, S.J. Hammarling and M.W. Pont, "A
  235.      Proposed Specification of BLAS Routines in C", NAG Technical Report
  236.      TR6/90.
  237.  
  238.      Lawson, C., Hanson, R., Kincaid, D., and Krogh, F., "Basic Linear
  239.      Algebra Subprograms for Fortran Usage," _A_C_M _T_r_a_n_s_a_c_t_i_o_n_s _o_n
  240.      _M_a_t_h_e_m_a_t_i_c_a_l _S_o_f_t_w_a_r_e,
  241.       5 (1979),
  242.      pp. 308 - 325.
  243.  
  244.      J.Dongarra, J.DuCroz, S.Hammarling, and R.Hanson, "An extended set of
  245.      Fortran Basic Linear Algebra Subprograms", ACM Trans. on Math. Soft.
  246.      14, 1(1988) 1-32
  247.  
  248.      J.Dongarra, J.DuCroz, I.Duff,and S.Hammarling, "An set of level 3
  249.      Basic Algebra Subprograms", ACM Trans on Math Soft( Dec 1989)
  250.  
  251.      This man page is available only online.
  252.