Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张一极
Edge Computing Engine
提交
d7881362
Edge Computing Engine
项目概览
张一极
/
Edge Computing Engine
通知
61
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Edge Computing Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d7881362
编写于
11月 17, 2019
作者:
sahduashufa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0.3
上级
0da2f10b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
3 deletion
+44
-3
README.md
README.md
+39
-0
ma
ma
+0
-0
main.cpp
main.cpp
+5
-2
matrix/matrix_pro.cpp
matrix/matrix_pro.cpp
+0
-1
未找到文件。
README.md
浏览文件 @
d7881362
...
...
@@ -4,6 +4,45 @@
## 0.1 矩阵定义:
api:
Create a matrix : create(row,cols)
Change the element for matrix void move_ele(int &ele1, int &ele2)
Matrix1+Matrix2 : Matrix add(Matrix mid1,Matrix mid2,int flag=1)
Flag is how to compete the ele ,default 1 ,bitwise operation.
flag标志,默认为1,使用位运算,在亿万级数据下,位运算平均速度优于其他方法,故而做了实现,深入理解.
Matrix1-Matrix2 : Matrix subtract(Matrix mid1,Matrix mid2)
Matrix1
*
Matrix2 : Matrix mul(Matrix mid1,Matrix mid2)
Matrix1
*
n : Matrix times_mat(int times,Matrix mid1)
Matrix1's Transposition : Matrix get_T(Matrix mid1)
double
*
flatten(Matrix mid1)
| 1 | 2 | 3 |
| :--: | :--: | :--: |
| 2 | 4 | 6 |
| 7 | 8 | 9 |
To
| 1 | 2 | 3 | 2 | 4 | 6 | 7 | 8 | 9 |
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| | | | | | | | | |
Flatten:
一些细节:
1.
创建矩阵,默认为1^n
2.
动态分配内存,防止矩阵过大
3.
可修改的地方(已完成)
...
...
ma
浏览文件 @
d7881362
无法预览此类型文件
main.cpp
浏览文件 @
d7881362
...
...
@@ -12,15 +12,18 @@ using namespace std;
int
main
()
{
welcome
();
Matrix
a
=
CreateMatrix
(
3
,
4
);
Matrix
a
=
CreateMatrix
(
5
,
6
);
Matrix
b
=
CreateMatrix
(
3
,
11
);
cout
<<
"end"
<<
endl
;
change_va
(
a
,
1
,
2
,
1
);
change_va
(
a
,
2
,
3
,
7
);
change_va
(
a
,
3
,
3
,
2
);
change_va
(
a
,
4
,
3
,
4
);
change_va
(
a
,
0
,
0
,
9
);
change_va
(
a
,
0
,
2
,
2
);
change_va
(
a
,
1
,
1
,
8
);
start
=
clock
();
Matrix
rs
=
matrix_rs
(
a
,
2
,
6
);
Matrix
rs
=
matrix_rs
(
a
,
6
,
5
);
cout
<<
matrix_mean
(
a
)
<<
endl
;
/* add(a,b,1);
mul(a,b);
...
...
matrix/matrix_pro.cpp
浏览文件 @
d7881362
...
...
@@ -139,7 +139,6 @@ Matrix matrix_rs(Matrix mid1,int rs_row,int rs_col)
int
index_x
=
i
/
mid1
.
col
;
int
index_y
=
i
%
mid1
.
col
;
*
(
p
+
i
)
=
mid1
.
matrix
[
index_x
][
index_y
];
// cout<<index_x<<","<<index_y<<*(p+i)<<endl;
}
int
added
=
mid1
.
row
*
mid1
.
col
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录