Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtschump committed Sep 9, 2024
2 parents 463e49c + a1257fd commit 42f01d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions CImg.h
Original file line number Diff line number Diff line change
Expand Up @@ -32471,7 +32471,7 @@ namespace cimg_library {
for (unsigned int iter = 0; iter<_max_iter && residual>max_residual; ++iter) {

// Find best matching column from dictionary D.
int max_atom = 0;
int best_atom = 0;
Tfloat max_absdot = 0, max_dot = 0;
cimg_pragma_openmp(parallel for
cimg_openmp_if(dictionary._width>=2 && dictionary._width*dictionary._height>=32))
Expand All @@ -32481,22 +32481,22 @@ namespace cimg_library {
dot/=dictionary_norm[atom];
const Tfloat absdot = cimg::abs(dot);
cimg_pragma_openmp(critical(get_project_matrix)) {
if (absdot>max_absdot) { max_atom = atom; max_dot = dot; max_absdot = absdot; }
if (absdot>max_absdot) { best_atom = atom; max_dot = dot; max_absdot = absdot; }
}
}

if (!iter || method<3 || iter%proj_step) {
// Matching Pursuit: Subtract component to signal.
max_dot/=dictionary_norm[max_atom];
weights(signal,max_atom)+=max_dot;
max_dot/=dictionary_norm[best_atom];
weights(signal,best_atom)+=max_dot;
residual = 0;
cimg_forY(R,s) { R[s]-=max_dot*dictionary(max_atom,s); residual+=cimg::sqr(R[s]); }
cimg_forY(R,s) { R[s]-=max_dot*dictionary(best_atom,s); residual+=cimg::sqr(R[s]); }
residual = std::sqrt(residual)/R._height;
is_orthoproj = false;

} else {
// Orthogonal Matching Pursuit: Orthogonal projection step.
weights(signal,max_atom) = 1; // Use only as a marker
weights(signal,best_atom) = 1; // Use only as a marker
unsigned int nb_weights = 0;
cimg_forY(weights,atom) if (weights(signal,atom)) ++nb_weights;
CImg<Tfloat> sub_dictionary(nb_weights,dictionary._height);
Expand Down
2 changes: 1 addition & 1 deletion html/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="header">
<a href="index.html"><img alt="Logo" src="img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.4.1</a></b> (2024/08/28)
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.4.2</a></b> (2024/09/04)
</h2>

<hr/>
Expand Down
2 changes: 1 addition & 1 deletion html/header_doxygen.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="header">
<a href="../index.html"><img alt="Logo" src="../img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.4.1</a></b> (2024/08/28)
Latest stable version: <b><a href="http://cimg.eu/files/CImg_.zip">3.4.2</a></b> (2024/09/04)
</h2>

<hr/>
Expand Down

0 comments on commit 42f01d0

Please sign in to comment.