![]() |
Description of the "Matrix operations" program | ||
|
"Matrix operations" is a batch program written in C. It can perform 8 different matrix operations. The actual operation can be selected by command line parameters. Depending on the chosen operation the program reads one or two matrix(es) from input files called "INPUT1" and "INPUT2" (case sensitive). The program always generates one result matrix in a file called "OUTPUT" (case sensitive). An input or an output file is plain ASCII file that represents one matrix in the following format:
For example the following input / output matrix
The binary executable program and two sample input matrix files can be downloaded from here: The binary executable can be controlled by command line parameters. At most 3 parameters can be specified for an execution: Operation_code [Operation_specific_parameter] [V]An operation code, a parameter depending on the chosen operation, an optional V (verbose) flag
In verbose mode the program writes its input matrix(es), the selected operation and the result matrix to the standard output. The result matrix is always written into the file called "OUTPUT". The supported matrix operations and the corresponding command line parameters are the following:
E.g. to multiply the INPUT1 and INPUT2 matrixes into an OUTPUT matrix the program must be started as (on Linux platform): ./matrix_operations M or ./matrix_operations M VSupposed that matrix_operations, INPUT1 and INPUT2 files are available in the current working directory. The OUTPUT matrix file will be created by the program in the working directory as well. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||