-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplexMatrixOperations.h
44 lines (25 loc) · 1.42 KB
/
complexMatrixOperations.h
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
/**
* @file complexMatrixOperations.h
* @author Melih Altun @2015-2017
**/
#if !defined (_C_MATRIX_OPS_H_)
#define _C_MATRIX_OPS_H_
#include "complexNumbers.h"
#include <string.h>
#include <stdlib.h>
#define lin_index(i, j, numCol) ( ((i)*(numCol))+(j) ) //2D to 1D array
void copyComplexMatrix(complex in[], unsigned int N, unsigned int M, complex out[]);
void double2complex (double in[], unsigned int N, unsigned int M, complex out[]);
void hermitian(complex in[], unsigned int N, unsigned int M, complex out[]);
void complexTranspose(complex in[], unsigned int N, unsigned int M, complex out[]);
void complexIdentity(complex matrix[], int size);
double absMaxElement(complex in[], unsigned int N, unsigned int M);
double complexVectorNorm(complex V[], unsigned int N);
void complexVectorSubtraction(complex V1[], complex V2[], unsigned int N, complex U[]);
void complexScalarMultiplication(complex V[], complex alpha, unsigned int N, unsigned int M, complex U[]);
void complexMatrixMultiplication(complex M1[], complex M2[], unsigned int N, unsigned int K, unsigned int M, complex Mout[]);
void complexMatrixSubtraction(complex M1[], complex M2[], unsigned int N, unsigned int M, complex Mout[]);
void complexMatrixConjungate(complex in[], unsigned int N, unsigned int M, complex out[]);
void complexDiagonal(complex M[], unsigned int N, complex D[]);
void complexDiagonal2Vector(complex D[], unsigned int N, complex M[]);
#endif