home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / n / newmat06.zip / NEWMATC.TXT < prev    next >
Text File  |  1992-12-03  |  2KB  |  37 lines

  1. //$$ newmatc.txt                                      Testing
  2.  
  3.                     Testing newmat on your compiler
  4.                     ===============================
  5.  
  6. There are a series of files of the form tmt?.cxx included with some
  7. versions of the package. These are used to check that the package is
  8. performing correctly. They consist of a large number of matrix formulae
  9. all of which evaluate to zero (except the first one which is used to
  10. check that we are detecting non-zero matrices). The printout should
  11. state that it has found one non-zero matrix.
  12.  
  13. There is an optional #define DO_FREE_CHECK in include.h. If this is
  14. activated the program will check that the new-s and delete-s are
  15. balanced. There should be no unbalanced new-s or delete-s. You need the
  16. ANSI version of the preprocessor to run DO_FREE_CHECK.
  17.  
  18. The program also allocates and deletes a large block and small block of
  19. memory before it starts the main testing and then at the end of the
  20. test. It then checks that the blocks of memory were allocated in the
  21. same place. If not then one suspects that there has been a memory leak.
  22. i.e. a piece of memory has been allocated and not deleted.
  23.  
  24. This is not completely foolproof. Programs may allocate extra print
  25. buffers while the program is running. I have tried to overcome this by
  26. doing a print before I allocate the first memory block. Programs may
  27. allocate memory for different sized items in different places, or might
  28. not allocate items consecutively. Or they might mix the items with memory
  29. blocks from other programs. Nevertheless, I seem to get consistent
  30. answers from most of the compilers I am working with, so I think this is
  31. a worthwhile test.
  32.  
  33. Gnu 2.2 and Zortech do not pass this test. There may be good reasons for
  34. this, but I think it would be a good idea if the authors of these
  35. packages made sure they knew what was happening.
  36.  
  37.