Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张一极
Edge Computing Engine
提交
5a840026
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 搜索 >>
提交
5a840026
编写于
4月 17, 2020
作者:
sahduashufa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0417
上级
07eb57ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
12 deletion
+5
-12
conv_.cpp
conv_.cpp
+1
-1
ma
ma
+0
-0
matrix/matrix_pro.h
matrix/matrix_pro.h
+4
-7
welcome/score_wel.cpp
welcome/score_wel.cpp
+0
-4
未找到文件。
conv_.cpp
浏览文件 @
5a840026
...
...
@@ -17,7 +17,7 @@ double duration;
int
main
()
{
welcome
();
cout
_mat
(
conv_test
(
CreateRandMat
(
3
,
3
),
1
,
2
))
;
cout
<<
(
conv_test
(
CreateRandMat
(
3
,
3
),
1
,
2
))
<<
endl
;
return
0
;
}
\ No newline at end of file
ma
浏览文件 @
5a840026
无法预览此类型文件
matrix/matrix_pro.h
浏览文件 @
5a840026
...
...
@@ -62,8 +62,6 @@ Matrix subtract(Matrix mid1,Matrix mid2)
{
for
(
int
j
=
0
;
j
<
mid1
.
col
;
j
++
)
{
//cout<<" mid1.matrix[i][j]"<< mid1.matrix[i][j]<<"mid2.matrix[i][j]"<<mid2.matrix[i][j]<<endl;
result_subtract
.
matrix
[
i
][
j
]
=
mid1
.
matrix
[
i
][
j
]
-
mid2
.
matrix
[
i
][
j
];
}
}
...
...
@@ -242,7 +240,7 @@ Matrix iloc(Matrix mid1,int start_x=0,int end_x=0,int start_y=0,int end_y=0)
{
end_x
=
mid1
.
row
;
}
cout
<<
mid1
.
row
<<
end_x
<<
" "
<<
start_x
<<
" "
<<
end_y
<<
" "
<<
start_y
<<
endl
;
//
cout<<mid1.row<<end_x<<" "<<start_x<<" "<<end_y<<" "<<start_y<<endl;
int
new_row
=
end_x
-
start_x
;
int
new_col
=
end_y
-
start_y
;
// cout<<"nc"<<new_col<<" nr"<<new_row<<endl;
...
...
@@ -251,8 +249,6 @@ Matrix iloc(Matrix mid1,int start_x=0,int end_x=0,int start_y=0,int end_y=0)
{
for
(
int
index_y
=
start_y
;
index_y
<
end_y
;
++
index_y
)
{
// cout<<"start: "<<index_x<<",end: "<<index_y<<endl;
// cout<<"re: "<<mid1.matrix[index_x][index_y]<<endl;
mid_return
.
matrix
[
index_x
-
start_x
][
index_y
-
start_y
]
=
mid1
.
matrix
[
index_x
][
index_y
];
}
}
...
...
@@ -341,12 +337,13 @@ Matrix get_row(Matrix mid1,int index)
}
return
mid2
;
}
Matrix
conv_test
(
Matrix
mid1
,
int
stride
=
1
,
int
kernel_size
=
3
)
double
conv_test
(
Matrix
mid1
,
int
stride
=
1
,
int
kernel_size
=
3
)
{
Matrix
kernel
=
CreateRandMat
(
kernel_size
,
kernel_size
);
cout_mat
(
kernel
);
Matrix
crop_pic
=
iloc
(
mid1
,
0
,
kernel
.
col
,
0
,
kernel
.
row
);
Matrix
result
=
mul
(
crop_pic
,
kernel
);
cout_mat
(
crop_pic
);
double
result
=
matrix_sum
(
mul_simple
(
crop_pic
,
kernel
));
return
result
;
}
#endif
welcome/score_wel.cpp
浏览文件 @
5a840026
...
...
@@ -8,17 +8,13 @@
#define random(x) (rand()%x)
using
namespace
std
;
int
welcome
(){
cout
<<
"----------"
;
cout
<<
"Hello This is Edge"
<<
"----------"
<<
endl
;
fstream
input_stream
;
const
char
*
candidates
[]
=
{
"./welcome/2.txt"
,
"./welcome/3.txt"
,
"./welcome/big.txt"
};
srand
((
unsigned
int
)
time
(
NULL
));
input_stream
.
open
(
candidates
[
rand
()
%
3
],
ios
::
in
);
cout
<<
"new"
<<
input_stream
.
is_open
()
<<
endl
;
char
input
[
1000000
];
int
cnt
=
0
;
if
(
input_stream
.
is_open
()){
cout
<<
"yes
\n
"
;
while
(
!
input_stream
.
eof
()){
input_stream
.
getline
(
input
,
999
);
cout
<<
input
<<
endl
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录