Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a54f8e4c
You need to sign in or sign up before continuing.
Commit
a54f8e4c
authored
Aug 01, 2018
by
Davis King
Browse files
Made SPD test work more like it used to.
parent
887bc414
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
dlib/matrix/matrix_cholesky.h
dlib/matrix/matrix_cholesky.h
+10
-2
No files found.
dlib/matrix/matrix_cholesky.h
View file @
a54f8e4c
...
...
@@ -152,10 +152,16 @@ namespace dlib
const
type
eps
=
std
::
numeric_limits
<
type
>::
epsilon
();
const
type
eps2
=
max
(
abs
(
diag
(
A
)))
*
std
::
sqrt
(
std
::
numeric_limits
<
type
>::
epsilon
())
/
100
;
// compute the upper left corner
if
(
A
(
0
,
0
)
>
0
)
{
L_
(
0
,
0
)
=
std
::
sqrt
(
A
(
0
,
0
));
if
(
A
(
0
,
0
)
<=
eps2
)
isspd
=
false
;
}
else
{
...
...
@@ -177,7 +183,7 @@ namespace dlib
L_
(
r
,
0
)
=
0
;
}
isspd
=
isspd
&&
(
std
::
abs
(
A
(
r
,
0
)
-
A
(
0
,
r
))
<
eps
*
A
(
r
,
0
)
);
isspd
=
isspd
&&
(
std
::
abs
(
A
(
r
,
0
)
-
A
(
0
,
r
))
<
=
eps
*
std
::
abs
(
A
(
r
,
0
)
)
);
}
// now compute all the other columns
...
...
@@ -191,6 +197,8 @@ namespace dlib
if
(
temp
>
0
)
{
L_
(
c
,
c
)
=
std
::
sqrt
(
temp
);
if
(
temp
<=
eps2
)
isspd
=
false
;
}
else
{
...
...
@@ -221,7 +229,7 @@ namespace dlib
L_
(
r
,
c
)
=
0
;
}
isspd
=
isspd
&&
(
std
::
abs
(
A
(
r
,
c
)
-
A
(
c
,
r
))
<
eps
*
A
(
r
,
c
)
);
isspd
=
isspd
&&
(
std
::
abs
(
A
(
r
,
c
)
-
A
(
c
,
r
))
<
=
eps
*
std
::
abs
(
A
(
r
,
c
)
)
);
}
}
...
...
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