The following commit has been merged in the master branch:
commit 403384491ad7b996f53bb37f0e5c24c5bafb3b0f
Author: Andrei Zavada <[email protected]>
Date:   Sun Oct 7 02:06:16 2012 +0300

    fix some dodgy handling of temporaries in ICA wrappers
    
    plus obligatory ICM

diff --git a/src/ica/ica.hh b/src/ica/ica.hh
index dfef037..ab7dd8e 100644
--- a/src/ica/ica.hh
+++ b/src/ica/ica.hh
@@ -95,14 +95,14 @@ class CFastICA {
     public:
       // ctor
        template <class T>
-       CFastICA( const vector<valarray<T> >& source)
+       CFastICA (const vector<valarray<T> >& source)
                {
                        itpp::Mat<double>
                                _source_mat;
                        itpp::make_mat_from_vecva<double, T>( _source_mat, 
source);
                        _obj = new itpp::Fast_ICA (_source_mat);
                }
-       CFastICA( const vector<function<valarray<double>()> >& source, size_t 
cols)
+       CFastICA (const vector<function<valarray<double>()> >& source, size_t 
cols)
        // avoid creating a third temporary, specially for use with 
agh::CEDFFile::get_signal
                {
                        itpp::Mat<double>
@@ -112,19 +112,19 @@ class CFastICA {
                        }
                        _obj = new itpp::Fast_ICA (_source_mat);
                }
-       CFastICA( const vector<function<valarray<float>()> >& source, size_t 
cols)
+       CFastICA (const vector<function<valarray<float>()> >& source, size_t 
cols)
        // avoid creating a third temporary, specially for use with 
agh::CEDFFile::get_signal
                {
                        itpp::Mat<double>
                                _source_mat (source.size(), cols);
                        for ( int r = 0; r < (int)source.size(); ++r ) {
-                               itpp::Vec<float> tmp = {&source[r]()[0], 
(int)cols};
-                               for ( int c = 0; c < (int)cols; ++c )
+                               auto tmp = source[r]();
+                               for ( int c = 0; c < (int)tmp.size(); ++c )
                                        _source_mat( r, c) = tmp[c];
                        }
                        _obj = new itpp::Fast_ICA (_source_mat);
                }
-       ~CFastICA()
+       ~CFastICA ()
                {
                        delete _obj;
                }
diff --git a/src/ui/scoring-facility-ica.cc b/src/ui/scoring-facility-ica.cc
index 6661e05..78edb04 100644
--- a/src/ui/scoring-facility-ica.cc
+++ b/src/ui/scoring-facility-ica.cc
@@ -65,13 +65,11 @@ setup_ica()
                src.emplace_back(
                        bind (&sigfile::CSource::get_signal_filtered<int>, 
&H.crecording.F(), H.h()));
        }
-       FAFA;
        printf( "checking_sr * pagesize() * total_pages(): %zu, %zu, %zu\n", 
checking_sr, pagesize(), total_pages());
        ica = new ica::CFastICA (src, checking_sr * pagesize() * total_pages());
 
       // initialize
        // has no independent default
-       FAFA;
        gtk_spin_button_set_value( eSFICANofICs, channels.size());
        gtk_adjustment_set_upper( jSFICANofICs, channels.size());
        gtk_spin_button_set_value( eSFICAEigVecFirst, 1);
diff --git a/src/ui/scoring-facility-ica_cb.cc 
b/src/ui/scoring-facility-ica_cb.cc
index a52bf43..3155c03 100644
--- a/src/ui/scoring-facility-ica_cb.cc
+++ b/src/ui/scoring-facility-ica_cb.cc
@@ -26,14 +26,11 @@ void
 bSFRunICA_clicked_cb( GtkButton *button, gpointer userdata)
 {
        auto& SF = *(SScoringFacility*)userdata;
-       FAFA;
        if ( SF.setup_ica() == 0 ) {
-       FAFA;
                SF.mode = aghui::SScoringFacility::TMode::showing_ics;
                gtk_widget_set_visible( (GtkWidget*)SF.cSFScoringModeContainer, 
FALSE);
                gtk_widget_set_visible( (GtkWidget*)SF.cSFICAModeContainer, 
TRUE);
 
-       FAFA;
                gtk_widget_set_sensitive( (GtkWidget*)SF.bSFICATry, TRUE);
                gtk_widget_set_sensitive( (GtkWidget*)SF.bSFICAShowMatrix, 
FALSE);
                gtk_widget_set_sensitive( (GtkWidget*)SF.bSFICAPreview, FALSE);
@@ -41,7 +38,6 @@ bSFRunICA_clicked_cb( GtkButton *button, gpointer userdata)
 
                gtk_widget_set_sensitive( (GtkWidget*)SF.bSFAccept, FALSE);
                SF.set_tooltip( aghui::SScoringFacility::TTipIdx::ica_mode);
-       FAFA;
                SF.queue_redraw_all();
        }
 }

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to