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
9ac3a351
Commit
9ac3a351
authored
Apr 25, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use Lapack anymore
parent
8a54967e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
19 deletions
+22
-19
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+4
-4
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+9
-9
lapack.cpp
modules/core/src/lapack.cpp
+0
-0
test_math.cpp
modules/core/test/test_math.cpp
+9
-6
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
9ac3a351
...
...
@@ -427,25 +427,25 @@ inline size_t Mat::total() const
inline
uchar
*
Mat
::
ptr
(
int
y
)
{
CV_DbgAssert
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
]
);
CV_DbgAssert
(
y
==
0
||
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
])
);
return
data
+
step
.
p
[
0
]
*
y
;
}
inline
const
uchar
*
Mat
::
ptr
(
int
y
)
const
{
CV_DbgAssert
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
]
);
CV_DbgAssert
(
y
==
0
||
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
])
);
return
data
+
step
.
p
[
0
]
*
y
;
}
template
<
typename
_Tp
>
inline
_Tp
*
Mat
::
ptr
(
int
y
)
{
CV_DbgAssert
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
]
);
CV_DbgAssert
(
y
==
0
||
(
data
&&
dims
>=
1
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
])
);
return
(
_Tp
*
)(
data
+
step
.
p
[
0
]
*
y
);
}
template
<
typename
_Tp
>
inline
const
_Tp
*
Mat
::
ptr
(
int
y
)
const
{
CV_DbgAssert
(
dims
>=
1
&&
data
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
]
);
CV_DbgAssert
(
y
==
0
||
(
data
&&
dims
>=
1
&&
data
&&
(
unsigned
)
y
<
(
unsigned
)
size
.
p
[
0
])
);
return
(
const
_Tp
*
)(
data
+
step
.
p
[
0
]
*
y
);
}
...
...
modules/core/include/opencv2/core/operations.hpp
View file @
9ac3a351
...
...
@@ -683,10 +683,10 @@ Matx<_Tp, m, n> Matx<_Tp, m, n>::mul(const Matx<_Tp, m, n>& a) const
}
CV_EXPORTS
int
LU
(
float
*
A
,
int
m
,
float
*
b
,
int
n
);
CV_EXPORTS
int
LU
(
double
*
A
,
int
m
,
double
*
b
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
float
*
A
,
int
m
,
float
*
b
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
double
*
A
,
int
m
,
double
*
b
,
int
n
);
CV_EXPORTS
int
LU
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
int
LU
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
template
<
typename
_Tp
,
int
m
>
struct
CV_EXPORTS
Matx_DetOp
...
...
@@ -694,7 +694,7 @@ template<typename _Tp, int m> struct CV_EXPORTS Matx_DetOp
double
operator
()(
const
Matx
<
_Tp
,
m
,
m
>&
a
)
const
{
Matx
<
_Tp
,
m
,
m
>
temp
=
a
;
double
p
=
LU
(
temp
.
val
,
m
,
0
,
0
);
double
p
=
LU
(
temp
.
val
,
m
,
m
,
0
,
0
,
0
);
if
(
p
==
0
)
return
p
;
for
(
int
i
=
0
;
i
<
m
;
i
++
)
...
...
@@ -767,9 +767,9 @@ template<typename _Tp, int m> struct CV_EXPORTS Matx_FastInvOp
b
(
i
,
i
)
=
(
_Tp
)
1
;
if
(
method
==
DECOMP_CHOLESKY
)
return
Cholesky
(
temp
.
val
,
m
,
b
.
val
,
m
);
return
Cholesky
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
)
,
m
);
return
LU
(
temp
.
val
,
m
,
b
.
val
,
m
)
!=
0
;
return
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
b
.
val
,
m
*
sizeof
(
_Tp
)
,
m
)
!=
0
;
}
};
...
...
@@ -839,9 +839,9 @@ template<typename _Tp, int m, int n> struct CV_EXPORTS Matx_FastSolveOp
Matx
<
_Tp
,
m
,
m
>
temp
=
a
;
x
=
b
;
if
(
method
==
DECOMP_CHOLESKY
)
return
Cholesky
(
temp
.
val
,
m
,
x
.
val
,
n
);
return
Cholesky
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
x
.
val
,
n
*
sizeof
(
_Tp
)
,
n
);
return
LU
(
temp
.
val
,
m
,
x
.
val
,
n
)
!=
0
;
return
LU
(
temp
.
val
,
m
*
sizeof
(
_Tp
),
m
,
x
.
val
,
n
*
sizeof
(
_Tp
)
,
n
)
!=
0
;
}
};
...
...
modules/core/src/lapack.cpp
View file @
9ac3a351
This diff is collapsed.
Click to expand it.
modules/core/test/test_math.cpp
View file @
9ac3a351
...
...
@@ -1595,13 +1595,13 @@ static double cvTsSVDet( CvMat* mat, double* ratio )
{
for
(
i
=
0
;
i
<
nm
;
i
++
)
det
*=
w
->
data
.
fl
[
i
];
*
ratio
=
w
->
data
.
fl
[
nm
-
1
]
<
FLT_EPSILON
?
FLT_MAX
:
w
->
data
.
fl
[
nm
-
1
]
/
w
->
data
.
fl
[
0
];
*
ratio
=
w
->
data
.
fl
[
nm
-
1
]
<
FLT_EPSILON
?
0
:
w
->
data
.
fl
[
nm
-
1
]
/
w
->
data
.
fl
[
0
];
}
else
{
for
(
i
=
0
;
i
<
nm
;
i
++
)
det
*=
w
->
data
.
db
[
i
];
*
ratio
=
w
->
data
.
db
[
nm
-
1
]
<
FLT_EPSILON
?
DBL_MAX
:
w
->
data
.
db
[
nm
-
1
]
/
w
->
data
.
db
[
0
];
*
ratio
=
w
->
data
.
db
[
nm
-
1
]
<
FLT_EPSILON
?
0
:
w
->
data
.
db
[
nm
-
1
]
/
w
->
data
.
db
[
0
];
}
cvReleaseMat
(
&
w
);
...
...
@@ -1673,6 +1673,8 @@ void Core_SolveTest::get_test_array_types_and_sizes( int test_case_idx, vector<v
int
bits
=
cvtest
::
randInt
(
rng
);
Base
::
get_test_array_types_and_sizes
(
test_case_idx
,
sizes
,
types
);
CvSize
in_sz
=
sizes
[
INPUT
][
0
];
if
(
in_sz
.
width
>
in_sz
.
height
)
in_sz
=
cvSize
(
in_sz
.
height
,
in_sz
.
width
);
Base
::
get_test_array_types_and_sizes
(
test_case_idx
,
sizes
,
types
);
sizes
[
INPUT
][
0
]
=
in_sz
;
int
min_size
=
MIN
(
sizes
[
INPUT
][
0
].
width
,
sizes
[
INPUT
][
0
].
height
);
...
...
@@ -1912,7 +1914,7 @@ void Core_SVDTest::get_minmax_bounds( int /*i*/, int /*j*/, int /*type*/, Scalar
double
Core_SVDTest
::
get_success_error_level
(
int
test_case_idx
,
int
i
,
int
j
)
{
int
input_depth
=
CV_MAT_DEPTH
(
cvGetElemType
(
test_array
[
INPUT
][
0
]
));
double
input_precision
=
input_depth
<
CV_32F
?
0
:
input_depth
==
CV_32F
?
5
e-5
:
5e-11
;
double
input_precision
=
input_depth
<
CV_32F
?
0
:
input_depth
==
CV_32F
?
1
e-5
:
5e-11
;
double
output_precision
=
Base
::
get_success_error_level
(
test_case_idx
,
i
,
j
);
return
MAX
(
input_precision
,
output_precision
);
}
...
...
@@ -1926,7 +1928,7 @@ void Core_SVDTest::run_func()
}
void
Core_SVDTest
::
prepare_to_validation
(
int
)
void
Core_SVDTest
::
prepare_to_validation
(
int
test_case_idx
)
{
Mat
&
input
=
test_mat
[
INPUT
][
0
];
int
depth
=
input
.
depth
();
...
...
@@ -2036,7 +2038,8 @@ flags(0), have_b(false), symmetric(false), compact(false), vector_w(false)
}
void
Core_SVBkSbTest
::
get_test_array_types_and_sizes
(
int
test_case_idx
,
vector
<
vector
<
Size
>
>&
sizes
,
vector
<
vector
<
int
>
>&
types
)
void
Core_SVBkSbTest
::
get_test_array_types_and_sizes
(
int
test_case_idx
,
vector
<
vector
<
Size
>
>&
sizes
,
vector
<
vector
<
int
>
>&
types
)
{
RNG
&
rng
=
ts
->
get_rng
();
int
bits
=
cvtest
::
randInt
(
rng
);
...
...
@@ -2150,7 +2153,7 @@ void Core_SVBkSbTest::prepare_to_validation( int )
CvMat
_w
=
w
,
_wdb
=
wdb
;
// use exactly the same threshold as in icvSVD... ,
// so the changes in the library and here should be synchronized.
double
threshold
=
cv
::
sum
(
w
)[
0
]
*
2
*
(
is_float
?
FLT_EPSILON
:
DBL_EPSILON
);
double
threshold
=
cv
::
sum
(
w
)[
0
]
*
(
is_float
?
FLT_EPSILON
*
10
:
DBL_EPSILON
*
2
);
wdb
=
Scalar
::
all
(
0
);
for
(
i
=
0
;
i
<
min_size
;
i
++
)
...
...
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