home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 344_01 / mtx.c < prev    next >
Text File  |  1991-05-29  |  2KB  |  62 lines

  1. /*-----------------------------------------------------------------------
  2.    Program : mtx.exe
  3.  
  4.    Author  : Bill Forseth
  5.              1405 8th Ave N
  6.              Fargo, ND  58102
  7.              (701) 239-0150
  8.  
  9.    Purpose - 1. Solves A|b matricies using Gauss-Jordan elimination.
  10.              2. Output adjustable, suitable for indirection
  11.  
  12.    Syntax  - mtx < input_data_file N [options]
  13.  
  14.              where : input_data_file contains an N(N+1)
  15.                        matrix in A|b form of integers or reals
  16.                      N is the size of one column
  17.                      [options]
  18.                        -s   (display the solution only)
  19.                        -pn  (n is the precision - defaults to 2)
  20.  
  21.              When used in conjunction with 'randmtx' the following syntax
  22.              is suggested:
  23.  
  24.                 randmtx n | mtx n [opts] > out_file
  25.  
  26.    Files : mtx.c,.h     : main calling module and global defines
  27.            mtxcle.c,.h, : command line, error handling
  28.            mtxio.c,.h,  : allocation, initialization,output display
  29.            mtxsolv.c,.h : G-J computations
  30.  
  31.            randmtx.c    : creates a random, variable n(n+1) matrix
  32.                           (seperate executable program)
  33.  
  34.    Compiler : Torbo C, v.2.0 (IDE)
  35.    Switches : small model,
  36.               8086 instruction set,
  37.               floating point emulation,
  38.               word alingment,
  39.               all debug info off,
  40.               register optimization
  41.  
  42.    Updates - 1/4/91  - created
  43.              2/25/91 - optimized, modularized
  44.              5/29/91 - cleaned up, expanded
  45. -------------------------------------------------------------------------*/
  46. #include "mtxcle.h"
  47. #include "mtxio.h"
  48. #include "mtxsolv.h"
  49.  
  50. extern int display_all;
  51.  
  52. main(int argc, char **argv)
  53. {
  54.   get_args(argc,argv);
  55.   read_matrix();
  56.   print_matrix(display_all ? SHOW_MATRIX : NO_SHOW);
  57.   solve_matrix();
  58.   print_matrix(display_all ? SHOW_MATRIX : SOLUTION_ONLY);
  59.  
  60.   return 0;
  61. }
  62.