MathMatrix.h
来源:互联网 发布:星际淘宝网第488章 编辑:程序博客网 时间:2024/05/17 13:12
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//// MathMatrix.h//// Created by RetVal on 7/7/12.// Copyright (c) 2012 RetVal. All rights reserved.// #ifndef MathMatrix_h#define MathMatrix_h#include "RtlServicesMacro.h"struct_RtlRectangle{ RtlUInteger row; RtlUInteger column;};typedefstruct _RtlRectangle RtlRectangle;typedefRtlRectangle* RtlRectangleRef;struct_RtlMatrix{ RtlFloat** base; RtlRectangle info;}; typedefstruct _RtlMatrix RtlMatrix;typedefRtlMatrix* RtlMatrixRef; #ifndef MathMakeRectangleX#define MathMakeRectangleXRtlInline RtlRectangle MathMakeRectangle(RtlUInteger row, RtlUInteger column){ RtlRectangle rr; rr.row = row; rr.column = column; returnrr;}#endif #ifndef RtlDoubleMatrixChange#define RtlDoubleMatrixChange(a,b) RtlReserved#endif#include "MathError.h" #pragma mark Create Methods RtlExport RtlMatrixRef MathMatrixCreate(RtlMatrixRef matrix,RtlUInteger row,RtlUInteger column);RtlExport RtlMatrixRef MathMatrixCreateEMatrix(RtlMatrixRef matrix,RtlUInteger row);RtlExport RtlMatrixRef MathMatrixCopy(RtlMatrixRef matrix); #pragma mark Free Method RtlExportvoid MathMatrixFree(RtlMatrixRef matrix); #pragma mark Size Methods RtlExport RtlUInteger MathMatrixGetRow(RtlMatrixRef matrix);RtlExport RtlUInteger MathMatrixGetColumn(RtlMatrixRef matrix);RtlExport RtlFloat MathMatrixGetContent(RtlMatrixRef matrix, RtlUInteger row, RtlUInteger column);RtlExportvoid MathMatrixSetContent(RtlMatrixRef matrix, RtlUInteger row, RtlUInteger column,RtlFloat n);RtlExport RtlRectangle MathMatrixGetMulSize(RtlMatrixRef matrix1, RtlMatrixRef matrix2);#pragma mark Check Methods//Check if the size of matrix1 is equal to matrix2.(row, column)RtlExportBOOL MathMatrixIsEqualSize(RtlMatrixRef matrix1,RtlMatrixRef matrix2);//Check if the matrix1 is equal to matrix2.RtlExportBOOL MathMatrixIsEqual(RtlMatrixRef matrix1,RtlMatrixRef matrix2);RtlExportBOOL MathMatrixIsSquare(RtlMatrixRef matrix);RtlExportBOOL MathMatrixIsCanMul(RtlMatrixRef matrix1,RtlMatrixRef matrix2);#pragma mark Calculate Methods// the result is stored in the return matrix, should call MathMatrixFree to release it when you done. // matrix(return) = matrix1 + matrix2RtlExport RtlMatrixRef MathMatrixAdd(RtlMatrixRef matrix1,RtlMatrixRef matrix2);// matrix(return) = matrix1 - matrix2RtlExport RtlMatrixRef MathMatrixSub(RtlMatrixRef matrix1,RtlMatrixRef matrix2);// matrix(return) = matrix1 * matrix2 (result is not equal to matrix2 * matrix1)RtlExport RtlMatrixRef MathMatrixMul(RtlMatrixRef matrix1,RtlMatrixRef matrix2);#pragma mark Transpose Method RtlExport RtlMatrixRef MathMatrixTranspose(RtlMatrixRef matrix); #pragma mark Calculate Row Methods/* MathMatrixDivRow matrix[rowSelector]/n */RtlExport MathError MathMatrixRowDiv(RtlMatrixRef matrix,RtlUInteger rowSelector,RtlFloat n);/* MathMatrixMulRow matrix[rowSelector]*n */RtlExport MathError MathMatrixRowMul(RtlMatrixRef matrix,RtlUInteger rowSelector,RtlFloat n); /* MathMatrixMulRow matrix[rowSelector]+n */RtlExport MathError MathMatrixRowAdd(RtlMatrixRef matrix,RtlUInteger rowSelector,RtlFloat n); /* MathMatrixMulRow matrix[rowSelector]-n */RtlExport MathError MathMatrixRowSub(RtlMatrixRef matrix,RtlUInteger rowSelector,RtlFloat n); /* MathMatrixRowDivWithRow matrix[rowSelectorAdd] += matrix[rowSelector]/n */RtlExport MathError MathMatrixRowDivWithRow(RtlMatrixRef matrix,RtlUInteger rowSelectorAdd,RtlUInteger rowSelector,RtlFloat n); /* MathMatrixRowMulWithRow matrix[rowSelectorAdd] += matrix[rowSelector]*n */RtlExport MathError MathMatrixRowMulWithRow(RtlMatrixRef matrix,RtlUInteger rowSelectorAdd,RtlUInteger rowSelector,RtlFloat n); #endif
- MathMatrix.h
- h
- h
- h
- ,h
- h
- h
- H
- h
- h
- h
- H
- h
- H
- H
- h
- H
- H
- poj 2838 Sliding Window
- wince 驱动发送广播消息
- hadoop namenode format做了什么?
- 几种位操作的相关算法
- 你的第一个iOS应用(二) 入门指南
- MathMatrix.h
- 《C++标准程序库》第六章摘录与笔记
- ORA-00604 and ORA-12705: Cannot access NLS data files or invalid environment specified
- VNC
- 计算机的异常控制:中断、陷阱、故障、终止、进程上下文切换、信号
- 在单片机中, 64 位整数除以 32 位整数
- 深入理解Flash Player的安全域
- 在windows下运行Felzenszwalb的Discriminatively Trained Deformable Part Models matlab代码
- SecureCRT的几个技巧