+/EE312

software design

git clone https://git.julia.blue/+/EE312

Joseph RyanAdd Project 1 and start Project 2f830e85

master
1.4 KiB44 linesraw
1/*
2 * MatrixMultiply.h
3 *
4 * function declarations (prototypes) and global variable declarations
5 * for the Matrix Multiplication project
6 */
7
8#ifndef _MatrixMultiply_h
9#define _MatrixMultiply_h 1
10
11/* typedef can be used to create a type alias. The statement:
12 *		typedef oldType newType;
13 * makes newType into an alias of oldType. oldType must actually be a type (e.g., int, double, double*)
14 * and newType must be a name (e.g., int32_t, IEEEFloat, PtrDouble)
15 * 
16 * I'm creating an alias for double* 
17 * I'm naming that alias PtrDouble
18 * in that way, I can use the name PtrDouble whenever I need a pointer to a double
19 * That makes it much easier for me to declare and work with arrays of pointers to doubles
20 * i.e., the matrix list is an array
21 * each element in the array is a pointer
22 * and each pointer points to the first element (a double) in a matrix
23 * so the matrix list is an array of PtrDouble elements, 
24 * hence PtrDouble matrix_list[]
25 */
26typedef double* PtrDouble;
27
28void multiplyMatrices(double a[], const unsigned a_rows, const unsigned a_cols,
29										  double b[], const unsigned b_cols,
30										  double c[]);
31
32double** multiplyMatricesPtr(
33        double** a,
34        const uint32_t a_rows,
35        const uint32_t a_cols,
36        double** b,
37        const uint32_t b_cols);
38
39double** transposeMatrix(
40         double** a,
41         const uint32_t a_rows,
42         const uint32_t a_cols);
43
44#endif