home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ANUMR5.ZIP / ANUM.TXT < prev    next >
Text File  |  1991-11-26  |  17KB  |  472 lines

  1.  
  2.            DISCLAIMER - LICENCING AND SUPPORT POLICY
  3.  
  4.  
  5.  
  6.    This documentation is dated as of November 26, 1991.
  7.  
  8.  
  9.       ** PLEASE DO NOT SEND MONEY FOR THIS PACKAGE **
  10.  
  11.  
  12.    This is  NOT shareware! ANUM is good old fashioned Public
  13. Domain Software.  Source code,  totally written with Borland
  14. C++ 2.0  is not  included with  this archive for the reasons
  15. developped in the next section.
  16.  
  17.  
  18.    With release  5 here  are the Borland C++ 2.0 and Turbo C
  19. 1.5 ANUM  library files.  Actually, tests  have shown so far
  20. the application  code could  link with no major problem with
  21. TC++ standard  libraries. However,  for an  unknown  reason,
  22. execution time seems to be increased by nearly 10%.
  23.  
  24.  
  25.    Turbo C  2.0 version is again delivered back with release
  26. 4 of ANUM. I had to remove TC 2.0 from my previous hard disk
  27. to gain space. But as I have also changed of disk since them
  28. (from 40 Mbyte  to 334 Mbyte)  I am  able  to  support  both
  29. versions. I  have not  forgotten the  (not so  far ago) time
  30. when I was a student not earning a single coin, and for whom
  31. the buying  of a  compiler meant months of restrictions. The
  32. TC 1.5  version is  planned to be supported until the end of
  33. the year  while the TC 2.0 is until the end of 1993 and TC++
  34. version until  the end  of 1995.  (I presume that after five
  35. years of  existence, these  products may  be  considered  as
  36. obsolete).
  37.  
  38.  
  39.    While the  provided  functions  have  been  passed  to  a
  40. minimal test,  I will  have no liability or responsibilty to
  41. the user  or any  other person or entity with respect to any
  42. liability, loss  or damage  caused, or  alleged to be caused
  43. directly or  indirectly by  this library, including, but not
  44. limited to,  any interruption  of service, loss of business,
  45. anticipatory profits or consequential damages resulting from
  46. the use of this program.
  47.  
  48.  
  49.    Furthermore, although  this program  has been placed into
  50. the public  domain, I  retain all copyrights to this library
  51. around the  world. Pursuant to this, this library MAY NOT BE
  52. SOLD BY  ANY PARTY  unless specifically  authorized  by  the
  53. author, Jean-Marie  de Montarby,  in writing  prior  to  the
  54. first copy  being sold.  As well,  this program  MAY NOT  BE
  55. INCLUDED IN  OR USED  TO PRODUCE  ANY OTHER PACKAGE FOR SALE
  56. even if  this program  is indicated  as being 'in the public
  57. domain'. All  of the  above applies  to both the original as
  58. well as  derived or  modified copies  of the  original.  Any
  59. modified  copies   of  this   library  MUST  NOT  have  this
  60. documentation -including  its  copyright  notice-  violated,
  61. changed or altered.
  62.  
  63.  
  64.    Occasionally, if you want to use ANUM, or a port of it to
  65. some other  computers, in a commercial product, take contact
  66. with me first. We will perhaps find a deal.
  67.  
  68.  
  69.    Thus this  library, as  delivered here,  may only be used
  70. for personal and/or research and/or educational purposes.
  71.  
  72.  
  73.    Comments, bug  reports and  improvement  suggestions  are
  74. welcome and  should be adressed only to me. I can be reached
  75. at the following adresses:
  76.  
  77. Electronic mail: JMMàFRESTP11.BITNET (until... ?)
  78.  
  79. Normal mail : M. Jean-Marie de Montarby
  80.                40 avenue des Tilleuls
  81.                75016 PARIS
  82.                FRANCE
  83.  
  84.  
  85.    Do not  try to  phone me  at home. I am not registered in
  86. the phone listings and due to the possible jet lags I am not
  87. much happy when waked up in the middle of the night.
  88.  
  89.  
  90.    However during  working hours in France (UTC+1, UTC+2), I
  91. might be reached at my employer's:
  92.  
  93.  
  94.    DATAID Systèmes Techniques et Industriels
  95. Voice : +33 (1) 40.99.19.19.
  96.  
  97.  
  98.    Better use FAX, however : +33 (1) 40.99.06.85.
  99.  
  100.  
  101.    If you  wish to  do so,  you may  send me  in case  of  a
  102. presumed  bug,  a  copy  of  your  code.  However  I  cannot
  103. guarantee neither  a quick  response nor  the return of your
  104. media if a postal shipment.
  105.    Anum is  a yet (see next section) non-profitable piece of
  106. software and  I prefer  to work  harder on a paid job rather
  107. than on Anum.
  108.  
  109.  
  110.    As I  work since  Nov 5  1990, besides  my  current  very
  111. partial time job as teacher in the E.S.T.P, I cannot foresee
  112. yet any availability delays for the next release of Anum.
  113.                        GENERAL OVERVIEW
  114.  
  115.  
  116.  
  117.    I  have   since  July  1990  the  diploma  of  "Ingénieur
  118. Géomètre" from  the "Ecole  Spéciale des Travaux Publics, du
  119. Bâtiment et  de l'Industrie"  (E.S.T.P.). I  have planned to
  120. release in  three years  a major piece of software for micro
  121. computers which  will be  a commercial product. Do'nt ask me
  122. neither what  it is nor why this software will be, according
  123. to me,  somewhat revolutionnary. It could be compared to the
  124. introduction  of   Turbo Pascal  on   the  micro   computers
  125. programming  languages   market,  either   by  its   planned
  126. efficiency and financial impact.
  127.  
  128.  
  129.    This major  piece of  software requires several different
  130. fields of  the so-called  "art of  programming". One  of its
  131. aspect is  that it  will  extensively  use  mathematics  and
  132. scientific  number  crunching  algorithms.  I  am  currently
  133. developping  the   corresponding  functions   on  a  IBM  PC
  134. compatible under  MS-DOS which allows low-cost developpement
  135. at home.  For the  reasons  explained  at  the  end  of  the
  136. disclaimer section  I  cannot  spend  much  time  thoroughly
  137. testing those  functions. This  is why  I  decided  to  make
  138. public the  first functions  already  done.  More  functions
  139. should come  in the  future as this mathematical subroutines
  140. package is not yet complete.
  141.  
  142.  
  143.    ANUM is  a library  for use  with one  of the following C
  144. compilers:  Turbo C 2.0,  Turbo C++ 1.0  or  Borland C++ 2.0
  145. from Borland International. It provides several routines for
  146. use by  any programmer  interested  in  Numerical  Analysis.
  147. These routines  are thoroughly  explained further  in one of
  148. the following sections of this documentation.
  149.  
  150.  
  151.    A few  of these  routines are only of interest for Anum's
  152. own routines  but have  been left  as public as their use is
  153. shared by several functions in several modules. However they
  154. will remain  marked as  reserved  in  this  file.  Usage  of
  155. functions  with  similar  names  can  be  of  some  problem,
  156. especially if  the "warn duplicate symbol" toggle is not set
  157. active at link edit time.
  158.  
  159.  
  160.    To use the ANUM.LIB file, you should either.
  161. - specify its name in one of the line of your project file.
  162. - append it at the end of the command line if you use TCC or
  163.    BCC or  BCCX. Do not forget then to include the MATHL.LIB
  164.    file and  the coprocessor  chip or  emulator library file
  165.    depending on your system configuration.
  166.    Please refer  to Turbo  C manuals for more information on
  167. that topic.
  168.  
  169.  
  170.    ANUM code  is compiled  with word  data alignement  and a
  171. default signed  char type.  Consequently you  should  ensure
  172. your compiler  settings will  correspond to  this. Otherwise
  173. the result could be undefined.
  174.  
  175.  
  176.    ANUM  code   is  compiled   without  the   VROOM  overlay
  177. facilities (for  the TC++  and BC++ versions, of course). If
  178. you want a special copy of ANUM with them, send me a notice.
  179.  
  180.  
  181.    The ANUM.LIB file was created using Borland International
  182. library utility  TLIB. Its  version number  is 4.0  for BC++
  183. version, 3.0 for TC++ version and 2.0 for TC 2.0 version.
  184.  
  185.  
  186.    It is highly recommended ANSI prototyping be used in your
  187. programs making  use of  Anum. This is why, two header files
  188. are also  provided to  include in  your  own  routines.  The
  189. SYSIO.H file contains declarations for the error and warning
  190. messages interface,  whilst the  ANUM.H file  contains those
  191. relevant to  numerical codification  of errors  and warnings
  192. and of the other routines.
  193.  
  194.  
  195.    A special  effort has been made to keep the interface for
  196. parameters  passings   quite  close   to  the  one  used  by
  197. Borland International Turbo Pascal Numerical Toolbox to help
  198. those of  you who  would like to port their already existing
  199. applications from  Pascal to  C. In  fact, most  of the high
  200. level functions  of Anum  use the  same algorithm  than  the
  201. Numerical Toolbox.  This is  due to the fact that they offer
  202. quite a  wide coverage  of usual  numerical analysis  within
  203. quite a  few routines,  and it  is quite  important when one
  204. starts writing its own numerical toolbox.
  205.                           CONVENTIONS
  206.  
  207.  
  208.  
  209.    The following conventions are applied:
  210. All of  the functions  present in  the  library,  which  are
  211.    documented  here,   follow  the   C   parameter   calling
  212.    conventions and have been provided for use with the LARGE
  213.    memory  model   exclusively.  The   only  near  functions
  214.    provided here  are of  the static  class and then totally
  215.    hidden to the application programmer.
  216. No function  returns any  pointers allocated. Some functions
  217.    may allocate  space for  temporary  items.  But  this  is
  218.    hidden to  the application  programmer and space is freed
  219.    at the  end of  the routine.  It  is  hereby  up  to  the
  220.    programmer to  allocate the  necessary amount of space by
  221.    using the  farcalloc function before calling any function
  222.    of the  present library.  Rows and  columns are  numbered
  223.    from 1 unless explicitely stated.
  224. Polynomial indexation  strictly follows  the following rule:
  225.    The degree  is always  increasing i.e.  *poly  points  to
  226.    poly[0], *(poly+1) points to poly[1] and so on.
  227. Matrices are  indexed as follows: the first index is the row
  228.    index, the second is the column one just as the classical
  229.    way C handles arrays.
  230. The typedef'ed  COMPLEX type  is required to use some of the
  231.    provided routines  dealing with complex arithmetic. It is
  232.    defined in the ANUM.H header file.
  233. All real values in the Anum library are of the type double.
  234. All Anum  error codes  take negative  values. A  zero  value
  235.    indicates there is no error.
  236.                        PROVIDED ROUTINES
  237.  
  238.  
  239.  
  240.    For each provided routine, you will find:
  241. the function prototype,
  242. a short description of what it performs,
  243. its input and output parameters,
  244. a list of its possible error code values,
  245. its value on return if any.
  246.  
  247.  
  248.    To ensure  coherence and  because prior releases suffered
  249. poor documentation,  this part of the documentation has been
  250. transferred to the header files (ANUM.H and SYSIO.H).
  251.                     ERROR AND WARNING CODES
  252.  
  253.  
  254.  
  255.    Here are  a few  of the  possible returnes error codes. A
  256. more complete  list is given in the "anum.h" file. I promise
  257. I will  include it in the next release of ANUM documentation
  258. :-). It  is sometimes  no joke working until 2 a.m. on a non
  259. paid job ;-).
  260.  
  261.  
  262.  
  263.  ETOLLE0
  264.  
  265. Class : Error
  266. Cause :  The called  routine was  given a  nil  or  negative
  267.    tolerance value.
  268. User's Response  : Correct the 'tol' parameter to a strictly
  269.    positive value.
  270.  
  271.  
  272.  EOVERMAXITER
  273.  
  274. Class : Error
  275. Cause :  An iterative  function could  not find the solution
  276.    within 'maxiter' iterations.
  277. User's Response  : Set  the 'maxiter' parameter to a greater
  278.    value or check the algorithm will converge with the given
  279.    approximate values  of the solution or assume there is no
  280.    solution.
  281.  
  282.  
  283.  ENULLSLOPE
  284.  
  285. Class : Error
  286. Cause  :  The  user  function  attempted  to  use  a  Newton
  287.    algorithm with a point, the slope of the function is zero
  288.    at which.
  289. User's  Response   :  Choose  another  parameter  value  for
  290.    approximate value of the root.
  291.  
  292.  
  293.  WCPLXROOTS
  294.  
  295. Class : Warning
  296. Cause :  A function  solving real polynomes could not find a
  297.    number of  real roots  equal to its degree. This polynome
  298.    could possibly have one or more complex roots.
  299. User's Response  : Use  a routine giving al so complex roots
  300.    or set the 'maxiter' parameter to a greater value.
  301.  
  302.  
  303.  EYSAMESIGN
  304.  
  305. Class : Error
  306. Cause :  The bisection  algorithm was  given two  bounds the
  307.    values of which are of the same sign.
  308. User's Response  : Correct one of the bounds. Check if there
  309.    is at  least one  root between the bounds or assume there
  310.    is no solution.
  311.  
  312.  
  313.  EMAXITERLT0
  314.  
  315. Class : Error
  316. Cause :  An iterative routine was given a negative value for
  317.    the maximum number of iterations as parameter.
  318. User's Response  :  Input  a  positive  value  as  'maxiter'
  319.    parameter. A  nil value will only be suitable if you want
  320.    to treat  only cases  for  which  a  trivial  and  direct
  321.    solution exists.
  322.  
  323.  
  324.  ENOPXINTERSECT
  325.  
  326. Class : Error
  327. Cause : The computed parabola does not intersect the X axis.
  328.  
  329.  
  330.  EDIMLT0
  331.  
  332. Class : Error
  333. Cause : A function attempted to use a negative length vector
  334.    or a negative order square matrix.
  335. User's Response  : Change  the dim  parameter or  check your
  336.    polynome is not totally deflated.
  337.  
  338.  
  339.  EMATSING
  340.  
  341. Class : Error
  342. Cause : A routine attempted to invert a singular matrix.
  343.  
  344.  
  345.  EDIMLE0
  346.  
  347. Class : Error
  348. Cause :  A function  attempted to  use a  negative  or  zero
  349.    length vector or a negative or zero order square matrix.
  350. User's Response  : Change  the dim  parameter or  check your
  351.    polynome is not totally deflated.
  352.  
  353.  
  354.  E0DIVIDE
  355.  
  356. Class : Error
  357. Cause : A function attempted to do a division by zero.
  358.  
  359.  EDEGLT2
  360.  
  361. Class : Error
  362. Cause :  The selected  algorithm  requires  a  polynome  the
  363.    degree of which is at least two.
  364. User's Response  : Check your calling function for errors or
  365.    try to use a direct solving method.
  366.  
  367.  
  368.  ENOWCORE
  369.  
  370. Class : Error
  371. Cause :  There is  not enough  working core  for one  of the
  372.    routine to allocate its working arrays.
  373. User's  Response   :  Try  to  free  some  main  storage  by
  374.    eliminating  Terminate-and-Stay-Resident   programs.  Use
  375.    overlays if  your compilers  allows them. Check your code
  376.    for unused stuff.
  377.  
  378.  
  379.  EDEGLE0
  380.  
  381. Class : Error
  382. Cause :  A function  attempted to  use a  negative  or  zero
  383.    degree polynomial.
  384. User's Response  : Check passed arguments or try to directly
  385.    solve a  trivial case  (if degree  is nil  or  polynomial
  386.    equals 0).
  387.  
  388.  
  389.  ENUMINTLE0
  390.  
  391. Class : Error
  392. Cause : The given number of arguments passed to a routine is
  393.    lower than or equal to 0.
  394.                  HISTORY LOG - CHANGES TO COME
  395.  
  396.    From first to second release
  397. Fixed a bug concerning a hardwire coded error in the Newton-
  398.    Raphson algorithm.
  399.  
  400. Added :
  401.    steffensen function
  402.    laguerre function
  403.    ena_beep function
  404.    ena_warn function
  405.    ena_err function
  406.    ena_m_beep
  407.    disa_m_beep
  408.  
  409.  
  410.    The five  last functions allow or disable sytem generated
  411. warning or messages and the audible tone associated to it.
  412.  
  413.  
  414.    Not  to   cause  some   "vapourware"  announces   and  as
  415. programming generates  unexpected delays,  no date  is given
  416. for the next release of Anum.
  417.  
  418.  
  419.    From second to third release
  420. Fixed severe  bug in  swap_rows function  giving some random
  421.    results with inverse and determinant functions.
  422. Added : a whole bunch of new functions.
  423.  
  424.  
  425.    From third to fourth release
  426. Fixed severe  bug in  swap_rows function  giving some random
  427.    results with inverse and determinant functions.
  428. Added  :  (lsq,  eigen_vector,  householder_givens,  jacobi,
  429.    le_verrier).
  430. Added :  C/C++ support,  ANUM release 4 routines should link
  431.    without problem  with C++  modules. This  is achieved  by
  432.    suppressing automatically type checking at link edit time
  433.    (See the  #ifdef compilation  directives  in  ANUM.H  and
  434.    SYSIO.H).
  435. In release  4.1, fixed  a bug affecting the inverse function
  436.    and the jacobi method due to a wrong parameter passing in
  437.    row_mat_div.  Solved   an  ambiguity  in  the  eigen_vect
  438.    routine. fixed a (very minor) bug in testlib.bat.
  439.  
  440.  
  441.    In the next release of this package:
  442. Changes  of  the  interface  to  support  Turbo  Pascal  are
  443.    considered. This  would primarily  affect  the  parameter
  444.    calling conventions.
  445. Microsoft compilers  are too slow, require too much space on
  446.    the secondary  storage, are  too user  unfriendly and too
  447.    expansive for me to forecast any support yet.
  448. More functions are to come out, of course. Especially in the
  449.    differential equations  solving and interpolation fields.
  450.    A better  documentation will  also arise, especially from
  451.    your comments.
  452.  
  453.  
  454.    Thanks to :
  455. CFGROP at WEIZMANN.BITNET
  456. ROSSBACH at DMRHRZ11.BITNET
  457. C3DOUTRE at FRECCL11.BITNET
  458. m_rives at paris.paris.ingr.com
  459. USERGB3W at UMICHUM.BITNET
  460.  
  461.  
  462.    for support and/or suggestions.
  463.  
  464.  
  465.                           Contents
  466.  
  467.  
  468.    
  469.  
  470.  
  471.    
  472.