aboutsummaryrefslogtreecommitdiff
path: root/src/msvmmaj_matrix.c
blob: 9e1be04e6f2d68aba88a87ac4493db4e05bea0af (plain)
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
/**
 * @file msvmmaj_matrix.c
 * @author Gertjan van den Burg
 * @date August, 2013
 * @brief Functions facilitating matrix access
 *
 * @details
 * The functions contained in this file are used when
 * accessing or writing to matrices. Seperate functions
 * exist of adding and multiplying existing matrix
 * elements, to ensure this is done in place.
 *
 */

#include "msvmmaj_matrix.h"
#include "util.h"

/**
 * @brief print a matrix
 * 
 * @details
 * Debug function to print a matrix
 *
 * @param[in] 	M 	matrix
 * @param[in] 	rows 	number of rows of M
 * @param[in] 	cols 	number of columns of M
 */
void print_matrix(double *M, long rows, long cols)
{
	long i, j;

	for (i=0; i<rows; i++) {
		for (j=0; j<cols; j++)
			note("%+6.6f ", matrix_get(M, cols, i, j));
		note("\n");
	}
	note("\n");
}