Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
5a31f6b4
Commit
5a31f6b4
authored
May 03, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok, so probably the failure in downhill simplex has been finally solved
parent
2ec92ba4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
downhill_simplex.cpp
modules/core/src/downhill_simplex.cpp
+0
-0
test_conjugate_gradient.cpp
modules/core/test/test_conjugate_gradient.cpp
+4
-4
No files found.
modules/core/src/downhill_simplex.cpp
View file @
5a31f6b4
This diff is collapsed.
Click to expand it.
modules/core/test/test_conjugate_gradient.cpp
View file @
5a31f6b4
...
...
@@ -58,7 +58,7 @@ static void mytest(cv::Ptr<cv::ConjGradSolver> solver,cv::Ptr<cv::MinProblemSolv
std
::
cout
<<
"--------------------------
\n
"
;
}
class
SphereF
:
public
cv
::
MinProblemSolver
::
Function
{
class
SphereF
_CG
:
public
cv
::
MinProblemSolver
::
Function
{
public
:
double
calc
(
const
double
*
x
)
const
{
return
x
[
0
]
*
x
[
0
]
+
x
[
1
]
*
x
[
1
]
+
x
[
2
]
*
x
[
2
]
+
x
[
3
]
*
x
[
3
];
...
...
@@ -69,7 +69,7 @@ public:
}
}
};
class
RosenbrockF
:
public
cv
::
MinProblemSolver
::
Function
{
class
RosenbrockF
_CG
:
public
cv
::
MinProblemSolver
::
Function
{
double
calc
(
const
double
*
x
)
const
{
return
100
*
(
x
[
1
]
-
x
[
0
]
*
x
[
0
])
*
(
x
[
1
]
-
x
[
0
]
*
x
[
0
])
+
(
1
-
x
[
0
])
*
(
1
-
x
[
0
]);
}
...
...
@@ -83,7 +83,7 @@ TEST(DISABLED_Core_ConjGradSolver, regression_basic){
cv
::
Ptr
<
cv
::
ConjGradSolver
>
solver
=
cv
::
ConjGradSolver
::
create
();
#if 1
{
cv
::
Ptr
<
cv
::
MinProblemSolver
::
Function
>
ptr_F
(
new
SphereF
());
cv
::
Ptr
<
cv
::
MinProblemSolver
::
Function
>
ptr_F
(
new
SphereF
_CG
());
cv
::
Mat
x
=
(
cv
::
Mat_
<
double
>
(
4
,
1
)
<<
50.0
,
10.0
,
1.0
,
-
10.0
),
etalon_x
=
(
cv
::
Mat_
<
double
>
(
1
,
4
)
<<
0.0
,
0.0
,
0.0
,
0.0
);
double
etalon_res
=
0.0
;
...
...
@@ -92,7 +92,7 @@ TEST(DISABLED_Core_ConjGradSolver, regression_basic){
#endif
#if 1
{
cv
::
Ptr
<
cv
::
MinProblemSolver
::
Function
>
ptr_F
(
new
RosenbrockF
());
cv
::
Ptr
<
cv
::
MinProblemSolver
::
Function
>
ptr_F
(
new
RosenbrockF
_CG
());
cv
::
Mat
x
=
(
cv
::
Mat_
<
double
>
(
2
,
1
)
<<
0.0
,
0.0
),
etalon_x
=
(
cv
::
Mat_
<
double
>
(
2
,
1
)
<<
1.0
,
1.0
);
double
etalon_res
=
0.0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment