README 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Date: Wed, 27 Sep 2000 15:41:24 +0000
  2. From: David D Gray <ddgray@armadce.demon.co.uk>
  3. I have checked in the gmath stuff to CVS. This directory might later
  4. contain other kinds of generic routine (fft is one that comes to mind in
  5. view of the investigations into NR). But for now there is only the
  6. BLAS/LAPACK wrappers and supporting structure in la.c.
  7. I thought to follow the libc in separating maths stuff to a separate
  8. directory, even though they are G_*() functions.
  9. I believe it is fairly intuitive to use - developers should use
  10. G_matrix_init() to create a matrix. A vector can be built with setting
  11. cols (or rows as appropriate) to 1. A G_vector_init() might be useful,
  12. but it would have to distinguish between a row and column vector, (is it
  13. needed?). Then use G_[set,get]_matrix_element() to set or retrieve
  14. elements. No-one should need to ever worry about Fortran peculiarities
  15. (like declaring doublereal variables, or calling a foo_() ).
  16. Currently there are: add matrices A+B (doesn't use BLAS), multiply A.B,
  17. invert A^-1, solve simple linear system A.X=B for X given B. Others are
  18. easy to add as required.
  19. David
  20. -----------------------------------
  21. Getting BLAS/LAPACK (one package):
  22. http://netlib.bell-labs.com/netlib/master/readme.html
  23. http://www.netlib.org
  24. http://www.netlib.org/lapack/
  25. Compiling of LAPACK (be sure to have "." in PATH):
  26. Linux:
  27. cd LAPACK
  28. cp INSTALL/make.inc.LINUX make.inc
  29. #now edit Makefile and
  30. #comment line 11 and uncomment line 12 (to include "blaslib" compilation)
  31. #compile with
  32. make
  33. Solaris:
  34. cd LAPACK
  35. cp INSTALL/make.inc.SUN4SOL2 make.inc
  36. #now edit Makefile and
  37. #comment line 11 and uncomment line 12 (to include "blaslib" compilation)
  38. #compile with
  39. make
  40. etc.
  41. See INSTALL/ for further platforms.
  42. --------------------------------------------------------------------
  43. Usage:
  44. Sample Makefile:
  45. MODULE_TOPDIR = /path/to/grass
  46. PGM = test
  47. LIBES = $(GMATHLIB) $(GISLIB)
  48. DEPENDENCIES = $(GMATHLIB) $(GISLIB)
  49. include $(MODULE_TOPDIR)/include/Make/Module.make
  50. Sample module source:
  51. #include <grass/config.h>
  52. #include <grass/gis.h>
  53. #include <grass/gmath.h>
  54. int main (int argc, char *argv[])
  55. {
  56. mat_struct *matrix;
  57. matrix = G_matrix_init (3, 3, 1);
  58. G_matrix_free (matrix);
  59. return 0;
  60. }