-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
75 lines (71 loc) · 2 KB
/
common.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
/*
* =====================================================================================
*
* Filename: common.h
*
* Description:
*
* Version: 1.0
* Created: 2016년 11월 24일 12시 47분 34초
* Revision: none
* Compiler: gcc
*
* Author: Ph.D. Candidate KIM Hyeok (kh), [email protected]
* Company: Konkuk University
*
* =====================================================================================
*/
#include <stdio.h>
#ifndef __common_h__
#define __common_h__
typedef double real;
extern char *txtCorr;
int fwrite_matrix( FILE *fout, real **m, int xsize, int ysize, real *rt, real *ct);
typedef struct {
real R, I;
} Cmplx;
/*!
* \brief struct for complex real value
*/
typedef struct {
real xx,xy,xz;
real yx,yy,yz;
real zx,zy,zz;
} Rank2R3;
typedef struct {
real x,y,z;
} VecR3;
void real_tensor_setIdentity_r2(Rank2R3*);
void real_tensor_copy_r1r1(VecR3*,VecR3*);
real real_tensor_dot_r1r1(VecR3*,VecR3*);
void real_tensor_copy_r2r2(Rank2R3*,Rank2R3*);
void real_tensor_product_r1_r0r1(VecR3*,real,VecR3*);
void real_tensor_projection_r2_r1(Rank2R3*,VecR3*);
void real_tensor_product_r2_r1r1( Rank2R3* ,
VecR3 *r1a, VecR3* ) ;
void real_tensor_product_r2_r2r2( Rank2R3* ,
Rank2R3 *, Rank2R3* ) ;
void real_tensor_scale_r2( Rank2R3* ,
real );
void real_tensor_product_r2_r0r2( Rank2R3* ,
real , Rank2R3*) ;
void real_tensor_add_r1_r1r1( VecR3* ,
VecR3*, VecR3* ) ;
void real_tensor_add_r2_r2r2( Rank2R3* ,
Rank2R3*, Rank2R3* ) ;
void real_tensor_sub_r2_r2r2( Rank2R3* ,
Rank2R3 *, Rank2R3* ) ;
void real_tensor_increase_r1_r1( VecR3* ,
VecR3* ) ;
void real_tensor_increase_r2_r2( Rank2R3* ,
Rank2R3* ) ;
void real_tensor_decrease_r2_r2( Rank2R3* ,
Rank2R3* ) ;
void real_tensor_zero_r2( Rank2R3* );
void real_tensor_zero_r1( VecR3* );
real real_tensor_avg_dig_r2(Rank2R3*);
real real_tensor_avg_offdig_r2(Rank2R3*);
real real_tensor_sum_dig_r2(Rank2R3*);
real real_tensor_sum_offdig_r2(Rank2R3*);
#endif