* [gentoo-commits] gentoo-x86 commit in sci-libs/itpp/files: itpp-4.0.7-fastica-fix-endless-loop.patch
@ 2010-08-10 18:24 Sebastien Fabbro (bicatali)
0 siblings, 0 replies; only message in thread
From: Sebastien Fabbro (bicatali) @ 2010-08-10 18:24 UTC (permalink / raw
To: gentoo-commits
bicatali 10/08/10 18:24:28
Added: itpp-4.0.7-fastica-fix-endless-loop.patch
Log:
Added patch for FastICA, thanks Gert Wollny (bug #327527). Added static-libs flag, switch to EAPI3, added missing pkgconfig dependency, simplified ebuild, removed the strip restricting (leaving out to user), and added longdescription.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Revision Changes Path
1.1 sci-libs/itpp/files/itpp-4.0.7-fastica-fix-endless-loop.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/itpp/files/itpp-4.0.7-fastica-fix-endless-loop.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/itpp/files/itpp-4.0.7-fastica-fix-endless-loop.patch?rev=1.1&content-type=text/plain
Index: itpp-4.0.7-fastica-fix-endless-loop.patch
===================================================================
diff -ru libitpp-4.0.7/itpp/signal/fastica.cpp libitpp-4.0.7.patched/itpp/signal/fastica.cpp
--- libitpp-4.0.7/itpp/signal/fastica.cpp 2009-12-27 01:38:47.000000000 +0100
+++ libitpp-4.0.7.patched/itpp/signal/fastica.cpp 2010-07-08 16:32:04.000000000 +0200
@@ -90,7 +90,7 @@
static mat mpower(const mat A, const double y);
static ivec getSamples(const int max, const double percentage);
static vec sumcol(const mat A);
-static void fpica(const mat X, const mat whiteningMatrix, const mat dewhiteningMatrix, const int approach, const int numOfIC, const int g, const int finetune, const double a1, const double a2, double myy, const int stabilization, const double epsilon, const int maxNumIterations, const int maxFinetune, const int initState, mat guess, double sampleSize, mat & A, mat & W);
+static bool fpica(const mat X, const mat whiteningMatrix, const mat dewhiteningMatrix, const int approach, const int numOfIC, const int g, const int finetune, const double a1, const double a2, double myy, const int stabilization, const double epsilon, const int maxNumIterations, const int maxFinetune, const int initState, mat guess, double sampleSize, mat & A, mat & W);
/*! @} */
namespace itpp
@@ -124,7 +124,7 @@
}
// Call main function
-void Fast_ICA::separate(void)
+bool Fast_ICA::separate(void)
{
int Dim = numOfIC;
@@ -159,13 +159,14 @@
}
+ bool result = true;
if (PCAonly == false) {
Dim = whitesig.rows();
if (numOfIC > Dim) numOfIC = Dim;
- fpica(whitesig, whiteningMatrix, dewhiteningMatrix, approach, numOfIC, g, finetune, a1, a2, mu, stabilization, epsilon, maxNumIterations, maxFineTune, initState, guess, sampleSize, A, W);
+ result = fpica(whitesig, whiteningMatrix, dewhiteningMatrix, approach, numOfIC, g, finetune, a1, a2, mu, stabilization, epsilon, maxNumIterations, maxFineTune, initState, guess, sampleSize, A, W);
icasig = W * mixedSig;
@@ -174,6 +175,7 @@
else { // PCA only : returns E as IcaSig
icasig = VecPr;
}
+ return result;
}
void Fast_ICA::set_approach(int in_approach) { approach = in_approach; if (approach == FICA_APPROACH_DEFL) finetune = true; }
@@ -437,7 +439,7 @@
}
-static void fpica(const mat X, const mat whiteningMatrix, const mat dewhiteningMatrix, const int approach, const int numOfIC, const int g, const int finetune, const double a1, const double a2, double myy, const int stabilization, const double epsilon, const int maxNumIterations, const int maxFinetune, const int initState, mat guess, double sampleSize, mat & A, mat & W)
+static bool fpica(const mat X, const mat whiteningMatrix, const mat dewhiteningMatrix, const int approach, const int numOfIC, const int g, const int finetune, const double a1, const double a2, double myy, const int stabilization, const double epsilon, const int maxNumIterations, const int maxFinetune, const int initState, mat guess, double sampleSize, mat & A, mat & W)
{
int vectorSize = X.rows();
@@ -511,7 +513,7 @@
A = dewhiteningMatrix * B;
W = transpose(B) * whiteningMatrix;
- return;
+ return false;
}
B = B * mpower(transpose(B) * B , -0.5);
@@ -769,7 +771,7 @@
} // IF round
- break;
+ return false;
} // IF numFailures > failureLimit
@@ -990,5 +992,5 @@
} // While round <= numOfIC
} // ELSE Deflation
-
+ return true;
} // FPICA
diff -ru libitpp-4.0.7/itpp/signal/fastica.h libitpp-4.0.7.patched/itpp/signal/fastica.h
--- libitpp-4.0.7/itpp/signal/fastica.h 2009-12-27 01:38:47.000000000 +0100
+++ libitpp-4.0.7.patched/itpp/signal/fastica.h 2010-07-08 16:24:37.000000000 +0200
@@ -134,8 +134,9 @@
\brief Explicit launch of main FastICA function
Explicit launch of the Fast_ICA algorithm.
+ \returns true if algorithm converged and false otherwise
*/
- void separate(void);
+ bool separate(void);
/*!
\brief Set approach : FICA_APPROACH_DEFL or FICA_APPROACH_SYMM (default)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-08-10 18:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 18:24 [gentoo-commits] gentoo-x86 commit in sci-libs/itpp/files: itpp-4.0.7-fastica-fix-endless-loop.patch Sebastien Fabbro (bicatali)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox