annotate Matrix_Mult.h @ 12:1461ed1901cc

update to common ancestor (VirtProcr to SlaveVP) and updated include paths
author Some Random Person <seanhalle@yahoo.com>
date Fri, 09 Mar 2012 22:21:26 -0800
parents ca572fdc9a80
children a8a3d98e1af4
rev   line source
Me@10 1 /*
Me@10 2 * Copyright Oct 24, 2009 OpenSourceStewardshipFoundation.org
Me@10 3 * Licensed under GNU General Public License version 2
Me@10 4 */
Me@10 5
Me@10 6 #ifndef MATRIX_MULT_H_
Me@10 7 #define MATRIX_MULT_H_
Me@10 8
Me@10 9 #include <stdio.h>
Me@10 10 #include <unistd.h>
Me@10 11 #include <malloc.h>
Me@10 12
seanhalle@12 13 #include "VMS_impl/VMS_primitive_data_types.h"
seanhalle@12 14 #include "ParamHelper/Param.h"
Me@10 15
Me@10 16 //============================== Structures ==============================
Me@10 17
Me@10 18 typedef
Me@10 19 struct
Me@10 20 { int32 numRows;
Me@10 21 int32 numCols;
Me@10 22 float32 *array; //2D, but dynamically sized, so use addr arith
Me@10 23 }
Me@10 24 Matrix;
Me@10 25
Me@10 26 /* This is the "appSpecificPiece" that is carried inside a DKUPiece.
Me@10 27 * In the DKUPiece data struc it is declared to be of type "void *". This
Me@10 28 * allows the application to define any data structure it wants and put it
Me@10 29 * into a DKUPiece.
Me@10 30 * When the app specific info is used, it is in app code, so it is cast to
Me@10 31 * the correct type to tell the compiler how to access fields.
Me@10 32 * This keeps all app-specific things out of the DKU directory, as per the
Me@10 33 * DKU standard. */
Me@10 34 typedef
Me@10 35 struct
Me@10 36 {
Me@10 37 // pointers to shared data.. the result matrix must be created when the
Me@10 38 // left and right matrices are put into the root ancestor DKUPiece.
Me@10 39 Matrix * leftMatrix;
Me@10 40 Matrix * rightMatrix;
Me@10 41 Matrix * resultMatrix;
Me@10 42
Me@10 43 // define the starting and ending boundaries for this piece of the
Me@10 44 // result matrix. These are derivable from the left and right
Me@10 45 // matrices, but included them for readability of code.
Me@10 46 int prodStartRow, prodEndRow;
Me@10 47 int prodStartCol, prodEndCol;
Me@10 48 // Start and end of the portion of the left matrix that contributes to
Me@10 49 // this piece of the product
Me@10 50 int leftStartRow, leftEndRow;
Me@10 51 int leftStartCol, leftEndCol;
Me@10 52 // Start and end of the portion of the right matrix that contributes to
Me@10 53 // this piece of the product
Me@10 54 int rightStartRow, rightEndRow;
Me@10 55 int rightStartCol, rightEndCol;
Me@10 56 }
Me@10 57 MatrixProdPiece;
Me@10 58
Me@10 59 //============================== Functions ================================
Me@10 60 void readFile();
Me@10 61
Me@10 62 Matrix *makeMatrix( int32 numRows, int32 numCols );
Me@10 63 Matrix *makeMatrix_Flat( int32 numRows, int32 numCols );
Me@10 64 Matrix *makeMatrix_WithResMat( int32 numRows, int32 numCols );
Me@10 65 void freeMatrix_Flat( Matrix * matrix );
Me@10 66 void freeMatrix( Matrix * matrix );
Me@10 67 void printMatrix( Matrix *matrix );
Me@10 68
Me@10 69 void read_Matrix_From_File( Matrix *matrixStruc, char *matrixFileName );
Me@10 70
Me@10 71 void
Me@10 72 initialize_Input_Matrices_Via( Matrix **leftMatrix, Matrix **rightMatrix,
Me@10 73 ParamBag *paramBag );
Me@10 74
Me@10 75 //===========================================================================
Me@10 76
Me@10 77 #endif /*MATRIX_MULT_H_*/