Quote:
Sorry for double questions. But the main issue is can we use ALGLIB with the DSP that supports IEEE Double Precision floating point ?
Yes, it is the main issue, but there is one more thing to account for (see below). Your CPU should be either little or big endian, but not mixed endian. From
http://focus.ti.com/lit/ds/symlink/omap-l137.pdf I can assume that ALGLIB will work for you.
Another issue possible - compiler being used. ALGLIB initialization code does tricky operations with pointers and double precision numbers to determine system properties at runtime. Although this autodetection code is 100% ANSI C conformant (and is full of optimization-preventing modifiers), some old and broken compilers can overoptimize these operations. MSVC, Sun Studio or modern GCC correctly handle it, but there was a thread recently about bug in the old GCC -
viewtopic.php?f=2&t=69I haven't tested ALGLIB with Texas Instruments C++ compiler, but you can easily do it:
* read
http://www.alglib.net/translator/man/ma ... gs_testing* download patch published at the top of
viewtopic.php?f=2&t=69&start=11 and overwrite your copy of ALGLIB with these files (it was not included into 3.0, so you should do it manually). This patch improves situation with overoptimization of autodetection code.
* try to test without optimization, then with full optimization settings
* try both test_i.cpp and test_c.cpp (I recommend you to start from test_i.cpp).
* in any case - whether it fails or works - please, write here about results ;)
As for the covariance matrix, you can improve situation by using Cov(A,B) = mean { (A-mean(A))*(B-mean(B)) }:
* center your variables by subtracting their means
* make one big rectangular matrix from variables
* calculate product of centered vars as product of two matrices. use alglib::rmatrixgemm() to calculate it efficiently.
* then divide result by N - you have your covariance matrix.
Actually, I wanted to implement this code long ago... Maybe it will be done in 3.1 (will be released at the end of the month)