Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
459c16ca
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
459c16ca
编写于
7月 19, 2013
作者:
A
Alex Leontiev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor fixes
In request to the comments for the pull request.
上级
6db2596c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
21 deletion
+24
-21
modules/optim/include/opencv2/optim.hpp
modules/optim/include/opencv2/optim.hpp
+3
-2
modules/optim/src/lpsolver.cpp
modules/optim/src/lpsolver.cpp
+21
-15
modules/optim/src/precomp.hpp
modules/optim/src/precomp.hpp
+0
-2
modules/optim/test/test_precomp.hpp
modules/optim/test/test_precomp.hpp
+0
-2
未找到文件。
modules/optim/include/opencv2/optim.hpp
浏览文件 @
459c16ca
...
...
@@ -43,11 +43,12 @@
#ifndef __OPENCV_OPTIM_HPP__
#define __OPENCV_OPTIM_HPP__
//uncomment the next line to print the debug info
//#define ALEX_DEBUG
#include "opencv2/core.hpp"
#include <iostream>
namespace
cv
{
namespace
optim
{
using
namespace
std
;
//!the return codes for solveLP() function
enum
{
...
...
modules/optim/src/lpsolver.cpp
浏览文件 @
459c16ca
#include "opencv2/ts.hpp"
#include "precomp.hpp"
#include <climits>
#include <algorithm>
#include <cstdarg>
#define ALEX_DEBUG
namespace
cv
{
namespace
optim
{
using
std
::
vector
;
using
namespace
std
;
#ifdef ALEX_DEBUG
#define dprintf(x) printf x
static
void
print_matrix
(
const
Mat
&
x
){
printf
(
"
\t
type:%d vs %d,
\t
size: %d-on-%d
\n
"
,(
x
).
type
(),
CV_64FC1
,(
x
).
rows
,(
x
).
cols
);
for
(
int
i
=
0
;
i
<
(
x
).
rows
;
i
++
){
printf
(
"
\t
type:%d vs %d,
\t
size: %d-on-%d
\n
"
,
x
.
type
(),
CV_64FC1
,
x
.
rows
,
x
.
cols
);
if
(
!
true
){
//cout<<x;
}
else
{
for
(
int
i
=
0
;
i
<
x
.
rows
;
i
++
){
printf
(
"
\t
["
);
for
(
int
j
=
0
;
j
<
(
x
)
.
cols
;
j
++
){
printf
(
"%g, "
,
(
x
)
.
at
<
double
>
(
i
,
j
));
for
(
int
j
=
0
;
j
<
x
.
cols
;
j
++
){
printf
(
"%g, "
,
x
.
at
<
double
>
(
i
,
j
));
}
printf
(
"]
\n
"
);
}
}
}
static
void
print_simplex_state
(
const
Mat
&
c
,
const
Mat
&
b
,
double
v
,
const
std
::
vector
<
int
>
N
,
const
std
::
vector
<
int
>
B
){
printf
(
"
\t
print simplex state
\n
"
);
printf
(
"v=%g
\n
"
,
(
v
)
);
printf
(
"v=%g
\n
"
,
v
);
printf
(
"here c goes
\n
"
);
print_matrix
(
(
c
)
);
print_matrix
(
c
);
printf
(
"non-basic: "
);
for
(
std
::
vector
<
int
>::
const_iterator
it
=
(
N
).
begin
()
;
it
!=
(
N
)
.
end
();
++
it
){
for
(
std
::
vector
<
int
>::
const_iterator
it
=
N
.
begin
()
;
it
!=
N
.
end
();
++
it
){
printf
(
"%d, "
,
*
it
);
}
printf
(
"
\n
"
);
printf
(
"here b goes
\n
"
);
print_matrix
(
(
b
)
);
print_matrix
(
b
);
printf
(
"basic: "
);
for
(
std
::
vector
<
int
>::
const_iterator
it
=
(
B
).
begin
()
;
it
!=
(
B
)
.
end
();
++
it
){
for
(
std
::
vector
<
int
>::
const_iterator
it
=
B
.
begin
()
;
it
!=
B
.
end
();
++
it
){
printf
(
"%d, "
,
*
it
);
}
printf
(
"
\n
"
);
}
#else
#define dprintf(x)
do {} while (0)
#define print_matrix(x)
do {} while (0)
#define print_simplex_state(c,b,v,N,B)
do {} while (0)
#define dprintf(x)
#define print_matrix(x)
#define print_simplex_state(c,b,v,N,B)
#endif
/**Due to technical considerations, the format of input b and c is somewhat special:
...
...
@@ -199,13 +207,11 @@ static int initialize_simplex(Mat_<double>& c, Mat_<double>& b,double& v,vector<
for
(
int
I
=
1
;
I
<
old_c
.
cols
;
I
++
){
if
((
iterator
=
std
::
find
(
N
.
begin
(),
N
.
end
(),
I
))
!=
N
.
end
()){
dprintf
((
"I=%d from nonbasic
\n
"
,
I
));
fflush
(
stdout
);
int
iterator_offset
=
iterator
-
N
.
begin
();
c
(
0
,
iterator_offset
)
+=
old_c
(
0
,
I
);
print_matrix
(
c
);
}
else
{
dprintf
((
"I=%d from basic
\n
"
,
I
));
fflush
(
stdout
);
int
iterator_offset
=
std
::
find
(
B
.
begin
(),
B
.
end
(),
I
)
-
B
.
begin
();
c
-=
old_c
(
0
,
I
)
*
b
.
row
(
iterator_offset
).
colRange
(
0
,
b
.
cols
-
1
);
v
+=
old_c
(
0
,
I
)
*
b
(
iterator_offset
,
b
.
cols
-
1
);
...
...
modules/optim/src/precomp.hpp
浏览文件 @
459c16ca
...
...
@@ -43,8 +43,6 @@
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include "opencv2/core.hpp"
#include "opencv2/core/mat.hpp"
#include "opencv2/optim.hpp"
#endif
modules/optim/test/test_precomp.hpp
浏览文件 @
459c16ca
...
...
@@ -9,8 +9,6 @@
#ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__
#include "opencv2/core.hpp"
#include "opencv2/core/mat.hpp"
#include "opencv2/ts.hpp"
#include "opencv2/optim.hpp"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录