User Tools

Site Tools


haas:spring2014:sysprog:projects:matrixmult3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
haas:spring2014:sysprog:projects:matrixmult3 [2013/12/25 11:01] – created wedgehaas:spring2014:sysprog:projects:matrixmult3 [2014/02/20 13:44] (current) wedge
Line 1: Line 1:
-======Matrix Multiplier Part II====== +======Matrix Multiplier Part II: Altering Program Behavior via Configuration======
-- read through getopt(3) manual page +
-- compile, run, and figure out getopt.c example +
-- implement both file output and getopt options in your matrix multiplier+
  
-options to implement+=====Overview===== 
---------------------- +One aspect of writing an effective application is flexibility- what are the expected behaviors of the program, and how can we enable the widest range of configuration changes without needing to recompile the code? 
--h/-?/--help        display usage information (arguments) + 
--o file/--out file  specify output file for resultant matrix +As far as run-time configuration goes, there are two options immediately available to us
--m/--mirror         extra: options on 2nd matrix the same on 1st  + 
--v/--verbose        display what is going on +  * read settings from a configuration file 
--q/--quiet          don't output anything +  * specify settings via the command-line 
--V/--version        display version information + 
--M #                matrix1's row count +Now we get to explore the further implementation of these concepts. 
--N #                matrix1's col count / matrix2's row count + 
--P #                matrix2's col count +=====Command-Line Arguments===== 
--1 file/--in1 file  specify input file for matrix1 +Many of you have likely encountered some aspects of accessing the command-line, typically through setting and using parameters in the **main()** function (via the venerable and oft-named **argc** and **argv** variables), but even then, we often kept things simple as the nature of parsing arguments can add complexity. 
--2 file/--in2 file  specify input file for matrix2+ 
 +Luckily, functionality exists which does the bulk of the parsing work for us, so we will familiarized ourselves with that. It is known as **getopt()**, and it has a manual page. So: 
 + 
 +  * read through **getopt(3)** manual page (remember what the **3** indicates and how to make use of it?) 
 +  * compile, run, analyze, and figure out the code samples found in that manual page 
 +  * implement both file output and getopt options in your matrix multiplier 
 + 
 +===options to implement=== 
 +  * -h/-?/--help        display usage information (arguments) 
 +  -o file/--out file  specify output file for resultant matrix 
 +  -m/--mirror         extra: options on 2nd matrix the same on 1st  
 +  -v/--verbose        display more of what is going on 
 +  -q/--quiet          don't output anything 
 +  -V/--version        display version information 
 +  -M #                matrix1's row count 
 +  -N #                matrix1's col count / matrix2's row count 
 +  -P #                matrix2's col count 
 +  -1 file/--in1 file  specify input file for matrix1 
 +  -2 file/--in2 file  specify input file for matrix2
haas/spring2014/sysprog/projects/matrixmult3.1387969263.txt.gz · Last modified: 2013/12/25 11:01 by wedge