-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathmatrix_lib.hpp
More file actions
63 lines (51 loc) · 2.5 KB
/
matrix_lib.hpp
File metadata and controls
63 lines (51 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//------------------------------------------------------------------------------
//
// PROGRAM: Matrix library include file (function prototypes)
//
// HISTORY: Written by Tim Mattson, August 2010
// Modified by Simon McIntosh-Smith, September 2011
// Modified by Tom Deakin and Simon McIntosh-Smith, October 2012
// Updated to C++ Wrapper v1.2.6 by Tom Deakin, August 2013
// Modified to assume square matrices by Simon McIntosh-Smith, Sep 2014
//
//------------------------------------------------------------------------------
#ifndef __MATRIX_LIB_HDR
#define __MATRIX_LIB_HDR
//------------------------------------------------------------------------------
//
// Function to compute the matrix product (sequential algorithm, dot producdt)
//
//------------------------------------------------------------------------------
void seq_mat_mul_sdot(int N, std::vector<float> &A, std::vector<float> &B, std::vector<float> &C);
//------------------------------------------------------------------------------
//
// Function to initialize the input matrices A and B
//
//------------------------------------------------------------------------------
void initmat(int N, std::vector<float>& A, std::vector<float>& B, std::vector<float>& C);
//------------------------------------------------------------------------------
//
// Function to set a matrix to zero
//
//------------------------------------------------------------------------------
void zero_mat (int N, std::vector<float> &C);
//------------------------------------------------------------------------------
//
// Function to fill Btrans(Mdim,Pdim) with transpose of B(Pdim,Mdim)
//
//------------------------------------------------------------------------------
void trans(int N, std::vector<float>& B, std::vector<float>& Btrans);
//------------------------------------------------------------------------------
//
// Function to compute errors of the product matrix
//
//------------------------------------------------------------------------------
float error(int N, std::vector<float>& C);
//------------------------------------------------------------------------------
//
// Function to analyze and output results
//
//------------------------------------------------------------------------------
void results(int N, std::vector<float>& C, double run_time);
void results(int N, std::vector<float>& C1, std::vector<float>& C2, double run_time);
#endif