[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN README configure configure.ac functions/de...
From: |
Edward Rosten |
Subject: |
[Toon-members] TooN README configure configure.ac functions/de... |
Date: |
Mon, 06 Feb 2012 14:59:35 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 12/02/06 14:59:35
Modified files:
. : README configure configure.ac
functions : derivatives.h
internal : config.hh
Log message:
Final checkin to the CVS repository warning users to switch to the git
repository.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/README?cvsroot=toon&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/TooN/configure?cvsroot=toon&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/TooN/configure.ac?cvsroot=toon&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/TooN/functions/derivatives.h?cvsroot=toon&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/config.hh?cvsroot=toon&r1=1.33&r2=1.34
Patches:
Index: README
===================================================================
RCS file: /cvsroot/toon/TooN/README,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- README 2 May 2005 15:36:00 -0000 1.1.1.1
+++ README 6 Feb 2012 14:59:34 -0000 1.2
@@ -1,21 +1,5 @@
-To use:
+DO NOT USE THIS VERSION OF TOON
-1) Make sure you have a suitable compiler (g++ version < 3 is no good)
+Please get TooN from the git repository:
-2) Make sure all these files are in your include path.
-
-3) Then
-
-#include <numerics.h>
-and
-#include <numhelpers.h> // (if you want a few extras)
-#include <SVD.h> // (if you want singular value decompositions)
-#include <LU.h> // (if you want lu triangular decompositions)
-#include <SymEigen.h> // (if you want Eigen decomposition of symmetric
matrices)
-
-4) Finally you need to link with -llapack -lblas
-(and -lg2c for g++ I'm not sure about other compilers)
-
-(this means you will also need liblapack.{a,so} and libblas.{a,so})
-
-That's it.
+git clone git://git.savannah.nongnu.org/libcvd.git
Index: configure
===================================================================
RCS file: /cvsroot/toon/TooN/configure,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- configure 25 Jan 2012 15:07:59 -0000 1.13
+++ configure 6 Feb 2012 14:59:35 -0000 1.14
@@ -4143,4 +4143,18 @@
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
+echo
+echo
+echo
+echo
+echo
+echo
+echo '*************************************************'
+echo '*************************************************'
+echo '*************************************************'
+echo
+echo 'The TooN CVS repository is no longer updated!'
+echo
+echo 'Please get TooN from the git repository:'
+echo 'git clone git://git.savannah.nongnu.org/libcvd.git'
+echo
Index: configure.ac
===================================================================
RCS file: /cvsroot/toon/TooN/configure.ac,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- configure.ac 25 Jan 2012 15:07:59 -0000 1.15
+++ configure.ac 6 Feb 2012 14:59:35 -0000 1.16
@@ -164,4 +164,18 @@
AC_CONFIG_HEADERS(internal/config.hh)
AC_OUTPUT(Makefile)
-
+echo
+echo
+echo
+echo
+echo
+echo
+echo '*************************************************'
+echo '*************************************************'
+echo '*************************************************'
+echo
+echo 'The TooN CVS repository is no longer updated!'
+echo
+echo 'Please get TooN from the git repository:'
+echo 'git clone git://git.savannah.nongnu.org/libcvd.git'
+echo
Index: functions/derivatives.h
===================================================================
RCS file: /cvsroot/toon/TooN/functions/derivatives.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- functions/derivatives.h 1 Sep 2009 19:07:31 -0000 1.4
+++ functions/derivatives.h 6 Feb 2012 14:59:35 -0000 1.5
@@ -5,11 +5,152 @@
#include <vector>
#include <cmath>
-using namespace std;
-using namespace TooN;
namespace TooN{
namespace Internal{
+
+ ///@internal
+ ///@brief Implementation of Ridder's Extrapolation to zero.
+ ///The function input starts from 1.
+ //Copy-paste adaptation of the scalar version.
+ ///@param f Functor to extrapolate to zero.
+ ///@ingroup gInternal
+ template<class F, class Precision, int Size>
std::pair<Vector<Precision,Size>, Vector<Precision, Size> >
extrapolate_to_zero_J(F& f, int size)
+ {
+ using std::isfinite;
+ using std::max;
+ using std::isnan;
+ using namespace std;
+ //Use points at c^0, c^-1, ... to extrapolate towards
zero.
+
+ const Precision c = 1.1, t = 2;
+
+ static const int Npts = 400;
+
+ /* Neville's table is:
+ x_0 y_0 P_0
+ P_{01}
+ x_1 y_1 P_1 P_{012}
+ P_{12}
P_{0123}
+ x_2 y_2 P_2 P_{123}
+ P_{23}
+ x_3 y_3 P_3
+
+ In Matrix form, this is rearranged as:
+
+
+ x_0 y_0 P_0
+
+ x_1 y_1 P_1 P_{01}
+
+ x_2 y_2 P_2 P_{12} P_{012}
+
+ x_3 y_3 P_3 P_{23} P_{123} P_{0123}
+
+ This is rewritten further as:
+
+ | 0 1 2 3
+
_____|___________________________________________________
+ 0 | x_0 y_0 P^00
+ |
+ 1 | x_1 y_1 P^10 P^11
+ |
+ 2 | x_2 y_2 P^10 P^21 P^22
+ |
+ 3 | x_3 y_3 P^10 P^31 P^23 P^33
+
+ So, P^ij == P_{j-i...j}
+
+ Finally, only the current and previous row are
required. This reduces
+ the memory cost from quadratic to linear. The naming
scheme is:
+
+ P[i][j] -> P_i[j]
+ P[i-1][j] -> P_i_1[j]
+ */
+
+ vector<vector<Precision> >
P_i(Vector<Precision,Size>(Ones(size)));
+ vector<vector<Precision> >
P_i_1(Vector<Precision,Size>(Zeros(size)));
+
+
+ Vector<Size> best_err = Ones(size) * HUGE_VAL;
+ Vector<Size> best_point = Ones(size) * HUGE_VAL;
+
+ //The first tranche of points might be bad.
+ //Don't quit while no good points have ever happened.
+ Vector<Size, bool> ever_ok = Zeros(size);
+
+ //Compute f(x) as x goes from 1 towards zero and
extrapolate to 0
+ Precision x=1;
+ for(int i=0; i < Npts; i++)
+ {
+ swap(P_i, P_i_1);
+ P_i.resize(i+2, Zeros(size));
+
+
+ //P[i][0] = c^ -i;
+ P_i[0] = f(x);
+
+ x /= c;
+
+ Vector<bool, Size> better(Zeros(size)); //Did
we get better?
+
+ for(int k=0; k < best_err.size(); k++)
+ {
+ //Compute the extrapolations
+ //cj id c^j
+ Precision cj = 1;
+ bool any_ok=0;
+ for(int j=1; j <= i; j++)
+ {
+ cj *= c;
+ //We have (from above) n = i
and k = n - j
+ //n-k = i - (n - j) = i - i + j
= j
+ //Therefore c^(n-k) is just c^j
+
+ P_i[k][j] = (cj * P_i[k][j-1] -
P_i_1[k][j-1]) / (cj - 1);
+
+ if(any_ok ||
isfinite(P_i[k][j]))
+ ever_ok[k] = 1;
+
+ //Compute the difference
between the current point (high order)
+ //and the corresponding lower
order point at the current step size
+ Precision err1 = abs(P_i[k][j]
- P_i[k][j-1]);
+
+ //Compute the difference
between two consecutive points at the
+ //corresponding lower order
point at the larger stepsize
+ Precision err2 = abs(P_i[k][j]
- P_i_1[k][j-1]);
+
+ //The error is the larger of
these.
+ Precision err = max(err1, err2);
+
+ if(err < best_err[k] &&
isfinite(err))
+ {
+ best_err[k] = err;
+ best_point[k] =
P_i[k][j];
+ better=1;
+ }
+ }
+ }
+
+ using namespace std;
+ //If the highest order point got worse, or went
off the rails,
+ //and some good points have been seen, then
break.
+ bool all_bad=1
+ for(int k=0; k < best_err.size(); k++)
+ if(ever_ok[k] && !better[k] && i > 0 &&
(abs(P_i[k][i] - P_i_1[k][i-1]) > t * best_err[k]|| isnan(P_i[k][i])))
+ {
+ //Still bad
+ }
+ else
+ all_bad=0;
+
+ if(all_bad)
+ break;
+ }
+
+ return std::make_pair(best_point, best_err);
+ }
+
///@internal
///@brief Implementation of Ridder's Extrapolation to zero.
///The function input starts from 1.
@@ -339,6 +480,18 @@
return grad;
}
+ template<class F, int Fsize, int S, int P, class B> Matrix<>
numerical_Jacobian(const F& f, int fsize, const Vector<S, P, B>& x)
+ {
+ using namespace Internal;
+ //Parameters are the columns
+ //Outputs are the rows.
+
+ Matrix<Fsize, S> J(fsize, x.size());
+
+
+ }
+
+
///Compute numerical gradients with errors.
///See numerical_gradient().
///Gradients are returned in the first row of the returned matrix.
Index: internal/config.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/config.hh,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- internal/config.hh 25 Jan 2012 15:08:00 -0000 1.33
+++ internal/config.hh 6 Feb 2012 14:59:35 -0000 1.34
@@ -1 +1,16 @@
+/* internal/config.hh. Generated from config.hh.in by configure. */
+/* #undef TOON_TYPEOF_DECLTYPE */
+/* #undef TOON_TYPEOF_TYPEOF */
+
+#define TOON_TYPEOF___TYPEOF__ 1
+
+/* #undef TOON_TYPEOF_BOOST */
+
+/* #undef TOON_TYPEOF_BUILTIN */
+
+#define TOON_DEPRECATED_GCC 1
+
+#define TOON_USE_LAPACK 1
+
+/* #undef TOON_DEFAULT_PRECISION */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN README configure configure.ac functions/de...,
Edward Rosten <=