toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] tag ChangeLog libtool src/ccmcomplex.h src/five...


From: Edward Rosten
Subject: [Toon-members] tag ChangeLog libtool src/ccmcomplex.h src/five...
Date: Wed, 22 Apr 2009 17:05:26 +0000

CVSROOT:        /cvsroot/toon
Module name:    tag
Changes by:     Edward Rosten <edrosten>        09/04/22 17:05:26

Modified files:
        .              : ChangeLog libtool 
Added files:
        src            : ccmcomplex.h five_point.cpp 
                         five_point_buildmatrix.cpp plrt.c 

Log message:
        Initial stab at 5 point pose

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/tag/ChangeLog?cvsroot=toon&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/tag/libtool?cvsroot=toon&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/tag/src/ccmcomplex.h?cvsroot=toon&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/tag/src/five_point.cpp?cvsroot=toon&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/tag/src/five_point_buildmatrix.cpp?cvsroot=toon&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/tag/src/plrt.c?cvsroot=toon&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/toon/tag/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ChangeLog   29 May 2006 13:54:03 -0000      1.1
+++ ChangeLog   22 Apr 2009 17:05:25 -0000      1.2
@@ -0,0 +1,637 @@
+==========================================
+Repository tagged as SNAPSHOT_20090420
+==========================================
+
+Mon 20 Apr, 2009 11:02:35 author: gerhard (Concatenated 2 entries at 1s)
+    File: libtool (Rev. 1.14)
+    File: src/absorient.cpp (Rev. 1.4)
+    File: src/handeye.cpp (Rev. 1.2)
+    File: src/threepointpose.cpp (Rev. 1.2)
+    File: tag/absorient.h (Rev. 1.4)
+    File: tag/fourpointpose.h (Rev. 1.9)
+    File: tag/handeye.h (Rev. 1.2)
+    File: tag/stdpp.h (Rev. 1.7)
+    File: tag/threepointpose.h (Rev. 1.2)
+    File: Makefile.am (Rev. 1.11)
+    File: Makefile.in (Rev. 1.11)
+
+made tag work with TooN2, deprecated four point pose - use three point 
instread, much better
+
+--------------
+==========================================
+Repository tagged as BEFORE_TOON2
+==========================================
+
+Thu  2 Apr, 2009 15:20:14 author: gerhard
+    File: tag/constantvelocity.h (Rev. 1.4)
+
+minimal cleanup
+
+--------------
+
+Wed  1 Apr, 2009 17:33:36 author: gerhard
+    File: build/vc2008/tag.sln (Rev. 1.1)
+    File: build/vc2008/tag.vcproj (Rev. 1.1)
+
+added VC2008 project files
+
+--------------
+
+Thu 29 Jan, 2009 08:00:59 author: gerhard
+    File: tag/ransac_estimators.h (Rev. 1.9)
+
+fixed access to correspondence data in exxential_matrix estimator
+
+--------------
+
+Mon  5 Jan, 2009 15:25:33 author: edrosten
+    File: libtool (Rev. 1.13)
+    File: tag/fn.h (Rev. 1.7)
+
+Make member_iterator non-const. Add member_const_iterator
+
+--------------
+
+Tue  9 Dec, 2008 20:37:57 author: gerhard
+    File: tag/ransac_estimators.h (Rev. 1.8)
+
+missing ransac estimator for camera rotation
+
+--------------
+
+Tue  9 Dec, 2008 20:33:42 author: gerhard (Concatenated 2 entries at 1s)
+    File: tag/absorient.h (Rev. 1.3)
+    File: tag/helpers.h (Rev. 1.2)
+    File: tag/kalmanfilter.h (Rev. 1.9)
+    File: src/absorient.cpp (Rev. 1.3)
+
+fast rotation from rays
+
+--------------
+==========================================
+Repository tagged as SNAPSHOT_20081127
+==========================================
+
+Wed 20 Aug, 2008 14:14:13 author: gerhard
+    File: build/vc2005/tag.vcproj (Rev. 1.2)
+
+added missing file for handeye calibration
+
+--------------
+
+Mon 18 Aug, 2008 18:36:28 author: edrosten (Concatenated 2 entries at 1s)
+    File: tag/printf.h (Rev. 1.9)
+    File: libtool (Rev. 1.12)
+
+Fix in printf
+
+--------------
+
+Fri 15 Aug, 2008 14:24:49 author: gerhard (Concatenated 2 entries at 1s)
+    File: src/handeye.cpp (Rev. 1.1)
+    File: tag/handeye.h (Rev. 1.1)
+    File: Makefile.am (Rev. 1.10)
+    File: Makefile.in (Rev. 1.10)
+    File: libtool (Rev. 1.11)
+
+added hand eye calibration routines
+
+--------------
+
+Thu 10 Jul, 2008 11:56:56 author: gerhard
+    File: Makefile.in (Rev. 1.9)
+
+update for change in Makefile.am (long ago :)
+
+--------------
+
+Thu 29 May, 2008 17:36:23 author: gerhard
+    File: src/absorient.cpp (Rev. 1.2)
+    File: src/quartic.cpp (Rev. 1.3)
+
+build files and some fixes for Visual Studio 2005
+
+--------------
+
+Tue 20 May, 2008 03:15:30 author: edrosten (Concatenated 2 entries at 1s)
+    File: tag/printf.h (Rev. 1.8)
+    File: libtool (Rev. 1.10)
+
+64bit fix
+
+--------------
+
+Tue  1 Apr, 2008 03:40:52 author: ethaneade
+    File: src/quartic.cpp (Rev. 1.2)
+
+Addressed unlikely but possible boundary case in quartic solver.
+
+--------------
+
+Mon 31 Mar, 2008 17:35:42 author: ethaneade (Concatenated 2 entries at 1s)
+    File: src/threepointpose.cpp (Rev. 1.1)
+    File: src/quartic.cpp (Rev. 1.1)
+    File: tag/quartic.h (Rev. 1.1)
+    File: tag/threepointpose.h (Rev. 1.1)
+
+An efficient implementation of the perspective three point pose algorithm
+given by Fischer and Bolles, 1980.  The quartic solver uses a careful
+implementation of the quartic formula, and the resulting roots are refined
+using Newton's method.  On my hardware, the implementation takes about 3
+microseconds to run in the average case.
+
+--------------
+
+Tue 25 Mar, 2008 23:44:51 author: edrosten
+    File: tag/tuple.h (Rev. 1.6)
+
+Indexing for all tuple types
+
+--------------
+
+Mon 18 Feb, 2008 17:30:01 author: gerhard
+    File: tag/ransac.h (Rev. 1.10)
+
+use erase instead of resize to avoid the need for copy constructor
+
+--------------
+
+Tue 11 Dec, 2007 15:41:07 author: gerhard
+    File: tag/unscented.h (Rev. 1.2)
+
+made Sqrt versions accessible, removed some dependencies
+
+--------------
+
+Mon  3 Dec, 2007 17:39:31 author: gerhard (Concatenated 2 entries at 1s)
+    File: tag/unscented.h (Rev. 1.1)
+    File: Makefile.am (Rev. 1.8)
+    File: Makefile.in (Rev. 1.8)
+    File: aclocal.m4 (Rev. 1.7)
+    File: configure (Rev. 1.7)
+    File: libtool (Rev. 1.9)
+
+unscented transform implementations by Ethan Eade
+
+--------------
+
+Wed 31 Oct, 2007 10:26:50 author: gerhard
+    File: AUTHORS (Rev. 1.2)
+    File: Doxyfile (Rev. 1.4)
+    File: README (Rev. 1.2)
+
+documentation fixes
+
+--------------
+
+Wed 31 Oct, 2007 10:26:22 author: gerhard (Concatenated 2 entries at 1s)
+    File: tag/fourpointpose.h (Rev. 1.8)
+    File: tag/ransac.h (Rev. 1.9)
+    File: tag/ransac_estimators.h (Rev. 1.7)
+    File: Makefile.am (Rev. 1.7)
+    File: Makefile.in (Rev. 1.7)
+    File: aclocal.m4 (Rev. 1.6)
+    File: configure (Rev. 1.6)
+    File: libtool (Rev. 1.8)
+
+updated ransac interfaces to get minimal hypothesis size directly from 
estimators. backwards compatibility functions are still provided. also added 
helpers refactoring and adding some common code
+
+--------------
+
+Tue 30 Oct, 2007 18:56:38 author: gerhard
+    File: tag/ransac.h (Rev. 1.8)
+
+64bit compatibility (size of size_t type)
+
+--------------
+
+Thu 25 Oct, 2007 21:33:21 author: edrosten
+    File: libtool (Rev. 1.7)
+    File: tag/array.h (Rev. 1.2)
+
+Remove some compile warnings.
+
+--------------
+
+Tue 28 Aug, 2007 17:39:14 author: edrosten
+    File: tag/printf.h (Rev. 1.7)
+
+Fixed warning.
+
+--------------
+
+Mon 27 Aug, 2007 12:30:28 author: gerhard
+    File: tag/fourpointpose.h (Rev. 1.7)
+
+refactored
+
+--------------
+
+Fri 17 Aug, 2007 17:06:28 author: gerhard
+    File: tag/ransac_estimators.h (Rev. 1.6)
+
+homography estimator and some optimisations and fixes
+
+--------------
+
+Mon 23 Jul, 2007 18:51:51 author: gerhard
+    File: tag/fourpointpose.h (Rev. 1.6)
+
+add score function for likelihood-based ransac scoring
+
+--------------
+
+Tue 17 Jul, 2007 00:13:49 author: edrosten
+    File: tag/fn.h (Rev. 1.6)
+
+Make member_iterator work with pointers (which are valud iterators) by using
+the std::iterator_traits class.
+
+--------------
+
+Tue 12 Jun, 2007 21:05:08 author: gerhard
+    File: tag/ransac.h (Rev. 1.7)
+    File: tag/ransac_estimators.h (Rev. 1.5)
+
+added plane estimation
+
+--------------
+
+Wed 14 Feb, 2007 15:31:28 author: gerhard
+    File: tag/measurements.h (Rev. 1.4)
+
+corrected WorldPose and WorldPosition measurements
+
+--------------
+
+Wed 24 Jan, 2007 03:10:02 author: edrosten
+    File: tag/fn.h (Rev. 1.5)
+
+Removed extre qualifiers which cause errors in gcc 4.1.0
+
+--------------
+
+Thu 14 Dec, 2006 14:00:46 author: gerhard
+    File: tag/constantvelocity.h (Rev. 1.3)
+    File: tag/kalmanfilter.h (Rev. 1.8)
+
+optimizations through returning references instead of temporary return values 
and using reference variables in the filter
+
+--------------
+
+Tue  5 Dec, 2006 17:43:10 author: gerhard
+    File: tag/kalmanfilter.h (Rev. 1.7)
+
+traits for kalman filter template
+
+--------------
+
+Mon 25 Sep, 2006 22:29:14 author: edrosten
+    File: tag/tuple.h (Rev. 1.5)
+
+Added missing const to avoid some strange compile errors in some
+cases.
+
+--------------
+
+Mon 11 Sep, 2006 17:12:23 author: gerhard
+    File: tag/fn.h (Rev. 1.4)
+
+moved binary_function specialization to std namespace where it belongs
+
+--------------
+
+Mon  4 Sep, 2006 17:24:27 author: gerhard
+    File: tag/fn.h (Rev. 1.3)
+
+added a binary_function traits class for functional header
+
+--------------
+
+Mon  4 Sep, 2006 17:23:01 author: gerhard
+    File: src/fourpointpose.cpp (Rev. 1.6)
+
+refactored checks, avoids unnecessary use of acos, asin
+
+--------------
+
+Mon  4 Sep, 2006 16:50:04 author: jjneubert
+    File: libtool (Rev. 1.6)
+    File: src/fourpointpose.cpp (Rev. 1.5)
+
+fixed floating point error in fourPointPose
+
+--------------
+
+Wed 26 Jul, 2006 18:08:07 author: gerhard
+    File: src/fourpointpose.cpp (Rev. 1.4)
+    File: tag/fourpointpose.h (Rev. 1.5)
+
+added a tolerance value to four point pose estimation to come up with an 
estimation under measurement errors
+
+--------------
+
+Fri 21 Jul, 2006 11:45:04 author: gerhard
+    File: tag/intersection.h (Rev. 1.2)
+
+fixed triangle-triangle intersection
+
+--------------
+
+Wed 19 Jul, 2006 17:20:48 author: gerhard
+    File: tag/fn.h (Rev. 1.2)
+
+fixed member_iterator_t to work correct with constness and make it much cleaner
+
+--------------
+
+Wed 19 Jul, 2006 09:53:56 author: gerhard
+    File: tag/intersection.h (Rev. 1.1)
+
+added intersection functions
+
+--------------
+
+Fri 14 Jul, 2006 23:02:35 author: edrosten
+    File: tag/tuple.h (Rev. 1.4)
+
+Added more tuple functionality. Value and non-const reference lists also
+exist. These do not have most of the functionality of T_list, they are
+designed for multiple return vaules from functions. See the docs.
+
+--------------
+
+Wed 12 Jul, 2006 01:26:37 author: edrosten
+    File: tag/stdpp.h (Rev. 1.6)
+
+Utility function for std::pair, so that multiple values can be returned from
+functions directly in to two variables, eg:
+float f;
+int i;
+rpair(f, i) = make_pair(2.2f, 7);
+
+--------------
+
+Tue 11 Jul, 2006 19:00:43 author: edrosten
+    File: tag/tuple.h (Rev. 1.3)
+
+Namespace related fix
+
+--------------
+
+Thu  6 Jul, 2006 23:31:57 author: edrosten
+    File: tag/array.h (Rev. 1.1)
+
+I hate forgetting to add files.
+
+--------------
+
+Wed  5 Jul, 2006 21:43:55 author: edrosten
+    File: Makefile.am (Rev. 1.5)
+    File: Makefile.in (Rev. 1.5)
+    File: aclocal.m4 (Rev. 1.4)
+    File: configure (Rev. 1.4)
+    File: libtool (Rev. 1.4)
+
+Checked in an array type with a sequence constructor (using tuples).
+
+--------------
+
+Mon 19 Jun, 2006 11:55:07 author: gerhard
+    File: tag/fn.h (Rev. 1.1)
+
+added header for std functional and iterator add ons
+
+--------------
+
+Tue 13 Jun, 2006 18:19:27 author: gerhard
+    File: tag/fourpointpose.h (Rev. 1.4)
+    File: tag/kalmanfilter.h (Rev. 1.6)
+    File: tag/ransac.h (Rev. 1.6)
+
+some fixes after ransac update:
+namespace qualifiers in ransac.h and kalmanfilter.h
+interface update for fourpointpose.h ransac estimator
+
+--------------
+
+Tue 13 Jun, 2006 03:37:32 author: ethaneade
+    File: tag/ransac_estimators.h (Rev. 1.4)
+
+More fixes, mostly namespace qualification issues.
+
+--------------
+
+Tue 13 Jun, 2006 03:00:21 author: ethaneade
+    File: tag/ransac.h (Rev. 1.5)
+
+Small fix to find_RANSAC_inliers.
+
+--------------
+
+Tue 13 Jun, 2006 02:55:46 author: ethaneade
+    File: tag/ransac.h (Rev. 1.4)
+
+Small fix to find_RANSAC_inliers_guided_breadth_first.
+
+--------------
+
+Tue 13 Jun, 2006 02:50:44 author: ethaneade
+    File: tag/ransac.h (Rev. 1.3)
+    File: tag/ransac_estimators.h (Rev. 1.3)
+
+Updated RANSAC algorithms and estimators to fix bugs and improve efficiency.
+There are now (only) two estimators defined:
+
+- EssentialMatrix estimates the essential matrix given at least 8
+  correspondences (using the Torr-Fitzgibbon algorithm) and gives
+  decomposition into SE(3)
+- AffineHomography estimates a transformation of the form Ax+T given at least 
4 correspondences
+
+More estimators will be added as they are tested.  The required interface is
+straightforward.
+
+There are three RANSAC algorithms defined:
+
+- find_RANSAC_inliers is classic RANSAC
+- find_RANSAC_inliers_breadth_first is preemptive RANSAC
+- find_RANSAC_inliers_guided_breadth_first is preemptive RANSAC with a 
non-uniform sampling density
+
+The interfaces of estimators and correspondences are slightly changed; see
+the doxygen for details.
+
+--------------
+
+Mon  5 Jun, 2006 23:29:50 author: edrosten
+    File: tag/printf.h (Rev. 1.6)
+
+Mistake in macros
+
+--------------
+
+Mon  5 Jun, 2006 19:04:57 author: gerhard
+    File: tag/kalmanfilter.h (Rev. 1.5)
+
+using optimized transformCovariance from TooN
+
+--------------
+
+Mon  5 Jun, 2006 16:19:30 author: gerhard
+    File: tag/constantvelocity.h (Rev. 1.2)
+    File: tag/kalmanfilter.h (Rev. 1.4)
+    File: tag/measurements.h (Rev. 1.3)
+
+various fixes to make kalman filter stuff actually compile :)
+
+--------------
+
+Sun  4 Jun, 2006 13:21:09 author: gerhard
+    File: src/fourpointpose.cpp (Rev. 1.3)
+
+refactored common code to helper function
+
+--------------
+
+Sun  4 Jun, 2006 13:09:19 author: gerhard
+    File: src/fourpointpose.cpp (Rev. 1.2)
+    File: tag/fourpointpose.h (Rev. 1.3)
+
+fixed four point pose estimation
+
+--------------
+
+Sun  4 Jun, 2006 13:08:49 author: gerhard
+    File: tag/measurements.h (Rev. 1.2)
+
+added convenience function
+
+--------------
+
+Sun  4 Jun, 2006 13:08:35 author: gerhard
+    File: tag/stdpp.h (Rev. 1.5)
+
+more constraint template parameters to avoid conflicts
+
+--------------
+
+Wed 31 May, 2006 17:46:20 author: gerhard
+    File: Makefile.am (Rev. 1.3)
+    File: Makefile.in (Rev. 1.3)
+    File: aclocal.m4 (Rev. 1.3)
+    File: configure (Rev. 1.3)
+    File: libtool (Rev. 1.3)
+    File: tag/absorient.h (Rev. 1.2)
+    File: tag/fourpointpose.h (Rev. 1.2)
+    File: tag/kalmanfilter.h (Rev. 1.3)
+    File: tag/printf.h (Rev. 1.5)
+    File: tag/ransac.h (Rev. 1.2)
+    File: tag/ransac_estimators.h (Rev. 1.2)
+    File: tag/stdpp.h (Rev. 1.4)
+
+- added Kalman filter models and measurement classes, some refactoring,
+  still need to fix a number of things
+- some doc fixes and proper include guards
+
+--------------
+
+Wed 31 May, 2006 01:09:48 author: edrosten
+    File: tag/printf.h (Rev. 1.4)
+    File: tag/tuple.h (Rev. 1.2)
+
+Fixed guards and include
+
+--------------
+
+Wed 31 May, 2006 01:08:29 author: edrosten
+    File: tag/printf.h (Rev. 1.3)
+
+Fixed guards
+
+--------------
+
+Wed 31 May, 2006 01:07:56 author: edrosten
+    File: tag/printf.h (Rev. 1.2)
+
+Fixed namespace
+
+--------------
+
+Wed 31 May, 2006 00:00:33 author: edrosten
+    File: Makefile.am (Rev. 1.2)
+    File: Makefile.in (Rev. 1.2)
+    File: aclocal.m4 (Rev. 1.2)
+    File: configure (Rev. 1.2)
+    File: libtool (Rev. 1.2)
+
+Added files to Makefile.am
+
+--------------
+
+Tue 30 May, 2006 23:59:51 author: edrosten
+    File: tag/printf.h (Rev. 1.1)
+    File: tag/tuple.h (Rev. 1.1)
+
+Added typesafe printf and tuple types.
+
+--------------
+
+Tue 30 May, 2006 20:53:22 author: gerhard
+    File: Doxyfile (Rev. 1.3)
+    File: tag/stdpp.h (Rev. 1.3)
+
+documentation fixes
+
+--------------
+
+Tue 30 May, 2006 19:47:46 author: edrosten
+    File: tag/stdpp.h (Rev. 1.2)
+
+Added add_fill, print and no_space ostream modifiers for use with
+operator<<. For some reason documentation doesn't work.
+
+--------------
+
+Mon 29 May, 2006 18:31:57 author: gerhard
+    File: tag/stdpp.h (Rev. 1.1)
+
+documentation updates and stdpp header with , op for streams
+
+--------------
+
+Mon 29 May, 2006 15:00:25 author: gerhard
+    File: config.guess (Rev. 1.1)
+    File: config.sub (Rev. 1.1)
+    File: depcomp (Rev. 1.1)
+    File: missing (Rev. 1.1)
+
+added missing build files
+
+--------------
+
+Mon 29 May, 2006 14:54:03 author: gerhard
+    File: AUTHORS (Rev. 1.1)
+    File: COPYING (Rev. 1.1)
+    File: ChangeLog (Rev. 1.1)
+    File: Doxyfile (Rev. 1.1)
+    File: INSTALL (Rev. 1.1)
+    File: Makefile.am (Rev. 1.1)
+    File: Makefile.in (Rev. 1.1)
+    File: NEWS (Rev. 1.1)
+    File: README (Rev. 1.1)
+    File: aclocal.m4 (Rev. 1.1)
+    File: configure (Rev. 1.1)
+    File: configure.in (Rev. 1.1)
+    File: install-sh (Rev. 1.1)
+    File: libtool (Rev. 1.1)
+    File: ltmain.sh (Rev. 1.1)
+    File: src/absorient.cpp (Rev. 1.1)
+    File: src/fourpointpose.cpp (Rev. 1.1)
+    File: tag/absorient.h (Rev. 1.1)
+    File: tag/fourpointpose.h (Rev. 1.1)
+    File: tag/kalmanfilter.h (Rev. 1.1)
+    File: tag/ransac.h (Rev. 1.1)
+    File: tag/ransac_estimators.h (Rev. 1.1)
+
+uploaded initial version to tag repository
+
+--------------

Index: libtool
===================================================================
RCS file: /cvsroot/toon/tag/libtool,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libtool     20 Apr 2009 10:02:35 -0000      1.14
+++ libtool     22 Apr 2009 17:05:25 -0000      1.15
@@ -44,7 +44,11 @@
 
 # ### BEGIN LIBTOOL CONFIG
 
+<<<<<<< libtool
+# Libtool was configured on host tove:
+=======
 # Libtool was configured on host pirx.eng.cam.ac.uk:
+>>>>>>> 1.14
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -66,13 +70,23 @@
 
 # The host system.
 host_alias=
+<<<<<<< libtool
+host=i686-suse-linux
+host_os=linux
+=======
 host=i686-apple-darwin9.6.0
 host_os=darwin9.6.0
+>>>>>>> 1.14
 
 # The build system.
 build_alias=
+<<<<<<< libtool
+build=i686-suse-linux
+build_os=linux
+=======
 build=i686-apple-darwin9.6.0
 build_os=darwin9.6.0
+>>>>>>> 1.14
 
 # An echo program that does not interpret backslashes.
 echo="/bin/echo"
@@ -97,7 +111,11 @@
 EGREP="/usr/bin/grep -E"
 
 # The linker used to build libraries.
+<<<<<<< libtool
+LD="/usr/i586-suse-linux/bin/ld"
+=======
 LD="/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld"
+>>>>>>> 1.14
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -322,10 +340,18 @@
 link_all_deplibs=yes
 
 # Compile-time system search path for libraries
+<<<<<<< libtool
+sys_lib_search_path_spec="/usr/lib/gcc/i586-suse-linux/4.3 
/usr/i586-suse-linux/lib /usr/lib /lib"
+=======
 sys_lib_search_path_spec="/usr/lib/i686-apple-darwin9/4.0.1 /usr/lib 
/usr/lib/gcc/i686-apple-darwin9/4.0.1 /usr/local/lib"
+>>>>>>> 1.14
 
 # Run-time system search path for libraries
+<<<<<<< libtool
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib 
/usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib 
/usr/i486-linux-libc5/lib/BORKBORKBORK "
+=======
 sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
+>>>>>>> 1.14
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""
@@ -6809,7 +6835,11 @@
 # End:
 # ### BEGIN LIBTOOL TAG CONFIG: CXX
 
+<<<<<<< libtool
+# Libtool was configured on host tove:
+=======
 # Libtool was configured on host pirx.eng.cam.ac.uk:
+>>>>>>> 1.14
 
 # Shell to use when invoking shell scripts.
 SHELL="/bin/sh"
@@ -6831,13 +6861,23 @@
 
 # The host system.
 host_alias=
+<<<<<<< libtool
+host=i686-suse-linux
+host_os=linux
+=======
 host=i686-apple-darwin9.6.0
 host_os=darwin9.6.0
+>>>>>>> 1.14
 
 # The build system.
 build_alias=
+<<<<<<< libtool
+build=i686-suse-linux
+build_os=linux
+=======
 build=i686-apple-darwin9.6.0
 build_os=darwin9.6.0
+>>>>>>> 1.14
 
 # An echo program that does not interpret backslashes.
 echo="/bin/echo"
@@ -6862,7 +6902,11 @@
 EGREP="/usr/bin/grep -E"
 
 # The linker used to build libraries.
+<<<<<<< libtool
+LD="/usr/i586-suse-linux/bin/ld"
+=======
 LD="/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld"
+>>>>>>> 1.14
 
 # Whether we need hard or soft links.
 LN_S="ln -s"
@@ -6986,8 +7030,321 @@
 module_expsym_cmds="sed -e \\\"s,#.*,,\\\" -e \\\"s,^[    ]*,,\\\" -e 
\\\"s,^\\\\(..*\\\\),_&,\\\" < \$export_symbols > 
\$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag  -o 
\$lib -bundle \$libobjs \$deplibs\$compiler_flags~nmedit -s 
\$output_objdir/\${libname}-symbols.expsym \${lib}"
 
 # Commands to strip libraries.
+<<<<<<< libtool
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/gcc/i586-suse-linux/4.3/../../../crti.o 
/usr/lib/gcc/i586-suse-linux/4.3/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc/i586-suse-linux/4.3/crtendS.o 
/usr/lib/gcc/i586-suse-linux/4.3/../../../crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/gcc/i586-suse-linux/4.3 
-L/usr/lib/gcc/i586-suse-linux/4.3 
-L/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/lib 
-L/usr/lib/gcc/i586-suse-linux/4.3/../../.."
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[  ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       
][      ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  
{\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/  
{\"\\2\", (lt_ptr) \\&\\2},/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# If ld is used when linking, flag to hardcode $libdir into
+# a binary during linking. This must work even if $libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=""
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Set to yes if building a shared library automatically hardcodes DIR into the 
library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=no
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX 
COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/usr/lib/gcc/i586-suse-linux/4.3 
/usr/i586-suse-linux/lib /usr/lib /lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib 
/usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib 
/usr/i486-linux-libc5/lib/BORKBORKBORK "
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | 
\$SED 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=""
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+# ### END LIBTOOL TAG CONFIG: CXX
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# Libtool was configured on host tove:
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=
+host=i686-suse-linux
+host_os=linux
+
+# The build system.
+build_alias=
+build=i686-suse-linux
+build_os=linux
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# LTCC compiler flags.
+LTCFLAGS="-g -O2"
+
+# A language-specific compiler.
+CC="gfortran"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# An ERE matcher.
+EGREP="/usr/bin/grep -E"
+
+# The linker used to build libraries.
+LD="/usr/i586-suse-linux/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP="strip"
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='.so'
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC"
+pic_mode=default
+
+# What is the maximum length of a command?
+max_cmd_len=1572864
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=""
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience 
\${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix 
\${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}\${shared_ext}\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
+old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname 
\$wl\$soname -o \$lib"
+archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
+  cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> 
\$output_objdir/\$libname.ver~
+  \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
+         \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname 
\$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=""
+module_expsym_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+=======
 old_striplib="strip -S"
 striplib="strip -x"
+>>>>>>> 1.14
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
@@ -7087,10 +7444,18 @@
 link_all_deplibs=yes
 
 # Compile-time system search path for libraries
+<<<<<<< libtool
+sys_lib_search_path_spec="/usr/lib/gcc/i586-suse-linux/4.3 
/usr/i586-suse-linux/lib /usr/lib /lib"
+=======
 sys_lib_search_path_spec="/usr/lib/i686-apple-darwin9/4.0.1 /usr/lib 
/usr/lib/gcc/i686-apple-darwin9/4.0.1 /usr/local/lib"
+>>>>>>> 1.14
 
 # Run-time system search path for libraries
+<<<<<<< libtool
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib/Xaw3d /usr/X11R6/lib 
/usr/lib/Xaw3d /usr/i386-suse-linux/lib /usr/local/lib /opt/kde3/lib 
/usr/i486-linux-libc5/lib/BORKBORKBORK "
+=======
 sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
+>>>>>>> 1.14
 
 # Fix the shell variable $srcfile for the compiler.
 fix_srcfile_path=""

Index: src/ccmcomplex.h
===================================================================
RCS file: src/ccmcomplex.h
diff -N src/ccmcomplex.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/ccmcomplex.h    22 Apr 2009 17:05:25 -0000      1.1
@@ -0,0 +1,12 @@
+/*  complex.h    CCMATH mathematics library source code.
+ *
+ *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
+ *  This code may be redistributed under the terms of the GNU library
+ *  public license (LGPL). ( See the lgpl.license file for details.)
+ * ------------------------------------------------------------------------
+ */
+#ifndef CPX
+struct complex {double re,im;};
+typedef struct complex Cpx;
+#define CPX  1
+#endif

Index: src/five_point.cpp
===================================================================
RCS file: src/five_point.cpp
diff -N src/five_point.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/five_point.cpp  22 Apr 2009 17:05:25 -0000      1.1
@@ -0,0 +1,206 @@
+#include <TooN/TooN.h>
+#include <TooN/helpers.h>
+#include <TooN/gauss_jordan.h>
+#include <TooN/SVD.h>
+#include <utility>
+#include <tr1/array>
+
+#include "ccmcomplex.h"
+
+using namespace TooN;
+using namespace std;
+using namespace std::tr1;
+
+//CCMath's polyroot
+int plrt(double *cof,int n,Cpx *root,double ra,double rb);
+
+void build_matrix(const Vector<9>& X, const Vector<9>& Y, const Vector<9>& Z, 
const Vector<9>& W, Matrix<10,20>& R);
+
+Vector<9> stack_points(const Vector<3>&p, const Vector<3>& q)
+{
+       return makeVector(
+               q[0] *p[0],
+               q[1] *p[0],
+               q[2] *p[0],
+
+               q[0] *p[1],
+               q[1] *p[1],
+               q[2] *p[1],
+
+               q[0] *p[2],
+               q[1] *p[2],
+               q[2] *p[2]
+       );
+}
+
+template<int AN, int BN> Vector<AN+BN-1> poly_mul(const Vector<AN>& a, const 
Vector<BN>& b)
+{
+       //Polynomials are stored with the coefficient of zero in the first
+
+       Vector<AN+BN-1> ret = Zero;
+
+       for(int ai=0; ai < a.size(); ai++)
+               for(int bi=0; bi <b.size(); bi++)
+                       ret[ai+bi] += a[ai] * b[bi];
+                       
+       return ret;
+}
+
+template<int N> double polyval(const Vector<N>& v, double x)
+{
+       double val;
+       for(int i=v.size()-1; i > 0; i--)
+       {
+               val += v[i];    
+               val *= x;
+       }
+
+       val += p[0];
+       return val;
+}
+
+Matrix<3, 3, double, Reference::RowMajor> as_matrix(Vector<9>& v)
+{
+       return Matrix<3, 3, double, Reference::RowMajor>(&v[0]);
+}
+
+
+vector<Matrix<3> > five_point(array<pair<Vector<3>, Vector<3> >, 5> points)
+{
+       //Equations numbers are given with reference to:
+       // "An efficient Solution to the Five-Point Relative Pose Problem",
+       // D. Nister, IEEE Tran. on Pat. Anal. and Mach. Intel.,  26(6) 2004.
+
+       //Given a pair of corresponding points, p, q, the
+       //epipolar constraint gives:
+       //
+       // p E q = 0
+       //
+       // This can be arranged in to:
+       //
+       // q~ E~ = 0
+       //
+       // Where E~ = [E11 E12 E13 .... ]  (ie E rastered in row-major order)
+       // and q~ = [ q1p1 q2p1 q3p1 q1p2 q2p2 q3p2 q1p3 q2p3q3p3 ]
+       // See Eqn 4, 7, 8, 9
+
+       // Since there are 5 points, All 5 q~'s can be stacked giving Q, and
+       //
+       // Q E~ = [0 0 0 0 0]'
+       //
+       // E~ is in the null space of Q, and so the real E# consists of a
+       // linear sum of the remaining 4 null space vectors.
+       // See Eqn 10.
+
+       Matrix<9, 9> Q = Zero;
+       for(int i=0; i < 5; i++)
+               Q[i] = stack_points(points[i].first, points[i].second);
+               
+       SVD<9, 9> svd_Q(Q);
+
+       //The null-space it the last 4 rows of svd_Q.get_VT()
+       //
+       // According to Eqn 10:
+       Vector<9> X = svd_Q.get_VT()[5];
+       Vector<9> Y = svd_Q.get_VT()[6];
+       Vector<9> Z = svd_Q.get_VT()[7];
+       Vector<9> W = svd_Q.get_VT()[8];
+
+       
+       Matrix<10,20> R;
+       build_matrix(X, Y, Z, W, R);
+
+       //Columns are:
+       // x^3 y^3 x^2y xy^2 x^2z x^2 y^2 x^2z y^2 xyz xy | z^2x zx x    z^2y 
zy y   z^3 z^2 z 1 
+       gauss_jordan(R);
+
+       //Build the B matrix (Eqn 13 1/2)
+       //Polynomials of degree N are stored in a Vector<N+1> with Vector[0] as 
the coefficient of 1.
+       //
+       //These come from the right hand part of R
+       // 10     11   12   13     14  15   16    17   18   19
+       // z^2x   zx   x    z^2y   zy   y   z^3   z^2   z   1 
+
+       //<k> = <e> - z<f>   e == Row 4, f == Row 5
+       //<l> = <g> - z<h>   g == Row 6, h == Row 7
+       //<m> = <i> - z<j>   i == Row 8, j == Row 9
+
+       /*
+        [ b11 b12 b13 ]
+       B = [ b21 b22 b23 ] 
+        [ b31 b32 b33 ]
+       */
+       
+       //b_11 is <k> coefficients of x
+       //b_21 is <l> coefficients of x
+       //b_31 is <m> coefficients of x
+       Vector<4> b_11 = makeVector(R[4][12], R[4][11], R[4][10], 0) - 
makeVector(0, R[5][12], R[5][11], R[5][10]);
+       Vector<4> b_21 = makeVector(R[6][12], R[6][11], R[6][10], 0) - 
makeVector(0, R[7][12], R[7][11], R[7][10]);
+       Vector<4> b_31 = makeVector(R[8][12], R[8][11], R[8][10], 0) - 
makeVector(0, R[9][12], R[9][11], R[9][10]);
+       
+       //b_12 is <k> coefficients of y
+       //b_22 is <l> coefficients of y
+       //b_32 is <R> coefficients of y
+       Vector<4> b_12 = makeVector(R[4][15], R[4][14], R[4][13], 0) - 
makeVector(0, R[5][15], R[5][14], R[5][13]);
+       Vector<4> b_22 = makeVector(R[6][15], R[6][14], R[6][13], 0) - 
makeVector(0, R[7][15], R[7][14], R[7][13]);
+       Vector<4> b_32 = makeVector(R[8][15], R[8][14], R[8][13], 0) - 
makeVector(0, R[9][15], R[9][14], R[9][13]);
+
+       //b_12 is <k> coefficients of 1
+       //b_22 is <l> coefficients of 1
+       //b_32 is <R> coefficients of 1
+       Vector<5> b_13 = makeVector(R[4][19], R[4][18], R[4][17], R[4][16], 0) 
- makeVector(0, R[5][19], R[5][18], R[5][17], R[5][16]);
+       Vector<5> b_23 = makeVector(R[6][19], R[6][18], R[6][17], R[6][16], 0) 
- makeVector(0, R[5][19], R[7][18], R[7][17], R[7][16]);
+       Vector<5> b_33 = makeVector(R[8][19], R[8][18], R[8][17], R[8][16], 0) 
- makeVector(0, R[5][19], R[9][18], R[9][17], R[9][16]);
+
+       //Compute the Determinant of B using expansion by minors
+       //Not quite Eqn 24--28. Nister uses col/row not row/col
+       //
+       // Det = b13 (b21 b32 -b31 b22) - b23 ( b11 b32 - b31 b12) + b33 ( b11 
b22 - b21 b12)
+       //     = b13  * p1 - b23  * p2 + b33 * p3
+       Vector<8> p1 = poly_mul(b_12, b_23) - poly_mul(b_13, b_22);
+       Vector<8> p2 = poly_mul(b_13, b_21) - poly_mul(b_11, b_23);
+       Vector<7> p3 = poly_mul(b_11, b_22) - poly_mul(b_21, b_12);
+       
+       //The polynomial is...
+       Vector<11> n = poly_mul(p1, b_31) + poly_mul(p2, b_32) + poly_mul(p3, 
b_33);
+
+       Cpx roots[10];  
+       
+       //Use the CCMath root finder.
+       //-1, 1 seem to work OK.
+       //
+       // Return value means:
+       // 0 -> normal exit
+    // m>0 -> convergence failure for roots k<m
+       int num = plrt(&n[0], 10, roots, -1, 1);
+
+       vector<Matrix<3> > Es;
+
+       for(int i=num; i < 10; i++)
+       {
+               if(abs(roots[i].im) < 1e-10)
+               {
+                       double z = roots[i].re;
+                       
+                       //Solve the linear system in x, y for the forst two 
rows of b
+                       // [b11 b12 b13] [x]   [ 0 ]
+                       // [b21 b22 b23] [y] = [ 0 ]
+                       //
+                       //  Rearrange to give:
+                       //  
+                       // [b11 b12] [x]    [ b13 ]
+                       // [b21 b22] [y] = -[ b23 ]
+                       //
+                       // Solve and it gives:
+                       // Eqn 28. 
+                       double x = polyval(p1, z)/polyval(p3,z);
+                       double y = polyval(p2, z)/polyval(p3,z);
+
+                       Es.push_back(x * as_matrix(X) + y*as_matrix(Y) + 
z*as_matrix(Z) + as_matrix(W));
+               }
+       }
+
+       return Es;
+}
+
+

Index: src/five_point_buildmatrix.cpp
===================================================================
RCS file: src/five_point_buildmatrix.cpp
diff -N src/five_point_buildmatrix.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/five_point_buildmatrix.cpp      22 Apr 2009 17:05:25 -0000      1.1
@@ -0,0 +1,743 @@
+#include <TooN/TooN.h>
+
+using namespace TooN;
+
+void build_matrix(const Vector<9>& X, const Vector<9>& Y, const Vector<9>& Z, 
const Vector<9>& W, Matrix<10,20>& R)
+{
+     const double t1 = X[0]*X[0];
+     const double t2 = X[1]*X[1];
+     const double t3 = X[2]*X[2];
+     const double t4 = t1+t2+t3;
+     const double t9 = X[0]*X[3]+X[1]*X[4]+X[2]*X[5];
+     const double t14 = X[0]*X[6]+X[1]*X[7]+X[2]*X[8];
+     const double t16 = X[3]*X[3];
+     const double t17 = X[4]*X[4];
+     const double t18 = X[5]*X[5];
+     const double t19 = X[6]*X[6];
+     const double t20 = X[7]*X[7];
+     const double t21 = X[8]*X[8];
+     const double t22 = -t1-t2-t3-t16-t17-t18-t19-t20-t21;
+     const double t26 = Y[0]*Y[0];
+     const double t27 = Y[1]*Y[1];
+     const double t28 = Y[2]*Y[2];
+     const double t29 = t26+t27+t28;
+     const double t34 = Y[0]*Y[3]+Y[1]*Y[4]+Y[2]*Y[5];
+     const double t39 = Y[0]*Y[6]+Y[1]*Y[7]+Y[2]*Y[8];
+     const double t41 = Y[3]*Y[3];
+     const double t42 = Y[4]*Y[4];
+     const double t43 = Y[5]*Y[5];
+     const double t44 = Y[6]*Y[6];
+     const double t45 = Y[7]*Y[7];
+     const double t46 = Y[8]*Y[8];
+     const double t47 = -t26-t27-t28-t41-t42-t43-t44-t45-t46;
+     const double t52 = Y[0]*X[0];
+     const double t53 = Y[1]*X[1];
+     const double t54 = Y[2]*X[2];
+     const double t55 = t52+t53+t54;
+     const double t65 = 
X[0]*Y[3]+Y[0]*X[3]+X[1]*Y[4]+Y[1]*X[4]+X[2]*Y[5]+Y[2]*X[5];
+     const double t75 = 
X[0]*Y[6]+Y[0]*X[6]+X[1]*Y[7]+Y[1]*X[7]+X[2]*Y[8]+Y[2]*X[8];
+     const double t80 = Y[3]*X[3];
+     const double t81 = Y[4]*X[4];
+     const double t82 = Y[5]*X[5];
+     const double t83 = Y[6]*X[6];
+     const double t84 = Y[7]*X[7];
+     const double t85 = Y[8]*X[8];
+     const double t86 = -t52-t53-t54-t80-t81-t82-t83-t84-t85;
+     const double t103 = Z[0]*X[0];
+     const double t104 = Z[1]*X[1];
+     const double t105 = Z[2]*X[2];
+     const double t106 = t103+t104+t105;
+     const double t116 = 
X[0]*Z[3]+Z[0]*X[3]+X[1]*Z[4]+Z[1]*X[4]+X[2]*Z[5]+Z[2]*X[5];
+     const double t126 = 
X[0]*Z[6]+Z[0]*X[6]+X[1]*Z[7]+Z[1]*X[7]+X[2]*Z[8]+Z[2]*X[8];
+     const double t131 = Z[3]*X[3];
+     const double t132 = Z[4]*X[4];
+     const double t133 = Z[5]*X[5];
+     const double t134 = Z[6]*X[6];
+     const double t135 = Z[7]*X[7];
+     const double t136 = Z[8]*X[8];
+     const double t137 = -t103-t104-t105-t131-t132-t133-t134-t135-t136;
+     const double t141 = W[0]*X[0];
+     const double t142 = W[1]*X[1];
+     const double t143 = W[2]*X[2];
+     const double t144 = t141+t142+t143;
+     const double t154 = 
X[0]*W[3]+W[0]*X[3]+X[1]*W[4]+W[1]*X[4]+X[2]*W[5]+W[2]*X[5];
+     const double t164 = 
X[0]*W[6]+W[0]*X[6]+X[1]*W[7]+W[1]*X[7]+X[2]*W[8]+W[2]*X[8];
+     const double t169 = W[3]*X[3];
+     const double t170 = W[4]*X[4];
+     const double t171 = W[5]*X[5];
+     const double t172 = W[6]*X[6];
+     const double t173 = W[7]*X[7];
+     const double t174 = W[8]*X[8];
+     const double t175 = -t141-t142-t143-t169-t170-t171-t172-t173-t174;
+     const double t179 = Z[0]*Y[0];
+     const double t180 = Z[1]*Y[1];
+     const double t181 = Z[2]*Y[2];
+     const double t182 = t179+t180+t181;
+     const double t192 = 
Y[0]*Z[3]+Z[0]*Y[3]+Y[1]*Z[4]+Z[1]*Y[4]+Y[2]*Z[5]+Z[2]*Y[5];
+     const double t202 = 
Y[0]*Z[6]+Z[0]*Y[6]+Y[1]*Z[7]+Z[1]*Y[7]+Y[2]*Z[8]+Z[2]*Y[8];
+     const double t207 = Z[3]*Y[3];
+     const double t208 = Z[4]*Y[4];
+     const double t209 = Z[5]*Y[5];
+     const double t210 = Z[6]*Y[6];
+     const double t211 = Z[7]*Y[7];
+     const double t212 = Z[8]*Y[8];
+     const double t213 = -t179-t180-t181-t207-t208-t209-t210-t211-t212;
+     const double t217 = W[0]*Y[0];
+     const double t218 = W[1]*Y[1];
+     const double t219 = W[2]*Y[2];
+     const double t220 = t217+t218+t219;
+     const double t230 = 
Y[0]*W[3]+W[0]*Y[3]+Y[1]*W[4]+W[1]*Y[4]+Y[2]*W[5]+W[2]*Y[5];
+     const double t240 = 
Y[0]*W[6]+W[0]*Y[6]+Y[1]*W[7]+W[1]*Y[7]+Y[2]*W[8]+W[2]*Y[8];
+     const double t245 = W[3]*Y[3];
+     const double t246 = W[4]*Y[4];
+     const double t247 = W[5]*Y[5];
+     const double t248 = W[6]*Y[6];
+     const double t249 = W[7]*Y[7];
+     const double t250 = W[8]*Y[8];
+     const double t251 = -t217-t218-t219-t245-t246-t247-t248-t249-t250;
+     const double t275 = 
4.0*t55*Z[0]+4.0*t106*Y[0]+4.0*t182*X[0]+2.0*t65*Z[3]+2.0*t116*Y
+[3]+2.0*t192*X[3]+2.0*t75*Z[6]+2.0*t126*Y[6]+2.0*t202*X[6]+2.0*t86*Z[0]+2.0*
+t137*Y[0]+2.0*t213*X[0];
+     const double t297 = 
4.0*t55*W[0]+4.0*t144*Y[0]+4.0*t220*X[0]+2.0*t65*W[3]+2.0*t154*Y
+[3]+2.0*t230*X[3]+2.0*t75*W[6]+2.0*t164*Y[6]+2.0*t240*X[6]+2.0*t86*W[0]+2.0*
+t175*Y[0]+2.0*t251*X[0];
+     const double t300 = Z[0]*Z[0];
+     const double t301 = Z[1]*Z[1];
+     const double t302 = Z[2]*Z[2];
+     const double t303 = t300+t301+t302;
+     const double t310 = Z[0]*Z[3]+Z[1]*Z[4]+Z[2]*Z[5];
+     const double t317 = Z[0]*Z[6]+Z[1]*Z[7]+Z[2]*Z[8];
+     const double t320 = Z[3]*Z[3];
+     const double t321 = Z[4]*Z[4];
+     const double t322 = Z[5]*Z[5];
+     const double t323 = Z[6]*Z[6];
+     const double t324 = Z[7]*Z[7];
+     const double t325 = Z[8]*Z[8];
+     const double t326 = -t300-t301-t302-t320-t321-t322-t323-t324-t325;
+     const double t334 = W[0]*Z[0];
+     const double t335 = W[1]*Z[1];
+     const double t336 = W[2]*Z[2];
+     const double t337 = t334+t335+t336;
+     const double t350 = 
Z[0]*W[3]+W[0]*Z[3]+Z[1]*W[4]+W[1]*Z[4]+Z[2]*W[5]+W[2]*Z[5];
+     const double t363 = 
Z[0]*W[6]+W[0]*Z[6]+Z[1]*W[7]+W[1]*Z[7]+Z[2]*W[8]+W[2]*Z[8];
+     const double t368 = W[3]*Z[3];
+     const double t369 = W[4]*Z[4];
+     const double t370 = W[5]*Z[5];
+     const double t371 = W[6]*Z[6];
+     const double t372 = W[7]*Z[7];
+     const double t373 = W[8]*Z[8];
+     const double t374 = -t334-t335-t336-t368-t369-t370-t371-t372-t373;
+     const double t376 = 
4.0*t106*W[0]+4.0*t144*Z[0]+4.0*t337*X[0]+2.0*t116*W[3]+2.0*t154*Z
+[3]+2.0*t350*X[3]+2.0*t126*W[6]+2.0*t164*Z[6]+2.0*t363*X[6]+2.0*t137*W[0]+2.0*
+t175*Z[0]+2.0*t374*X[0];
+     const double t379 = W[0]*W[0];
+     const double t380 = W[1]*W[1];
+     const double t381 = W[2]*W[2];
+     const double t382 = t379+t380+t381;
+     const double t390 = W[0]*W[3]+W[1]*W[4]+W[2]*W[5];
+     const double t398 = W[0]*W[6]+W[1]*W[7]+W[2]*W[8];
+     const double t402 = W[3]*W[3];
+     const double t403 = W[4]*W[4];
+     const double t404 = W[5]*W[5];
+     const double t405 = W[6]*W[6];
+     const double t406 = W[7]*W[7];
+     const double t407 = W[8]*W[8];
+     const double t408 = -t379-t380-t381-t402-t403-t404-t405-t406-t407;
+     const double t445 = 
4.0*t182*W[0]+4.0*t220*Z[0]+4.0*t337*Y[0]+2.0*t192*W[3]+2.0*t230*Z
+[3]+2.0*t350*Y[3]+2.0*t202*W[6]+2.0*t240*Z[6]+2.0*t363*Y[6]+2.0*t213*W[0]+2.0*
+t251*Z[0]+2.0*t374*Y[0];
+     const double t614 = 
4.0*t55*Z[1]+4.0*t106*Y[1]+4.0*t182*X[1]+2.0*t65*Z[4]+2.0*t116*Y
+[4]+2.0*t192*X[4]+2.0*t75*Z[7]+2.0*t126*Y[7]+2.0*t202*X[7]+2.0*t86*Z[1]+2.0*
+t137*Y[1]+2.0*t213*X[1];
+     const double t636 = 
4.0*t55*W[1]+4.0*t144*Y[1]+4.0*t220*X[1]+2.0*t65*W[4]+2.0*t154*Y
+[4]+2.0*t230*X[4]+2.0*t75*W[7]+2.0*t164*Y[7]+2.0*t240*X[7]+2.0*t86*W[1]+2.0*
+t175*Y[1]+2.0*t251*X[1];
+     const double t671 = 
4.0*t106*W[1]+4.0*t144*Z[1]+4.0*t337*X[1]+2.0*t116*W[4]+2.0*t154*Z
+[4]+2.0*t350*X[4]+2.0*t126*W[7]+2.0*t164*Z[7]+2.0*t363*X[7]+2.0*t137*W[1]+2.0*
+t175*Z[1]+2.0*t374*X[1];
+     const double t721 = 
4.0*t182*W[1]+4.0*t220*Z[1]+4.0*t337*Y[1]+2.0*t192*W[4]+2.0*t230*Z
+[4]+2.0*t350*Y[4]+2.0*t202*W[7]+2.0*t240*Z[7]+2.0*t363*Y[7]+2.0*t213*W[1]+2.0*
+t251*Z[1]+2.0*t374*Y[1];
+     const double t890 = 
4.0*t55*Z[2]+4.0*t106*Y[2]+4.0*t182*X[2]+2.0*t65*Z[5]+2.0*t116*Y
+[5]+2.0*t192*X[5]+2.0*t75*Z[8]+2.0*t126*Y[8]+2.0*t202*X[8]+2.0*t86*Z[2]+2.0*
+t137*Y[2]+2.0*t213*X[2];
+     const double t912 = 
4.0*t55*W[2]+4.0*t144*Y[2]+4.0*t220*X[2]+2.0*t65*W[5]+2.0*t154*Y
+[5]+2.0*t230*X[5]+2.0*t75*W[8]+2.0*t164*Y[8]+2.0*t240*X[8]+2.0*t86*W[2]+2.0*
+t175*Y[2]+2.0*t251*X[2];
+     const double t947 = 
4.0*t106*W[2]+4.0*t144*Z[2]+4.0*t337*X[2]+2.0*t116*W[5]+2.0*t154*Z
+[5]+2.0*t350*X[5]+2.0*t126*W[8]+2.0*t164*Z[8]+2.0*t363*X[8]+2.0*t137*W[2]+2.0*
+t175*Z[2]+2.0*t374*X[2];
+     const double t997 = 
4.0*t182*W[2]+4.0*t220*Z[2]+4.0*t337*Y[2]+2.0*t192*W[5]+2.0*t230*Z
+[5]+2.0*t350*Y[5]+2.0*t202*W[8]+2.0*t240*Z[8]+2.0*t363*Y[8]+2.0*t213*W[2]+2.0*
+t251*Z[2]+2.0*t374*Y[2];
+     const double t1056 = t16+t17+t18;
+     const double t1061 = X[3]*X[6]+X[4]*X[7]+X[5]*X[8];
+     const double t1067 = t41+t42+t43;
+     const double t1072 = Y[3]*Y[6]+Y[4]*Y[7]+Y[5]*Y[8];
+     const double t1081 = t80+t81+t82;
+     const double t1091 = 
X[3]*Y[6]+Y[3]*X[6]+X[4]*Y[7]+Y[4]*X[7]+X[5]*Y[8]+Y[5]*X[8];
+     const double t1115 = t131+t132+t133;
+     const double t1125 = 
X[3]*Z[6]+Z[3]*X[6]+X[4]*Z[7]+Z[4]*X[7]+X[5]*Z[8]+Z[5]*X[8];
+     const double t1136 = t169+t170+t171;
+     const double t1146 = 
X[3]*W[6]+W[3]*X[6]+X[4]*W[7]+W[4]*X[7]+X[5]*W[8]+W[5]*X[8];
+     const double t1157 = t207+t208+t209;
+     const double t1167 = 
Y[3]*Z[6]+Z[3]*Y[6]+Y[4]*Z[7]+Z[4]*Y[7]+Y[5]*Z[8]+Z[5]*Y[8];
+     const double t1178 = t245+t246+t247;
+     const double t1188 = 
Y[3]*W[6]+W[3]*Y[6]+Y[4]*W[7]+W[4]*Y[7]+Y[5]*W[8]+W[5]*Y[8];
+     const double t1216 = 
2.0*t65*Z[0]+2.0*t116*Y[0]+2.0*t192*X[0]+4.0*t1081*Z[3]+4.0*t1115
+*Y[3]+4.0*t1157*X[3]+2.0*t1091*Z[6]+2.0*t1125*Y[6]+2.0*t1167*X[6]+2.0*t86*Z[3]+
+2.0*t137*Y[3]+2.0*t213*X[3];
+     const double t1238 = 
2.0*t65*W[0]+2.0*t154*Y[0]+2.0*t230*X[0]+4.0*t1081*W[3]+4.0*t1136
+*Y[3]+4.0*t1178*X[3]+2.0*t1091*W[6]+2.0*t1146*Y[6]+2.0*t1188*X[6]+2.0*t86*W[3]+
+2.0*t175*Y[3]+2.0*t251*X[3];
+     const double t1244 = t320+t321+t322;
+     const double t1251 = Z[3]*Z[6]+Z[4]*Z[7]+Z[5]*Z[8];
+     const double t1267 = t368+t369+t370;
+     const double t1280 = 
Z[3]*W[6]+W[3]*Z[6]+Z[4]*W[7]+W[4]*Z[7]+Z[5]*W[8]+W[5]*Z[8];
+     const double t1286 = 
2.0*t116*W[0]+2.0*t154*Z[0]+2.0*t350*X[0]+4.0*t1115*W[3]+4.0*
+t1136*Z[3]+4.0*t1267*X[3]+2.0*t1125*W[6]+2.0*t1146*Z[6]+2.0*t1280*X[6]+2.0*t137
+*W[3]+2.0*t175*Z[3]+2.0*t374*X[3];
+     const double t1293 = t402+t403+t404;
+     const double t1301 = W[3]*W[6]+W[4]*W[7]+W[5]*W[8];
+     const double t1341 = 
2.0*t192*W[0]+2.0*t230*Z[0]+2.0*t350*Y[0]+4.0*t1157*W[3]+4.0*
+t1178*Z[3]+4.0*t1267*Y[3]+2.0*t1167*W[6]+2.0*t1188*Z[6]+2.0*t1280*Y[6]+2.0*t213
+*W[3]+2.0*t251*Z[3]+2.0*t374*Y[3];
+     const double t1510 = 
2.0*t65*Z[1]+2.0*t116*Y[1]+2.0*t192*X[1]+4.0*t1081*Z[4]+4.0*t1115
+*Y[4]+4.0*t1157*X[4]+2.0*t1091*Z[7]+2.0*t1125*Y[7]+2.0*t1167*X[7]+2.0*t86*Z[4]+
+2.0*t137*Y[4]+2.0*t213*X[4];
+     const double t1532 = 
2.0*t65*W[1]+2.0*t154*Y[1]+2.0*t230*X[1]+4.0*t1081*W[4]+4.0*t1136
+*Y[4]+4.0*t1178*X[4]+2.0*t1091*W[7]+2.0*t1146*Y[7]+2.0*t1188*X[7]+2.0*t86*W[4]+
+2.0*t175*Y[4]+2.0*t251*X[4];
+     const double t1567 = 
2.0*t116*W[1]+2.0*t154*Z[1]+2.0*t350*X[1]+4.0*t1115*W[4]+4.0*
+t1136*Z[4]+4.0*t1267*X[4]+2.0*t1125*W[7]+2.0*t1146*Z[7]+2.0*t1280*X[7]+2.0*t137
+*W[4]+2.0*t175*Z[4]+2.0*t374*X[4];
+     const double t1617 = 
2.0*t192*W[1]+2.0*t230*Z[1]+2.0*t350*Y[1]+4.0*t1157*W[4]+4.0*
+t1178*Z[4]+4.0*t1267*Y[4]+2.0*t1167*W[7]+2.0*t1188*Z[7]+2.0*t1280*Y[7]+2.0*t213
+*W[4]+2.0*t251*Z[4]+2.0*t374*Y[4];
+     const double t1786 = 
2.0*t65*Z[2]+2.0*t116*Y[2]+2.0*t192*X[2]+4.0*t1081*Z[5]+4.0*t1115
+*Y[5]+4.0*t1157*X[5]+2.0*t1091*Z[8]+2.0*t1125*Y[8]+2.0*t1167*X[8]+2.0*t86*Z[5]+
+2.0*t137*Y[5]+2.0*t213*X[5];
+     const double t1808 = 
2.0*t65*W[2]+2.0*t154*Y[2]+2.0*t230*X[2]+4.0*t1081*W[5]+4.0*t1136
+*Y[5]+4.0*t1178*X[5]+2.0*t1091*W[8]+2.0*t1146*Y[8]+2.0*t1188*X[8]+2.0*t86*W[5]+
+2.0*t175*Y[5]+2.0*t251*X[5];
+     const double t1843 = 
2.0*t116*W[2]+2.0*t154*Z[2]+2.0*t350*X[2]+4.0*t1115*W[5]+4.0*
+t1136*Z[5]+4.0*t1267*X[5]+2.0*t1125*W[8]+2.0*t1146*Z[8]+2.0*t1280*X[8]+2.0*t137
+*W[5]+2.0*t175*Z[5]+2.0*t374*X[5];
+     const double t1893 = 
2.0*t192*W[2]+2.0*t230*Z[2]+2.0*t350*Y[2]+4.0*t1157*W[5]+4.0*
+t1178*Z[5]+4.0*t1267*Y[5]+2.0*t1167*W[8]+2.0*t1188*Z[8]+2.0*t1280*Y[8]+2.0*t213
+*W[5]+2.0*t251*Z[5]+2.0*t374*Y[5];
+     const double t1953 = t19+t20+t21;
+     const double t1960 = t44+t45+t46;
+     const double t1972 = t83+t84+t85;
+     const double t1999 = t134+t135+t136;
+     const double t2013 = t172+t173+t174;
+     const double t2027 = t210+t211+t212;
+     const double t2041 = t248+t249+t250;
+     const double t2069 = 
2.0*t75*Z[0]+2.0*t126*Y[0]+2.0*t202*X[0]+2.0*t1091*Z[3]+2.0*t1125
+*Y[3]+2.0*t1167*X[3]+4.0*t1972*Z[6]+4.0*t1999*Y[6]+4.0*t2027*X[6]+2.0*t86*Z[6]+
+2.0*t137*Y[6]+2.0*t213*X[6];
+     const double t2091 = 
2.0*t75*W[0]+2.0*t164*Y[0]+2.0*t240*X[0]+2.0*t1091*W[3]+2.0*t1146
+*Y[3]+2.0*t1188*X[3]+4.0*t1972*W[6]+4.0*t2013*Y[6]+4.0*t2041*X[6]+2.0*t86*W[6]+
+2.0*t175*Y[6]+2.0*t251*X[6];
+     const double t2100 = t323+t324+t325;
+     const double t2122 = t371+t372+t373;
+     const double t2128 = 
2.0*t126*W[0]+2.0*t164*Z[0]+2.0*t363*X[0]+2.0*t1125*W[3]+2.0*
+t1146*Z[3]+2.0*t1280*X[3]+4.0*t1999*W[6]+4.0*t2013*Z[6]+4.0*t2122*X[6]+2.0*t137
+*W[6]+2.0*t175*Z[6]+2.0*t374*X[6];
+     const double t2139 = t405+t406+t407;
+     const double t2179 = 
2.0*t202*W[0]+2.0*t240*Z[0]+2.0*t363*Y[0]+2.0*t1167*W[3]+2.0*
+t1188*Z[3]+2.0*t1280*Y[3]+4.0*t2027*W[6]+4.0*t2041*Z[6]+4.0*t2122*Y[6]+2.0*t213
+*W[6]+2.0*t251*Z[6]+2.0*t374*Y[6];
+     const double t2348 = 
2.0*t75*Z[1]+2.0*t126*Y[1]+2.0*t202*X[1]+2.0*t1091*Z[4]+2.0*t1125
+*Y[4]+2.0*t1167*X[4]+4.0*t1972*Z[7]+4.0*t1999*Y[7]+4.0*t2027*X[7]+2.0*t86*Z[7]+
+2.0*t137*Y[7]+2.0*t213*X[7];
+     const double t2370 = 
2.0*t75*W[1]+2.0*t164*Y[1]+2.0*t240*X[1]+2.0*t1091*W[4]+2.0*t1146
+*Y[4]+2.0*t1188*X[4]+4.0*t1972*W[7]+4.0*t2013*Y[7]+4.0*t2041*X[7]+2.0*t86*W[7]+
+2.0*t175*Y[7]+2.0*t251*X[7];
+     const double t2405 = 
2.0*t126*W[1]+2.0*t164*Z[1]+2.0*t363*X[1]+2.0*t1125*W[4]+2.0*
+t1146*Z[4]+2.0*t1280*X[4]+4.0*t1999*W[7]+4.0*t2013*Z[7]+4.0*t2122*X[7]+2.0*t137
+*W[7]+2.0*t175*Z[7]+2.0*t374*X[7];
+     const double t2455 = 
2.0*t202*W[1]+2.0*t240*Z[1]+2.0*t363*Y[1]+2.0*t1167*W[4]+2.0*
+t1188*Z[4]+2.0*t1280*Y[4]+4.0*t2027*W[7]+4.0*t2041*Z[7]+4.0*t2122*Y[7]+2.0*t213
+*W[7]+2.0*t251*Z[7]+2.0*t374*Y[7];
+     const double t2624 = 
2.0*t75*Z[2]+2.0*t126*Y[2]+2.0*t202*X[2]+2.0*t1091*Z[5]+2.0*t1125
+*Y[5]+2.0*t1167*X[5]+4.0*t1972*Z[8]+4.0*t1999*Y[8]+4.0*t2027*X[8]+2.0*t86*Z[8]+
+2.0*t137*Y[8]+2.0*t213*X[8];
+     const double t2646 = 
2.0*t75*W[2]+2.0*t164*Y[2]+2.0*t240*X[2]+2.0*t1091*W[5]+2.0*t1146
+*Y[5]+2.0*t1188*X[5]+4.0*t1972*W[8]+4.0*t2013*Y[8]+4.0*t2041*X[8]+2.0*t86*W[8]+
+2.0*t175*Y[8]+2.0*t251*X[8];
+     const double t2681 = 
2.0*t126*W[2]+2.0*t164*Z[2]+2.0*t363*X[2]+2.0*t1125*W[5]+2.0*
+t1146*Z[5]+2.0*t1280*X[5]+4.0*t1999*W[8]+4.0*t2013*Z[8]+4.0*t2122*X[8]+2.0*t137
+*W[8]+2.0*t175*Z[8]+2.0*t374*X[8];
+     const double t2731 = 
2.0*t202*W[2]+2.0*t240*Z[2]+2.0*t363*Y[2]+2.0*t1167*W[5]+2.0*
+t1188*Z[5]+2.0*t1280*Y[5]+4.0*t2027*W[8]+4.0*t2041*Z[8]+4.0*t2122*Y[8]+2.0*t213
+*W[8]+2.0*t251*Z[8]+2.0*t374*Y[8];
+     const double t2789 = X[6]*X[2];
+     const double t2791 = X[1]*X[6];
+     const double t2793 = X[3]*X[2];
+     const double t2795 = X[3]*X[1];
+     const double t2797 = X[0]*X[5];
+     const double t2799 = X[0]*X[4];
+     const double t2802 = Y[0]*Y[5];
+     const double t2804 = Y[0]*Y[4];
+     const double t2806 = Y[3]*Y[2];
+     const double t2808 = Y[1]*Y[6];
+     const double t2810 = Y[6]*Y[2];
+     const double t2812 = Y[3]*Y[1];
+     const double t2816 = X[0]*Y[4];
+     const double t2818 = X[1]*Y[6];
+     const double t2821 = Y[3]*X[1];
+     const double t2823 = Y[3]*X[2];
+     const double t2825 = Y[6]*X[2];
+     const double t2827 = Y[0]*X[4];
+     const double t2829 = Y[1]*X[6];
+     const double t2831 = Y[0]*X[5];
+     const double t2834 = X[6]*Y[2];
+     const double t2838 = X[0]*Y[5];
+     const double t2840 = X[3]*Y[1];
+     const double t2843 = X[3]*Y[2];
+     const double t2845 = 
-t2797*Y[7]+t2816*X[8]+t2818*X[5]+t2793*Y[7]-t2821*X[8]+t2823*X
+[7]-t2825*X[4]+t2827*X[8]+t2829*X[5]-t2831*X[7]+t2791*Y[5]-t2834*X[4]-t2789*Y
+[4]+t2799*Y[8]-t2838*X[7]-t2840*X[8]-t2795*Y[8]+t2843*X[7];
+     const double t2864 = 
t2829*Y[5]-t2834*Y[4]+t2808*X[5]+t2818*Y[5]-t2810*X[4]-t2825*Y[4]
++t2816*Y[8]-t2840*Y[8]+t2843*Y[7]-t2812*X[8]-t2821*Y[8]+t2806*X[7]+t2823*Y[7]-
+t2838*Y[7]+t2827*Y[8]-t2802*X[7]-t2831*Y[7]+t2804*X[8];
+     const double t2865 = X[0]*Z[4];
+     const double t2867 = X[6]*Z[2];
+     const double t2869 = X[1]*Z[6];
+     const double t2871 = Z[0]*X[5];
+     const double t2873 = Z[0]*X[4];
+     const double t2875 = Z[3]*X[1];
+     const double t2877 = Z[3]*X[2];
+     const double t2882 = X[3]*Z[1];
+     const double t2884 = Z[1]*X[6];
+     const double t2887 = Z[6]*X[2];
+     const double t2889 = X[0]*Z[5];
+     const double t2892 = X[3]*Z[2];
+     const double t2895 = 
t2865*X[8]-t2867*X[4]+t2869*X[5]-t2871*X[7]+t2873*X[8]-t2875*X[8]
++t2877*X[7]+t2791*Z[5]-t2789*Z[4]-t2797*Z[7]-t2882*X[8]+t2884*X[5]+t2799*Z[8]-
+t2887*X[4]-t2889*X[7]-t2795*Z[8]+t2892*X[7]+t2793*Z[7];
+     const double t2896 = X[3]*W[1];
+     const double t2898 = X[6]*W[2];
+     const double t2901 = W[1]*X[6];
+     const double t2904 = W[3]*X[2];
+     const double t2906 = W[3]*X[1];
+     const double t2909 = X[1]*W[6];
+     const double t2911 = W[6]*X[2];
+     const double t2913 = W[0]*X[5];
+     const double t2916 = X[3]*W[2];
+     const double t2919 = X[0]*W[5];
+     const double t2921 = X[0]*W[4];
+     const double t2924 = W[0]*X[4];
+     const double t2926 = 
-t2896*X[8]-t2898*X[4]-t2789*W[4]+t2901*X[5]+t2791*W[5]+t2904*X
+[7]-t2906*X[8]-t2795*W[8]+t2909*X[5]-t2911*X[4]-t2913*X[7]+t2793*W[7]+t2916*X
+[7]-t2797*W[7]-t2919*X[7]+t2921*X[8]+t2799*W[8]+t2924*X[8];
+     const double t2927 = Z[0]*Y[4];
+     const double t2929 = Z[6]*Y[2];
+     const double t2931 = Y[0]*Z[4];
+     const double t2934 = Y[0]*Z[5];
+     const double t2937 = Z[0]*Y[5];
+     const double t2940 = Y[3]*Z[2];
+     const double t2942 = Y[3]*Z[1];
+     const double t2945 = Y[1]*Z[6];
+     const double t2947 = Z[1]*Y[6];
+     const double t2949 = Y[6]*Z[2];
+     const double t2953 = Z[3]*Y[1];
+     const double t2955 = Z[3]*Y[2];
+     const double t2957 = 
t2927*Y[8]-t2929*Y[4]+t2931*Y[8]+t2804*Z[8]-t2934*Y[7]-t2802*Z[7]
+-t2937*Y[7]-t2812*Z[8]+t2940*Y[7]-t2942*Y[8]+t2808*Z[5]+t2945*Y[5]+t2947*Y[5]-
+t2949*Y[4]-t2810*Z[4]+t2806*Z[7]-t2953*Y[8]+t2955*Y[7];
+     const double t2958 = Y[0]*W[4];
+     const double t2961 = Y[0]*W[5];
+     const double t2963 = W[0]*Y[4];
+     const double t2966 = W[0]*Y[5];
+     const double t2968 = Y[3]*W[2];
+     const double t2971 = Y[3]*W[1];
+     const double t2973 = W[3]*Y[2];
+     const double t2975 = W[3]*Y[1];
+     const double t2978 = Y[6]*W[2];
+     const double t2981 = W[1]*Y[6];
+     const double t2984 = Y[1]*W[6];
+     const double t2986 = W[6]*Y[2];
+     const double t2988 = 
t2958*Y[8]-t2802*W[7]-t2961*Y[7]+t2963*Y[8]+t2804*W[8]-t2966*Y[7]
++t2968*Y[7]+t2806*W[7]-t2971*Y[8]+t2973*Y[7]-t2975*Y[8]+t2808*W[5]-t2978*Y[4]-
+t2810*W[4]+t2981*Y[5]-t2812*W[8]+t2984*Y[5]-t2986*Y[4];
+     const double t3007 = 
t2945*X[5]-t2871*Y[7]+t2927*X[8]+t2955*X[7]+t2877*Y[7]-t2953*X[8]
+-t2875*Y[8]-t2834*Z[4]+t2869*Y[5]+t2940*X[7]+t2823*Z[7]-t2831*Z[7]+t2931*X[8]+
+t2827*Z[8]-t2934*X[7]+t2829*Z[5]+t2873*Y[8]-t2937*X[7];
+     const double t3026 = 
-t2942*X[8]-t2929*X[4]-t2887*Y[4]-t2882*Y[8]+t2884*Y[5]-t2867*Y
+[4]+t2947*X[5]-t2949*X[4]+t2818*Z[5]-t2825*Z[4]+t2865*Y[8]+t2816*Z[8]-t2889*Y
+[7]-t2838*Z[7]-t2840*Z[8]+t2892*Y[7]+t2843*Z[7]-t2821*Z[8];
+     const double t3046 = 
t2984*X[5]+t2909*Y[5]-t2986*X[4]+t2973*X[7]+t2904*Y[7]-t2975*X[8]
+-t2906*Y[8]+t2829*W[5]+t2901*Y[5]-t2834*W[4]+t2827*W[8]-t2825*W[4]-t2978*X[4]-
+t2966*X[7]-t2898*Y[4]+t2816*W[8]+t2921*Y[8]-t2919*Y[7];
+     const double t3065 = 
-t2838*W[7]+t2818*W[5]+t2963*X[8]+t2924*Y[8]-t2913*Y[7]-t2896*Y
+[8]-t2840*W[8]+t2916*Y[7]+t2823*W[7]-t2971*X[8]+t2968*X[7]-t2911*Y[4]+t2981*X
+[5]+t2958*X[8]-t2961*X[7]-t2831*W[7]+t2843*W[7]-t2821*W[8];
+     const double t3069 = Z[0]*Z[4];
+     const double t3072 = Z[0]*Z[5];
+     const double t3076 = Z[3]*Z[2];
+     const double t3081 = Z[3]*Z[1];
+     const double t3087 = Z[1]*Z[6];
+     const double t3089 = Z[6]*Z[2];
+     const double t3091 = 
-t2889*Z[7]-t2871*Z[7]+t3069*X[8]+t2873*Z[8]-t3072*X[7]+t2877*Z
+[7]-t2875*Z[8]+t3076*X[7]+t2865*Z[8]-t2882*Z[8]+t2892*Z[7]-t3081*X[8]+t2869*Z
+[5]-t2887*Z[4]+t2884*Z[5]-t2867*Z[4]+t3087*X[5]-t3089*X[4];
+     const double t3092 = Z[1]*W[6];
+     const double t3094 = W[6]*Z[2];
+     const double t3097 = Z[0]*W[4];
+     const double t3103 = Z[3]*W[1];
+     const double t3106 = Z[3]*W[2];
+     const double t3109 = W[3]*Z[2];
+     const double t3111 = Z[0]*W[5];
+     const double t3115 = W[1]*Z[6];
+     const double t3118 = 
t3092*X[5]-t3094*X[4]-t2898*Z[4]+t3097*X[8]-t2871*W[7]+t2921*Z[8]
++t2909*Z[5]+t2873*W[8]-t3103*X[8]-t2875*W[8]+t3106*X[7]+t2877*W[7]+t3109*X[7]-
+t3111*X[7]+t2904*Z[7]+t2869*W[5]+t3115*X[5]-t2887*W[4];
+     const double t3119 = Z[6]*W[2];
+     const double t3124 = W[0]*Z[5];
+     const double t3128 = W[0]*Z[4];
+     const double t3134 = W[3]*Z[1];
+     const double t3141 = 
-t3119*X[4]-t2919*Z[7]+t2865*W[8]+t2924*Z[8]-t3124*X[7]-t2913*Z
+[7]-t2889*W[7]+t3128*X[8]+t2892*W[7]-t2882*W[8]+t2916*Z[7]-t2911*Z[4]-t3134*X
+[8]-t2906*Z[8]+t2884*W[5]+t2901*Z[5]-t2867*W[4]-t2896*Z[8];
+     const double t3144 = W[3]*W[2];
+     const double t3146 = W[3]*W[1];
+     const double t3152 = W[1]*W[6];
+     const double t3154 = W[2]*W[6];
+     const double t3162 = W[0]*W[4];
+     const double t3164 = W[0]*W[5];
+     const double t3167 = 
t2904*W[7]+t3144*X[7]-t3146*X[8]-t2898*W[4]+t2901*W[5]+t2909*W[5]
+-t2911*W[4]+t3152*X[5]-t3154*X[4]-t2906*W[8]+t2916*W[7]-t2896*W[8]-t2919*W[7]+
+t2921*W[8]+t2924*W[8]+t3162*X[8]-t3164*X[7]-t2913*W[7];
+     const double t3186 = 
-t2934*Z[7]+t2945*Z[5]+t3069*Y[8]+t2927*Z[8]-t3072*Y[7]-t2937*Z
+[7]-t2949*Z[4]+t2931*Z[8]+t2940*Z[7]-t3081*Y[8]-t2942*Z[8]-t2929*Z[4]+t3087*Y
+[5]-t3089*Y[4]+t2947*Z[5]+t2955*Z[7]-t2953*Z[8]+t3076*Y[7];
+     const double t3205 = 
t3109*Y[7]+t2973*Z[7]-t3134*Y[8]-t2975*Z[8]-t2942*W[8]-t3103*Y[8]
+-t2953*W[8]+t2955*W[7]+t3106*Y[7]+t2945*W[5]+t3115*Y[5]-t2929*W[4]-t3119*Y[4]+
+t2947*W[5]+t2981*Z[5]+t2931*W[8]-t2961*Z[7]-t2934*W[7];
+     const double t3224 = 
t3092*Y[5]-t3094*Y[4]+t2958*Z[8]-t2949*W[4]-t2978*Z[4]+t2984*Z[5]
+-t2986*Z[4]+t2927*W[8]+t3097*Y[8]-t3111*Y[7]-t2937*W[7]+t2963*Z[8]-t3124*Y[7]-
+t2966*Z[7]+t3128*Y[8]+t2940*W[7]+t2968*Z[7]-t2971*Z[8];
+     const double t3244 = 
-t2961*W[7]+t2958*W[8]+t3162*Y[8]+t2963*W[8]-t3164*Y[7]-t2966*W
+[7]-t2975*W[8]+t2968*W[7]-t2971*W[8]+t3144*Y[7]+t2973*W[7]-t3146*Y[8]-t2978*W
+[4]+t2981*W[5]+t3152*Y[5]+t2984*W[5]-t2986*W[4]-t3154*Y[4];
+     const double t3270 = 
t3097*Z[8]-t3072*W[7]-t3111*Z[7]+t3069*W[8]+t3128*Z[8]-t3124*Z[7]
++t3106*Z[7]+t3076*W[7]-t3103*Z[8]-t3081*W[8]+t3109*Z[7]+t3115*Z[5]+t3087*W[5]-
+t3119*Z[4]-t3089*W[4]+t3092*Z[5]-t3094*Z[4]-t3134*Z[8];
+     const double t3289 = 
-t3111*W[7]+t3097*W[8]+t3128*W[8]-t3164*Z[7]-t3124*W[7]+t3162*Z
+[8]-t3134*W[8]+t3106*W[7]-t3103*W[8]+t3144*Z[7]+t3109*W[7]-t3146*Z[8]-t3119*W
+[4]+t3115*W[5]+t3092*W[5]+t3152*Z[5]-t3154*Z[4]-t3094*W[4];
+      R[0][0] = 2.0*t4*X[0]+2.0*t9*X[3]+2.0*t14*X[6]+t22*X[0];
+      R[0][1] = 2.0*t29*Y[0]+2.0*t34*Y[3]+2.0*t39*Y[6]+t47*Y[0];
+      R[0][2] = 2.0*t4*Y[0]+4.0*t55*X[0]+2.0*t9*Y[3]+2.0*t65*X[3]+2.0*t14*Y[6]+
+2.0*t75*X[6]+t22*Y[0]+2.0*t86*X[0];
+      R[0][3] = 4.0*t55*Y[0]+2.0*t29*X[0]+2.0*t65*Y[3]+2.0*t34*X[3]+2.0*t75*Y
+[6]+2.0*t39*X[6]+2.0*t86*Y[0]+t47*X[0];
+      R[0][4] = 2.0*t4*Z[0]+4.0*t106*X[0]+2.0*t9*Z[3]+2.0*t116*X[3]+2.0*t14*Z
+[6]+2.0*t126*X[6]+t22*Z[0]+2.0*t137*X[0];
+      R[0][5] = 2.0*t4*W[0]+4.0*t144*X[0]+2.0*t9*W[3]+2.0*t154*X[3]+2.0*t14*W
+[6]+2.0*t164*X[6]+t22*W[0]+2.0*t175*X[0];
+      R[0][6] = 2.0*t29*Z[0]+4.0*t182*Y[0]+2.0*t34*Z[3]+2.0*t192*Y[3]+2.0*t39*Z
+[6]+2.0*t202*Y[6]+t47*Z[0]+2.0*t213*Y[0];
+      R[0][7] = 2.0*t29*W[0]+4.0*t220*Y[0]+2.0*t34*W[3]+2.0*t230*Y[3]+2.0*t39*W
+[6]+2.0*t240*Y[6]+t47*W[0]+2.0*t251*Y[0];
+      R[0][8] = t275;
+      R[0][9] = t297;
+      R[0][10] = 4.0*t106*Z[0]+2.0*t303*X[0]+2.0*t116*Z[3]+2.0*t310*X[3]+2.0*
+t126*Z[6]+2.0*t317*X[6]+2.0*t137*Z[0]+t326*X[0];
+      R[0][11] = t376;
+      R[0][12] = 4.0*t144*W[0]+2.0*t382*X[0]+2.0*t154*W[3]+2.0*t390*X[3]+2.0*
+t164*W[6]+2.0*t398*X[6]+2.0*t175*W[0]+t408*X[0];
+      R[0][13] = 4.0*t182*Z[0]+2.0*t303*Y[0]+2.0*t192*Z[3]+2.0*t310*Y[3]+2.0*
+t202*Z[6]+2.0*t317*Y[6]+2.0*t213*Z[0]+t326*Y[0];
+      R[0][14] = t445;
+      R[0][15] = 4.0*t220*W[0]+2.0*t382*Y[0]+2.0*t230*W[3]+2.0*t390*Y[3]+2.0*
+t240*W[6]+2.0*t398*Y[6]+2.0*t251*W[0]+t408*Y[0];
+      R[0][16] = 2.0*t303*Z[0]+2.0*t310*Z[3]+2.0*t317*Z[6]+t326*Z[0];
+      R[0][17] = 2.0*t303*W[0]+4.0*t337*Z[0]+2.0*t310*W[3]+2.0*t350*Z[3]+2.0*
+t317*W[6]+2.0*t363*Z[6]+t326*W[0]+2.0*t374*Z[0];
+      R[0][18] = 4.0*t337*W[0]+2.0*t382*Z[0]+2.0*t350*W[3]+2.0*t390*Z[3]+2.0*
+t363*W[6]+2.0*t398*Z[6]+2.0*t374*W[0]+t408*Z[0];
+      R[0][19] = 2.0*t382*W[0]+2.0*t390*W[3]+2.0*t398*W[6]+t408*W[0];
+      R[1][0] = 2.0*t4*X[1]+2.0*t9*X[4]+2.0*t14*X[7]+t22*X[1];
+      R[1][1] = 2.0*t29*Y[1]+2.0*t34*Y[4]+2.0*t39*Y[7]+t47*Y[1];
+      R[1][2] = 2.0*t4*Y[1]+4.0*t55*X[1]+2.0*t9*Y[4]+2.0*t65*X[4]+2.0*t14*Y[7]+
+2.0*t75*X[7]+t22*Y[1]+2.0*t86*X[1];
+      R[1][3] = 4.0*t55*Y[1]+2.0*t29*X[1]+2.0*t65*Y[4]+2.0*t34*X[4]+2.0*t75*Y
+[7]+2.0*t39*X[7]+2.0*t86*Y[1]+t47*X[1];
+      R[1][4] = 2.0*t4*Z[1]+4.0*t106*X[1]+2.0*t9*Z[4]+2.0*t116*X[4]+2.0*t14*Z
+[7]+2.0*t126*X[7]+t22*Z[1]+2.0*t137*X[1];
+      R[1][5] = 2.0*t4*W[1]+4.0*t144*X[1]+2.0*t9*W[4]+2.0*t154*X[4]+2.0*t14*W
+[7]+2.0*t164*X[7]+t22*W[1]+2.0*t175*X[1];
+      R[1][6] = 2.0*t29*Z[1]+4.0*t182*Y[1]+2.0*t34*Z[4]+2.0*t192*Y[4]+2.0*t39*Z
+[7]+2.0*t202*Y[7]+t47*Z[1]+2.0*t213*Y[1];
+      R[1][7] = 2.0*t29*W[1]+4.0*t220*Y[1]+2.0*t34*W[4]+2.0*t230*Y[4]+2.0*t39*W
+[7]+2.0*t240*Y[7]+t47*W[1]+2.0*t251*Y[1];
+      R[1][8] = t614;
+      R[1][9] = t636;
+      R[1][10] = 4.0*t106*Z[1]+2.0*t303*X[1]+2.0*t116*Z[4]+2.0*t310*X[4]+2.0*
+t126*Z[7]+2.0*t317*X[7]+2.0*t137*Z[1]+t326*X[1];
+      R[1][11] = t671;
+      R[1][12] = 4.0*t144*W[1]+2.0*t382*X[1]+2.0*t154*W[4]+2.0*t390*X[4]+2.0*
+t164*W[7]+2.0*t398*X[7]+2.0*t175*W[1]+t408*X[1];
+      R[1][13] = 4.0*t182*Z[1]+2.0*t303*Y[1]+2.0*t192*Z[4]+2.0*t310*Y[4]+2.0*
+t202*Z[7]+2.0*t317*Y[7]+2.0*t213*Z[1]+t326*Y[1];
+      R[1][14] = t721;
+      R[1][15] = 4.0*t220*W[1]+2.0*t382*Y[1]+2.0*t230*W[4]+2.0*t390*Y[4]+2.0*
+t240*W[7]+2.0*t398*Y[7]+2.0*t251*W[1]+t408*Y[1];
+      R[1][16] = 2.0*t303*Z[1]+2.0*t310*Z[4]+2.0*t317*Z[7]+t326*Z[1];
+      R[1][17] = 2.0*t303*W[1]+4.0*t337*Z[1]+2.0*t310*W[4]+2.0*t350*Z[4]+2.0*
+t317*W[7]+2.0*t363*Z[7]+t326*W[1]+2.0*t374*Z[1];
+      R[1][18] = 4.0*t337*W[1]+2.0*t382*Z[1]+2.0*t350*W[4]+2.0*t390*Z[4]+2.0*
+t363*W[7]+2.0*t398*Z[7]+2.0*t374*W[1]+t408*Z[1];
+      R[1][19] = 2.0*t382*W[1]+2.0*t390*W[4]+2.0*t398*W[7]+t408*W[1];
+      R[2][0] = 2.0*t4*X[2]+2.0*t9*X[5]+2.0*t14*X[8]+t22*X[2];
+      R[2][1] = 2.0*t29*Y[2]+2.0*t34*Y[5]+2.0*t39*Y[8]+t47*Y[2];
+      R[2][2] = 2.0*t4*Y[2]+4.0*t55*X[2]+2.0*t9*Y[5]+2.0*t65*X[5]+2.0*t14*Y[8]+
+2.0*t75*X[8]+t22*Y[2]+2.0*t86*X[2];
+      R[2][3] = 4.0*t55*Y[2]+2.0*t29*X[2]+2.0*t65*Y[5]+2.0*t34*X[5]+2.0*t75*Y
+[8]+2.0*t39*X[8]+2.0*t86*Y[2]+t47*X[2];
+      R[2][4] = 2.0*t4*Z[2]+4.0*t106*X[2]+2.0*t9*Z[5]+2.0*t116*X[5]+2.0*t14*Z
+[8]+2.0*t126*X[8]+t22*Z[2]+2.0*t137*X[2];
+      R[2][5] = 2.0*t4*W[2]+4.0*t144*X[2]+2.0*t9*W[5]+2.0*t154*X[5]+2.0*t14*W
+[8]+2.0*t164*X[8]+t22*W[2]+2.0*t175*X[2];
+      R[2][6] = 2.0*t29*Z[2]+4.0*t182*Y[2]+2.0*t34*Z[5]+2.0*t192*Y[5]+2.0*t39*Z
+[8]+2.0*t202*Y[8]+t47*Z[2]+2.0*t213*Y[2];
+      R[2][7] = 2.0*t29*W[2]+4.0*t220*Y[2]+2.0*t34*W[5]+2.0*t230*Y[5]+2.0*t39*W
+[8]+2.0*t240*Y[8]+t47*W[2]+2.0*t251*Y[2];
+      R[2][8] = t890;
+      R[2][9] = t912;
+      R[2][10] = 4.0*t106*Z[2]+2.0*t303*X[2]+2.0*t116*Z[5]+2.0*t310*X[5]+2.0*
+t126*Z[8]+2.0*t317*X[8]+2.0*t137*Z[2]+t326*X[2];
+      R[2][11] = t947;
+      R[2][12] = 4.0*t144*W[2]+2.0*t382*X[2]+2.0*t154*W[5]+2.0*t390*X[5]+2.0*
+t164*W[8]+2.0*t398*X[8]+2.0*t175*W[2]+t408*X[2];
+      R[2][13] = 4.0*t182*Z[2]+2.0*t303*Y[2]+2.0*t192*Z[5]+2.0*t310*Y[5]+2.0*
+t202*Z[8]+2.0*t317*Y[8]+2.0*t213*Z[2]+t326*Y[2];
+      R[2][14] = t997;
+      R[2][15] = 4.0*t220*W[2]+2.0*t382*Y[2]+2.0*t230*W[5]+2.0*t390*Y[5]+2.0*
+t240*W[8]+2.0*t398*Y[8]+2.0*t251*W[2]+t408*Y[2];
+      R[2][16] = 2.0*t303*Z[2]+2.0*t310*Z[5]+2.0*t317*Z[8]+t326*Z[2];
+      R[2][17] = 2.0*t303*W[2]+4.0*t337*Z[2]+2.0*t310*W[5]+2.0*t350*Z[5]+2.0*
+t317*W[8]+2.0*t363*Z[8]+t326*W[2]+2.0*t374*Z[2];
+      R[2][18] = 4.0*t337*W[2]+2.0*t382*Z[2]+2.0*t350*W[5]+2.0*t390*Z[5]+2.0*
+t363*W[8]+2.0*t398*Z[8]+2.0*t374*W[2]+t408*Z[2];
+      R[2][19] = 2.0*t382*W[2]+2.0*t390*W[5]+2.0*t398*W[8]+t408*W[2];
+      R[3][0] = 2.0*t9*X[0]+2.0*t1056*X[3]+2.0*t1061*X[6]+t22*X[3];
+      R[3][1] = 2.0*t34*Y[0]+2.0*t1067*Y[3]+2.0*t1072*Y[6]+t47*Y[3];
+      R[3][2] = 2.0*t9*Y[0]+2.0*t65*X[0]+2.0*t1056*Y[3]+4.0*t1081*X[3]+2.0*
+t1061*Y[6]+2.0*t1091*X[6]+t22*Y[3]+2.0*t86*X[3];
+      R[3][3] = 2.0*t65*Y[0]+2.0*t34*X[0]+4.0*t1081*Y[3]+2.0*t1067*X[3]+2.0*
+t1091*Y[6]+2.0*t1072*X[6]+2.0*t86*Y[3]+t47*X[3];
+      R[3][4] = 2.0*t9*Z[0]+2.0*t116*X[0]+2.0*t1056*Z[3]+4.0*t1115*X[3]+2.0*
+t1061*Z[6]+2.0*t1125*X[6]+t22*Z[3]+2.0*t137*X[3];
+      R[3][5] = 2.0*t9*W[0]+2.0*t154*X[0]+2.0*t1056*W[3]+4.0*t1136*X[3]+2.0*
+t1061*W[6]+2.0*t1146*X[6]+t22*W[3]+2.0*t175*X[3];
+      R[3][6] = 2.0*t34*Z[0]+2.0*t192*Y[0]+2.0*t1067*Z[3]+4.0*t1157*Y[3]+2.0*
+t1072*Z[6]+2.0*t1167*Y[6]+t47*Z[3]+2.0*t213*Y[3];
+      R[3][7] = 2.0*t34*W[0]+2.0*t230*Y[0]+2.0*t1067*W[3]+4.0*t1178*Y[3]+2.0*
+t1072*W[6]+2.0*t1188*Y[6]+t47*W[3]+2.0*t251*Y[3];
+      R[3][8] = t1216;
+      R[3][9] = t1238;
+      R[3][10] = 2.0*t116*Z[0]+2.0*t310*X[0]+4.0*t1115*Z[3]+2.0*t1244*X[3]+2.0*
+t1125*Z[6]+2.0*t1251*X[6]+2.0*t137*Z[3]+t326*X[3];
+      R[3][11] = t1286;
+      R[3][12] = 2.0*t154*W[0]+2.0*t390*X[0]+4.0*t1136*W[3]+2.0*t1293*X[3]+2.0*
+t1146*W[6]+2.0*t1301*X[6]+2.0*t175*W[3]+t408*X[3];
+      R[3][13] = 2.0*t192*Z[0]+2.0*t310*Y[0]+4.0*t1157*Z[3]+2.0*t1244*Y[3]+2.0*
+t1167*Z[6]+2.0*t1251*Y[6]+2.0*t213*Z[3]+t326*Y[3];
+      R[3][14] = t1341;
+      R[3][15] = 2.0*t230*W[0]+2.0*t390*Y[0]+4.0*t1178*W[3]+2.0*t1293*Y[3]+2.0*
+t1188*W[6]+2.0*t1301*Y[6]+2.0*t251*W[3]+t408*Y[3];
+      R[3][16] = 2.0*t310*Z[0]+2.0*t1244*Z[3]+2.0*t1251*Z[6]+t326*Z[3];
+      R[3][17] = 2.0*t310*W[0]+2.0*t350*Z[0]+2.0*t1244*W[3]+4.0*t1267*Z[3]+2.0*
+t1251*W[6]+2.0*t1280*Z[6]+t326*W[3]+2.0*t374*Z[3];
+      R[3][18] = 2.0*t350*W[0]+2.0*t390*Z[0]+4.0*t1267*W[3]+2.0*t1293*Z[3]+2.0*
+t1280*W[6]+2.0*t1301*Z[6]+2.0*t374*W[3]+t408*Z[3];
+      R[3][19] = 2.0*t390*W[0]+2.0*t1293*W[3]+2.0*t1301*W[6]+t408*W[3];
+      R[4][0] = 2.0*t9*X[1]+2.0*t1056*X[4]+2.0*t1061*X[7]+t22*X[4];
+      R[4][1] = 2.0*t34*Y[1]+2.0*t1067*Y[4]+2.0*t1072*Y[7]+t47*Y[4];
+      R[4][2] = 2.0*t9*Y[1]+2.0*t65*X[1]+2.0*t1056*Y[4]+4.0*t1081*X[4]+2.0*
+t1061*Y[7]+2.0*t1091*X[7]+t22*Y[4]+2.0*t86*X[4];
+      R[4][3] = 2.0*t65*Y[1]+2.0*t34*X[1]+4.0*t1081*Y[4]+2.0*t1067*X[4]+2.0*
+t1091*Y[7]+2.0*t1072*X[7]+2.0*t86*Y[4]+t47*X[4];
+      R[4][4] = 2.0*t9*Z[1]+2.0*t116*X[1]+2.0*t1056*Z[4]+4.0*t1115*X[4]+2.0*
+t1061*Z[7]+2.0*t1125*X[7]+t22*Z[4]+2.0*t137*X[4];
+      R[4][5] = 2.0*t9*W[1]+2.0*t154*X[1]+2.0*t1056*W[4]+4.0*t1136*X[4]+2.0*
+t1061*W[7]+2.0*t1146*X[7]+t22*W[4]+2.0*t175*X[4];
+      R[4][6] = 2.0*t34*Z[1]+2.0*t192*Y[1]+2.0*t1067*Z[4]+4.0*t1157*Y[4]+2.0*
+t1072*Z[7]+2.0*t1167*Y[7]+t47*Z[4]+2.0*t213*Y[4];
+      R[4][7] = 2.0*t34*W[1]+2.0*t230*Y[1]+2.0*t1067*W[4]+4.0*t1178*Y[4]+2.0*
+t1072*W[7]+2.0*t1188*Y[7]+t47*W[4]+2.0*t251*Y[4];
+      R[4][8] = t1510;
+      R[4][9] = t1532;
+      R[4][10] = 2.0*t116*Z[1]+2.0*t310*X[1]+4.0*t1115*Z[4]+2.0*t1244*X[4]+2.0*
+t1125*Z[7]+2.0*t1251*X[7]+2.0*t137*Z[4]+t326*X[4];
+      R[4][11] = t1567;
+      R[4][12] = 2.0*t154*W[1]+2.0*t390*X[1]+4.0*t1136*W[4]+2.0*t1293*X[4]+2.0*
+t1146*W[7]+2.0*t1301*X[7]+2.0*t175*W[4]+t408*X[4];
+      R[4][13] = 2.0*t192*Z[1]+2.0*t310*Y[1]+4.0*t1157*Z[4]+2.0*t1244*Y[4]+2.0*
+t1167*Z[7]+2.0*t1251*Y[7]+2.0*t213*Z[4]+t326*Y[4];
+      R[4][14] = t1617;
+      R[4][15] = 2.0*t230*W[1]+2.0*t390*Y[1]+4.0*t1178*W[4]+2.0*t1293*Y[4]+2.0*
+t1188*W[7]+2.0*t1301*Y[7]+2.0*t251*W[4]+t408*Y[4];
+      R[4][16] = 2.0*t310*Z[1]+2.0*t1244*Z[4]+2.0*t1251*Z[7]+t326*Z[4];
+      R[4][17] = 2.0*t310*W[1]+2.0*t350*Z[1]+2.0*t1244*W[4]+4.0*t1267*Z[4]+2.0*
+t1251*W[7]+2.0*t1280*Z[7]+t326*W[4]+2.0*t374*Z[4];
+      R[4][18] = 2.0*t350*W[1]+2.0*t390*Z[1]+4.0*t1267*W[4]+2.0*t1293*Z[4]+2.0*
+t1280*W[7]+2.0*t1301*Z[7]+2.0*t374*W[4]+t408*Z[4];
+      R[4][19] = 2.0*t390*W[1]+2.0*t1293*W[4]+2.0*t1301*W[7]+t408*W[4];
+      R[5][0] = 2.0*t9*X[2]+2.0*t1056*X[5]+2.0*t1061*X[8]+t22*X[5];
+      R[5][1] = 2.0*t34*Y[2]+2.0*t1067*Y[5]+2.0*t1072*Y[8]+t47*Y[5];
+      R[5][2] = 2.0*t9*Y[2]+2.0*t65*X[2]+2.0*t1056*Y[5]+4.0*t1081*X[5]+2.0*
+t1061*Y[8]+2.0*t1091*X[8]+t22*Y[5]+2.0*t86*X[5];
+      R[5][3] = 2.0*t65*Y[2]+2.0*t34*X[2]+4.0*t1081*Y[5]+2.0*t1067*X[5]+2.0*
+t1091*Y[8]+2.0*t1072*X[8]+2.0*t86*Y[5]+t47*X[5];
+      R[5][4] = 2.0*t9*Z[2]+2.0*t116*X[2]+2.0*t1056*Z[5]+4.0*t1115*X[5]+2.0*
+t1061*Z[8]+2.0*t1125*X[8]+t22*Z[5]+2.0*t137*X[5];
+      R[5][5] = 2.0*t9*W[2]+2.0*t154*X[2]+2.0*t1056*W[5]+4.0*t1136*X[5]+2.0*
+t1061*W[8]+2.0*t1146*X[8]+t22*W[5]+2.0*t175*X[5];
+      R[5][6] = 2.0*t34*Z[2]+2.0*t192*Y[2]+2.0*t1067*Z[5]+4.0*t1157*Y[5]+2.0*
+t1072*Z[8]+2.0*t1167*Y[8]+t47*Z[5]+2.0*t213*Y[5];
+      R[5][7] = 2.0*t34*W[2]+2.0*t230*Y[2]+2.0*t1067*W[5]+4.0*t1178*Y[5]+2.0*
+t1072*W[8]+2.0*t1188*Y[8]+t47*W[5]+2.0*t251*Y[5];
+      R[5][8] = t1786;
+      R[5][9] = t1808;
+      R[5][10] = 2.0*t116*Z[2]+2.0*t310*X[2]+4.0*t1115*Z[5]+2.0*t1244*X[5]+2.0*
+t1125*Z[8]+2.0*t1251*X[8]+2.0*t137*Z[5]+t326*X[5];
+      R[5][11] = t1843;
+      R[5][12] = 2.0*t154*W[2]+2.0*t390*X[2]+4.0*t1136*W[5]+2.0*t1293*X[5]+2.0*
+t1146*W[8]+2.0*t1301*X[8]+2.0*t175*W[5]+t408*X[5];
+      R[5][13] = 2.0*t192*Z[2]+2.0*t310*Y[2]+4.0*t1157*Z[5]+2.0*t1244*Y[5]+2.0*
+t1167*Z[8]+2.0*t1251*Y[8]+2.0*t213*Z[5]+t326*Y[5];
+      R[5][14] = t1893;
+      R[5][15] = 2.0*t230*W[2]+2.0*t390*Y[2]+4.0*t1178*W[5]+2.0*t1293*Y[5]+2.0*
+t1188*W[8]+2.0*t1301*Y[8]+2.0*t251*W[5]+t408*Y[5];
+      R[5][16] = 2.0*t310*Z[2]+2.0*t1244*Z[5]+2.0*t1251*Z[8]+t326*Z[5];
+      R[5][17] = 2.0*t310*W[2]+2.0*t350*Z[2]+2.0*t1244*W[5]+4.0*t1267*Z[5]+2.0*
+t1251*W[8]+2.0*t1280*Z[8]+t326*W[5]+2.0*t374*Z[5];
+      R[5][18] = 2.0*t350*W[2]+2.0*t390*Z[2]+4.0*t1267*W[5]+2.0*t1293*Z[5]+2.0*
+t1280*W[8]+2.0*t1301*Z[8]+2.0*t374*W[5]+t408*Z[5];
+      R[5][19] = 2.0*t390*W[2]+2.0*t1293*W[5]+2.0*t1301*W[8]+t408*W[5];
+      R[6][0] = 2.0*t14*X[0]+2.0*t1061*X[3]+2.0*t1953*X[6]+t22*X[6];
+      R[6][1] = 2.0*t39*Y[0]+2.0*t1072*Y[3]+2.0*t1960*Y[6]+t47*Y[6];
+      R[6][2] = 2.0*t14*Y[0]+2.0*t75*X[0]+2.0*t1061*Y[3]+2.0*t1091*X[3]+2.0*
+t1953*Y[6]+4.0*t1972*X[6]+t22*Y[6]+2.0*t86*X[6];
+      R[6][3] = 2.0*t75*Y[0]+2.0*t39*X[0]+2.0*t1091*Y[3]+2.0*t1072*X[3]+4.0*
+t1972*Y[6]+2.0*t1960*X[6]+2.0*t86*Y[6]+t47*X[6];
+      R[6][4] = 2.0*t14*Z[0]+2.0*t126*X[0]+2.0*t1061*Z[3]+2.0*t1125*X[3]+2.0*
+t1953*Z[6]+4.0*t1999*X[6]+t22*Z[6]+2.0*t137*X[6];
+      R[6][5] = 2.0*t14*W[0]+2.0*t164*X[0]+2.0*t1061*W[3]+2.0*t1146*X[3]+2.0*
+t1953*W[6]+4.0*t2013*X[6]+t22*W[6]+2.0*t175*X[6];
+      R[6][6] = 2.0*t39*Z[0]+2.0*t202*Y[0]+2.0*t1072*Z[3]+2.0*t1167*Y[3]+2.0*
+t1960*Z[6]+4.0*t2027*Y[6]+t47*Z[6]+2.0*t213*Y[6];
+      R[6][7] = 2.0*t39*W[0]+2.0*t240*Y[0]+2.0*t1072*W[3]+2.0*t1188*Y[3]+2.0*
+t1960*W[6]+4.0*t2041*Y[6]+t47*W[6]+2.0*t251*Y[6];
+      R[6][8] = t2069;
+      R[6][9] = t2091;
+      R[6][10] = 2.0*t126*Z[0]+2.0*t317*X[0]+2.0*t1125*Z[3]+2.0*t1251*X[3]+4.0*
+t1999*Z[6]+2.0*t2100*X[6]+2.0*t137*Z[6]+t326*X[6];
+      R[6][11] = t2128;
+      R[6][12] = 2.0*t164*W[0]+2.0*t398*X[0]+2.0*t1146*W[3]+2.0*t1301*X[3]+4.0*
+t2013*W[6]+2.0*t2139*X[6]+2.0*t175*W[6]+t408*X[6];
+      R[6][13] = 2.0*t202*Z[0]+2.0*t317*Y[0]+2.0*t1167*Z[3]+2.0*t1251*Y[3]+4.0*
+t2027*Z[6]+2.0*t2100*Y[6]+2.0*t213*Z[6]+t326*Y[6];
+      R[6][14] = t2179;
+      R[6][15] = 2.0*t240*W[0]+2.0*t398*Y[0]+2.0*t1188*W[3]+2.0*t1301*Y[3]+4.0*
+t2041*W[6]+2.0*t2139*Y[6]+2.0*t251*W[6]+t408*Y[6];
+      R[6][16] = 2.0*t317*Z[0]+2.0*t1251*Z[3]+2.0*t2100*Z[6]+t326*Z[6];
+      R[6][17] = 2.0*t317*W[0]+2.0*t363*Z[0]+2.0*t1251*W[3]+2.0*t1280*Z[3]+2.0*
+t2100*W[6]+4.0*t2122*Z[6]+t326*W[6]+2.0*t374*Z[6];
+      R[6][18] = 2.0*t363*W[0]+2.0*t398*Z[0]+2.0*t1280*W[3]+2.0*t1301*Z[3]+4.0*
+t2122*W[6]+2.0*t2139*Z[6]+2.0*t374*W[6]+t408*Z[6];
+      R[6][19] = 2.0*t398*W[0]+2.0*t1301*W[3]+2.0*t2139*W[6]+t408*W[6];
+      R[7][0] = 2.0*t14*X[1]+2.0*t1061*X[4]+2.0*t1953*X[7]+t22*X[7];
+      R[7][1] = 2.0*t39*Y[1]+2.0*t1072*Y[4]+2.0*t1960*Y[7]+t47*Y[7];
+      R[7][2] = 2.0*t14*Y[1]+2.0*t75*X[1]+2.0*t1061*Y[4]+2.0*t1091*X[4]+2.0*
+t1953*Y[7]+4.0*t1972*X[7]+t22*Y[7]+2.0*t86*X[7];
+      R[7][3] = 2.0*t75*Y[1]+2.0*t39*X[1]+2.0*t1091*Y[4]+2.0*t1072*X[4]+4.0*
+t1972*Y[7]+2.0*t1960*X[7]+2.0*t86*Y[7]+t47*X[7];
+      R[7][4] = 2.0*t14*Z[1]+2.0*t126*X[1]+2.0*t1061*Z[4]+2.0*t1125*X[4]+2.0*
+t1953*Z[7]+4.0*t1999*X[7]+t22*Z[7]+2.0*t137*X[7];
+      R[7][5] = 2.0*t14*W[1]+2.0*t164*X[1]+2.0*t1061*W[4]+2.0*t1146*X[4]+2.0*
+t1953*W[7]+4.0*t2013*X[7]+t22*W[7]+2.0*t175*X[7];
+      R[7][6] = 2.0*t39*Z[1]+2.0*t202*Y[1]+2.0*t1072*Z[4]+2.0*t1167*Y[4]+2.0*
+t1960*Z[7]+4.0*t2027*Y[7]+t47*Z[7]+2.0*t213*Y[7];
+      R[7][7] = 2.0*t39*W[1]+2.0*t240*Y[1]+2.0*t1072*W[4]+2.0*t1188*Y[4]+2.0*
+t1960*W[7]+4.0*t2041*Y[7]+t47*W[7]+2.0*t251*Y[7];
+      R[7][8] = t2348;
+      R[7][9] = t2370;
+      R[7][10] = 2.0*t126*Z[1]+2.0*t317*X[1]+2.0*t1125*Z[4]+2.0*t1251*X[4]+4.0*
+t1999*Z[7]+2.0*t2100*X[7]+2.0*t137*Z[7]+t326*X[7];
+      R[7][11] = t2405;
+      R[7][12] = 2.0*t164*W[1]+2.0*t398*X[1]+2.0*t1146*W[4]+2.0*t1301*X[4]+4.0*
+t2013*W[7]+2.0*t2139*X[7]+2.0*t175*W[7]+t408*X[7];
+      R[7][13] = 2.0*t202*Z[1]+2.0*t317*Y[1]+2.0*t1167*Z[4]+2.0*t1251*Y[4]+4.0*
+t2027*Z[7]+2.0*t2100*Y[7]+2.0*t213*Z[7]+t326*Y[7];
+      R[7][14] = t2455;
+      R[7][15] = 2.0*t240*W[1]+2.0*t398*Y[1]+2.0*t1188*W[4]+2.0*t1301*Y[4]+4.0*
+t2041*W[7]+2.0*t2139*Y[7]+2.0*t251*W[7]+t408*Y[7];
+      R[7][16] = 2.0*t317*Z[1]+2.0*t1251*Z[4]+2.0*t2100*Z[7]+t326*Z[7];
+      R[7][17] = 2.0*t317*W[1]+2.0*t363*Z[1]+2.0*t1251*W[4]+2.0*t1280*Z[4]+2.0*
+t2100*W[7]+4.0*t2122*Z[7]+t326*W[7]+2.0*t374*Z[7];
+      R[7][18] = 2.0*t363*W[1]+2.0*t398*Z[1]+2.0*t1280*W[4]+2.0*t1301*Z[4]+4.0*
+t2122*W[7]+2.0*t2139*Z[7]+2.0*t374*W[7]+t408*Z[7];
+      R[7][19] = 2.0*t398*W[1]+2.0*t1301*W[4]+2.0*t2139*W[7]+t408*W[7];
+      R[8][0] = 2.0*t14*X[2]+2.0*t1061*X[5]+2.0*t1953*X[8]+t22*X[8];
+      R[8][1] = 2.0*t39*Y[2]+2.0*t1072*Y[5]+2.0*t1960*Y[8]+t47*Y[8];
+      R[8][2] = 2.0*t14*Y[2]+2.0*t75*X[2]+2.0*t1061*Y[5]+2.0*t1091*X[5]+2.0*
+t1953*Y[8]+4.0*t1972*X[8]+t22*Y[8]+2.0*t86*X[8];
+      R[8][3] = 2.0*t75*Y[2]+2.0*t39*X[2]+2.0*t1091*Y[5]+2.0*t1072*X[5]+4.0*
+t1972*Y[8]+2.0*t1960*X[8]+2.0*t86*Y[8]+t47*X[8];
+      R[8][4] = 2.0*t14*Z[2]+2.0*t126*X[2]+2.0*t1061*Z[5]+2.0*t1125*X[5]+2.0*
+t1953*Z[8]+4.0*t1999*X[8]+t22*Z[8]+2.0*t137*X[8];
+      R[8][5] = 2.0*t14*W[2]+2.0*t164*X[2]+2.0*t1061*W[5]+2.0*t1146*X[5]+2.0*
+t1953*W[8]+4.0*t2013*X[8]+t22*W[8]+2.0*t175*X[8];
+      R[8][6] = 2.0*t39*Z[2]+2.0*t202*Y[2]+2.0*t1072*Z[5]+2.0*t1167*Y[5]+2.0*
+t1960*Z[8]+4.0*t2027*Y[8]+t47*Z[8]+2.0*t213*Y[8];
+      R[8][7] = 2.0*t39*W[2]+2.0*t240*Y[2]+2.0*t1072*W[5]+2.0*t1188*Y[5]+2.0*
+t1960*W[8]+4.0*t2041*Y[8]+t47*W[8]+2.0*t251*Y[8];
+      R[8][8] = t2624;
+      R[8][9] = t2646;
+      R[8][10] = 2.0*t126*Z[2]+2.0*t317*X[2]+2.0*t1125*Z[5]+2.0*t1251*X[5]+4.0*
+t1999*Z[8]+2.0*t2100*X[8]+2.0*t137*Z[8]+t326*X[8];
+      R[8][11] = t2681;
+      R[8][12] = 2.0*t164*W[2]+2.0*t398*X[2]+2.0*t1146*W[5]+2.0*t1301*X[5]+4.0*
+t2013*W[8]+2.0*t2139*X[8]+2.0*t175*W[8]+t408*X[8];
+      R[8][13] = 2.0*t202*Z[2]+2.0*t317*Y[2]+2.0*t1167*Z[5]+2.0*t1251*Y[5]+4.0*
+t2027*Z[8]+2.0*t2100*Y[8]+2.0*t213*Z[8]+t326*Y[8];
+      R[8][14] = t2731;
+      R[8][15] = 2.0*t240*W[2]+2.0*t398*Y[2]+2.0*t1188*W[5]+2.0*t1301*Y[5]+4.0*
+t2041*W[8]+2.0*t2139*Y[8]+2.0*t251*W[8]+t408*Y[8];
+      R[8][16] = 2.0*t317*Z[2]+2.0*t1251*Z[5]+2.0*t2100*Z[8]+t326*Z[8];
+      R[8][17] = 2.0*t317*W[2]+2.0*t363*Z[2]+2.0*t1251*W[5]+2.0*t1280*Z[5]+2.0*
+t2100*W[8]+4.0*t2122*Z[8]+t326*W[8]+2.0*t374*Z[8];
+      R[8][18] = 2.0*t363*W[2]+2.0*t398*Z[2]+2.0*t1280*W[5]+2.0*t1301*Z[5]+4.0*
+t2122*W[8]+2.0*t2139*Z[8]+2.0*t374*W[8]+t408*Z[8];
+      R[8][19] = 2.0*t398*W[2]+2.0*t1301*W[5]+2.0*t2139*W[8]+t408*W[8];
+      R[9][0] = -t2789*X[4]+t2791*X[5]+t2793*X[7]-t2795*X[8]-t2797*X[7]+t2799*X
+[8];
+      R[9][1] = -t2802*Y[7]+t2804*Y[8]+t2806*Y[7]+t2808*Y[5]-t2810*Y[4]-t2812*Y
+[8];
+      R[9][2] = t2845;
+      R[9][3] = t2864;
+      R[9][4] = t2895;
+      R[9][5] = t2926;
+      R[9][6] = t2957;
+      R[9][7] = t2988;
+      R[9][8] = t3007+t3026;
+      R[9][9] = t3046+t3065;
+      R[9][10] = t3091;
+      R[9][11] = t3118+t3141;
+      R[9][12] = t3167;
+      R[9][13] = t3186;
+      R[9][14] = t3205+t3224;
+      R[9][15] = t3244;
+      R[9][16] = -t3072*Z[7]+t3069*Z[8]+t3076*Z[7]-t3081*Z[8]+t3087*Z[5]-t3089*
+Z[4];
+      R[9][17] = t3270;
+      R[9][18] = t3289;
+      R[9][19] = -t3154*W[4]+t3152*W[5]-t3164*W[7]+t3162*W[8]-t3146*W[8]+t3144*
+W[7];
+}

Index: src/plrt.c
===================================================================
RCS file: src/plrt.c
diff -N src/plrt.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/plrt.c  22 Apr 2009 17:05:25 -0000      1.1
@@ -0,0 +1,47 @@
+/*  plrt.c    CCMATH mathematics library source code.
+ *
+ *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
+ *  This code may be redistributed under the terms of the GNU library
+ *  public license (LGPL). ( See the lgpl.license file for details.)
+ * ------------------------------------------------------------------------
+ */
+#include <stdlib.h>
+#include <math.h>
+#include "ccmcomplex.h"
+int plrt(double *cof,int n,Cpx *root,double ra,double rb)
+{ double a,b,s,t,w; int itr,pat; struct complex *pr;
+  double *cs,*cf,*hf,*p,*q,*ul,test=1.e-28;
+  cs=cf=(double *)calloc(2*n,sizeof(double)); hf=cf+n;
+  pr=root+n-1; ul=hf+n-1;
+  if(rb<0.) rb=ra*ra-rb*rb; else rb=ra*ra+rb*rb; ra*= -2.;
+  q=cof+n; s= *q--;
+  for(p=cf; p<hf ;) *p++ = *q-- /s;
+  for(itr=pat=0;;){
+    if(itr==0){
+      if(n>2){ a=ra; b=rb;}
+      else if(n==2){ a= *cf++; b= *cf;}
+      else if(n==1){ pr->re= -(*cf); pr->im=0.; free(cs); return 0;}
+     }
+    s= -a/2.; t=s*s-b;
+    if(t>=0.){ t=sqrt(t); pr->re=s+t; (pr--)->im=0.;
+               pr->re=s-t; (pr++)->im=0.; }
+    else{ t=sqrt(-t); pr->re=s; (pr--)->im=t;
+          pr->re=s; (pr++)->im= -t; }
+    if(n==2){ free(cs); return 0;}
+    for(p=hf,q=cf; q<hf ;) *p++ = *q++;
+    for(p=hf,w=1.; p<ul ;){
+      *p++ -=a*w; *p-=b*w; w=*(p-1); }
+    t= -(*p--); t+=pr->re* *p; s=pr->im* *p;
+    if(t*t+s*s<test){ pr-=2; ul-=2; n-=2; itr=pat=0;
+      for(p=cf,q=hf; p<ul ;) *p++ = *q++;
+     }
+    else if(++itr<30){
+           for(p=hf,w=1.; p<ul-2 ;){
+             *p++ -=w*a; *p-=w*b; w= *(p-1); }
+      t= *p++; q=p+1; s=t*t+w*(b*w-a*t);
+      b+=(w*(*p*b- *q*a)+ *q*t)/s; a+=(*p*t- *q*w)/s;
+     }
+    else{ if(pat==3){ free(cs); return n;}
+          itr=0; if(pat++ %2) ra= -ra; else rb= -rb;}
+   }
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]