Merged changes in the trunk up to revision 55546.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sun, 24 Mar 2013 12:13:13 +0000 (12:13 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sun, 24 Mar 2013 12:13:13 +0000 (12:13 +0000)
Conflicts resolved:
source/blenderplayer/bad_level_call_stubs/SConscript

Partly reverted changes to intern/cycles/blender/addon/ui.py in revision 52899
to make it easier to merge trunk changes.

379 files changed:
1  2 
CMakeLists.txt
SConstruct
build_files/build_environment/install_deps.sh
doc/python_api/rst/bge.logic.rst
extern/carve/lib/intersect_face_division.cpp
extern/libmv/third_party/ceres/ChangeLog
extern/libmv/third_party/ceres/include/ceres/cost_function_to_functor.h
extern/libmv/third_party/ceres/include/ceres/internal/autodiff.h
extern/libmv/third_party/ceres/include/ceres/numeric_diff_functor.h
extern/libmv/third_party/ceres/include/ceres/problem.h
extern/libmv/third_party/ceres/include/ceres/rotation.h
extern/libmv/third_party/ceres/internal/ceres/canonical_views_clustering.cc
extern/libmv/third_party/ceres/internal/ceres/canonical_views_clustering.h
extern/libmv/third_party/ceres/internal/ceres/generate_eliminator_specialization.py
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_2.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_3.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_4.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_2_d.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_3.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_4.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_9.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_3_d.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_3.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_4.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_2_4_d.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_2.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_3.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_4.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_4_4_d.cc
extern/libmv/third_party/ceres/internal/ceres/generated/schur_eliminator_d_d_d.cc
extern/libmv/third_party/ceres/internal/ceres/line_search.cc
extern/libmv/third_party/ceres/internal/ceres/line_search.h
extern/libmv/third_party/ceres/internal/ceres/line_search_direction.cc
extern/libmv/third_party/ceres/internal/ceres/line_search_direction.h
extern/libmv/third_party/ceres/internal/ceres/line_search_minimizer.cc
extern/libmv/third_party/ceres/internal/ceres/line_search_minimizer.h
extern/libmv/third_party/ceres/internal/ceres/problem_impl.cc
extern/libmv/third_party/ceres/internal/ceres/schur_complement_solver.cc
extern/libmv/third_party/ceres/internal/ceres/schur_complement_solver.h
extern/libmv/third_party/ceres/internal/ceres/schur_eliminator.cc
extern/libmv/third_party/ceres/internal/ceres/solver_impl.cc
extern/libmv/third_party/ceres/internal/ceres/solver_impl.h
extern/libmv/third_party/ceres/internal/ceres/sparse_normal_cholesky_solver.cc
extern/libmv/third_party/ceres/internal/ceres/sparse_normal_cholesky_solver.h
extern/libmv/third_party/ceres/internal/ceres/visibility.cc
extern/libmv/third_party/ceres/internal/ceres/visibility.h
extern/libmv/third_party/ceres/internal/ceres/visibility_based_preconditioner.cc
extern/wcwidth/CMakeLists.txt
intern/audaspace/intern/AUD_C-API.cpp
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_camera.cpp
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_shader.cpp
intern/cycles/kernel/kernel_camera.h
intern/cycles/render/light.cpp
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/ghost/intern/GHOST_WindowX11.cpp
intern/memutil/MEM_CacheLimiter.h
intern/memutil/MEM_CacheLimiterC-Api.h
intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
intern/raskter/raskter.c
intern/rigidbody/CMakeLists.txt
intern/string/STR_String.h
release/datafiles/LICENSE-bmonofont-i18n.ttf.txt
release/datafiles/LICENSE-droidsans.ttf.txt
release/datafiles/blender_icons.svg
release/datafiles/blender_icons16.png
release/datafiles/blender_icons32.png
release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
release/scripts/modules/bl_i18n_utils/check_po.py
release/scripts/modules/bl_i18n_utils/clean_po.py
release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
release/scripts/modules/bl_i18n_utils/settings.py
release/scripts/modules/bl_i18n_utils/settings_user.py
release/scripts/modules/bl_i18n_utils/update_branches.py
release/scripts/modules/bl_i18n_utils/update_mo.py
release/scripts/modules/bl_i18n_utils/update_msg.py
release/scripts/modules/bl_i18n_utils/update_po.py
release/scripts/modules/bl_i18n_utils/update_pot.py
release/scripts/modules/bl_i18n_utils/update_trunk.py
release/scripts/modules/bl_i18n_utils/utils.py
release/scripts/modules/bl_i18n_utils/utils_languages_menu.py
release/scripts/modules/bl_i18n_utils/utils_rtl.py
release/scripts/modules/bl_i18n_utils/utils_spell_check.py
release/scripts/startup/bl_operators/node.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_fluid.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/templates_py/custom_nodes.py
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_lang.c
source/blender/blenfont/intern/blf_translation.c
source/blender/blenkernel/BKE_anim.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/BKE_camera.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_customdata.h
source/blender/blenkernel/BKE_deform.h
source/blender/blenkernel/BKE_displist.h
source/blender/blenkernel/BKE_idcode.h
source/blender/blenkernel/BKE_idprop.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_movieclip.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_nla.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/bpath.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenkernel/nla_private.h
source/blender/blenlib/BLI_callbacks.h
source/blender/blenlib/BLI_gsqueue.h
source/blender/blenlib/BLI_math_geom.h
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/BLI_rect.h
source/blender/blenlib/BLI_vfontdata.h
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/gsqueue.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/rct.c
source/blender/blenlib/intern/voronoi.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/collada_internal.cpp
source/blender/compositor/CMakeLists.txt
source/blender/compositor/intern/COM_Converter.cpp
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/intern/COM_ExecutionGroup.h
source/blender/compositor/intern/COM_ExecutionSystem.cpp
source/blender/compositor/intern/COM_NodeOperation.h
source/blender/compositor/intern/COM_compositor.cpp
source/blender/compositor/nodes/COM_CompositorNode.cpp
source/blender/compositor/nodes/COM_MovieClipNode.cpp
source/blender/compositor/nodes/COM_RenderLayersNode.cpp
source/blender/compositor/nodes/COM_SocketProxyNode.h
source/blender/compositor/nodes/COM_SplitViewerNode.cpp
source/blender/compositor/nodes/COM_ViewerNode.cpp
source/blender/compositor/operations/COM_CompositorOperation.cpp
source/blender/compositor/operations/COM_CompositorOperation.h
source/blender/compositor/operations/COM_CropOperation.cpp
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_MovieClipOperation.cpp
source/blender/compositor/operations/COM_MovieClipOperation.h
source/blender/compositor/operations/COM_OpenCLKernels.cl
source/blender/compositor/operations/COM_OutputFileOperation.cpp
source/blender/compositor/operations/COM_RenderLayersBaseProg.cpp
source/blender/compositor/operations/COM_RenderLayersBaseProg.h
source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
source/blender/editors/animation/anim_markers.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/pose_select.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_armature.h
source/blender/editors/include/ED_curve.h
source/blender/editors/include/ED_gpencil.h
source/blender/editors/include/ED_mball.h
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_particle.h
source/blender/editors/include/ED_transform.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_icons.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_resources.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/view2d.c
source/blender/editors/io/io_collada.c
source/blender/editors/io/io_ops.c
source/blender/editors/mask/mask_select.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_knife_project.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_rip.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_ops.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_action/action_intern.h
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_intern.h
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_console/console_intern.h
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_intern.h
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_nla/nla_intern.h
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_group.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_format_lua.c
source/blender/editors/space_text/text_format_osl.c
source/blender/editors/space_text/text_format_py.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_project.c
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/gpu/GPU_draw.h
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_simple_shader.c
source/blender/imbuf/IMB_moviecache.h
source/blender/imbuf/intern/cineon/cineon_dpx.c
source/blender/imbuf/intern/cineon/cineonlib.c
source/blender/imbuf/intern/cineon/dpxlib.c
source/blender/imbuf/intern/cineon/logImageCore.c
source/blender/imbuf/intern/moviecache.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/scaling.c
source/blender/makesdna/DNA_movieclip_types.h
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_mirror.c
source/blender/modifiers/intern/MOD_ocean.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_image.c
source/blender/nodes/composite/nodes/node_composite_movieclip.c
source/blender/nodes/intern/node_exec.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/shader/nodes/node_shader_mix_shader.c
source/blender/nodes/shader/nodes/node_shader_value.c
source/blender/nodes/texture/node_texture_tree.c
source/blender/python/bmesh/bmesh_py_types_meshdata.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_app_translations.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/python/intern/gpu.c
source/blender/render/CMakeLists.txt
source/blender/render/extern/include/RE_engine.h
source/blender/render/intern/source/external_engine.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_jobs.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/CMakeLists.txt
source/blenderplayer/bad_level_call_stubs/SConscript
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ModifierDeformer.cpp
source/gameengine/Expressions/Value.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_NavMeshObject.cpp
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp

diff --cc CMakeLists.txt
@@@ -124,10 -124,6 +124,10 @@@ mark_as_advanced(WITH_PYTHON_SECURITY
  
  option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
  option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
- if (APPLE)
++if(APPLE)
 +      option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
 +endif()
 +
  option(WITH_BUILDINFO     "Include extra build details (only disable for development & faster builds)" ON)
  option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
  option(WITH_IK_SOLVER     "Enable Legacy IK solver (only disable for development)" ON)
@@@ -297,9 -276,9 +297,9 @@@ if(APPLE
        endif()
        
        execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
--      if (${MAC_SYS} MATCHES 12)
++      if(${MAC_SYS} MATCHES 12)
                set(OSX_SYSTEM 10.8)
--      elseif (${MAC_SYS} MATCHES 11)
++      elseif(${MAC_SYS} MATCHES 11)
                set(OSX_SYSTEM 10.7)
        elseif(${MAC_SYS} MATCHES 10)
                set(OSX_SYSTEM 10.6)
@@@ -539,7 -498,7 +539,7 @@@ set(PLATFORM_LINKFLAGS_DEBUG ""
  
  if(UNIX AND NOT APPLE)
        macro(find_package_wrapper)
--              STRING(TOUPPER ${ARGV0} _NAME_UPPER)
++              string(TOUPPER ${ARGV0} _NAME_UPPER)
                if(${WITH_STATIC_LIBS})
                        set(_cmake_find_library_suffixes_back ${CMAKE_FIND_LIBRARY_SUFFIXES})
                        set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
                endif()
        endif()
  
--      if (WITH_INPUT_NDOF)
++      if(WITH_INPUT_NDOF)
                find_package_wrapper(Spacenav)
                if(NOT SPACENAV_FOUND)
                        set(WITH_INPUT_NDOF OFF)
                        if(${WITH_STATIC_LIBS})
                                set(Boost_USE_STATIC_LIBS ON)
                        endif()
 -                      if(NOT BOOST_ROOT)
 -                              set(Boost_USE_MULTITHREADED OFF)
 -                      else()
 -                              set(Boost_USE_MULTITHREADED ON)
 -                      endif()
 +                      set(Boost_USE_MULTITHREADED ON)
                        set(__boost_packages filesystem regex system thread date_time)
--                      if (WITH_INTERNATIONAL)
++                      if(WITH_INTERNATIONAL)
                                list(APPEND __boost_packages locale)
                        endif()
 -                      find_package(Boost 1.34 COMPONENTS ${__boost_packages})
 -                      if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU)
 +                      find_package(Boost 1.48 COMPONENTS ${__boost_packages})
++                      unset(__boost_packages)
 +                      if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU)
                                find_package(IcuLinux)
                        endif()
                        mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
  
                set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
                set(OPENIMAGEIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
--              set(OPENIMAGEIO_DEFINITIONS)
++              set(OPENIMAGEIO_DEFINITIONS "")
  
                if(WITH_IMAGE_TIFF)
                        list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
@@@ -902,7 -862,7 +903,7 @@@ elseif(WIN32
  
        if(CMAKE_COMPILER_IS_GNUCC)
                set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
--              INCLUDE (CheckCSourceCompiles) 
++              include(CheckCSourceCompiles)
                # Setup 64bit and 64bit windows systems
                CHECK_C_SOURCE_COMPILES("
                        #ifndef __MINGW64__
                        endif()
  
                        set_lib_path(PYTHON "python")
--                      STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 -                      set(PYTHON_LIBRARY ${PYTHON}/lib/python${_PYTHON_VERSION_NO_DOTS}.lib) #CACHE FILEPATH
++                      string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 +                      # Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
 +                      set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
 +                      # set(PYTHON_LIBRARY ${PYTHON}/lib/python${_PYTHON_VERSION_NO_DOTS}.lib) #CACHE FILEPATH
                        unset(_PYTHON_VERSION_NO_DOTS)
  
                        #Shared includes for both vc2008 and vc2010
                        set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
                        set(OPENIMAGEIO_LIBRARIES OpenImageIO)
                        set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
--                      set(OPENIMAGEIO_DEFINITIONS)
++                      set(OPENIMAGEIO_DEFINITIONS "")
                endif()
                
                if(WITH_LLVM)
@@@ -1633,7 -1584,7 +1634,7 @@@ elseif(APPLE
                set(TIFF_LIBPATH ${TIFF}/lib)
        endif()
  
--      if (WITH_INPUT_NDOF)
++      if(WITH_INPUT_NDOF)
                # linker needs "-weak_framework 3DconnexionClient"
        endif()
  
                set(BOOST ${LIBDIR}/boost)
                set(BOOST_INCLUDE_DIR ${BOOST}/include)
                set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt)
--              if (WITH_INTERNATIONAL)
++              if(WITH_INTERNATIONAL)
                        list(APPEND BOOST_LIBRARIES boost_locale-mt)
                        set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale needs it !
                endif()
@@@ -1933,15 -1870,10 +1934,16 @@@ if(CMAKE_COMPILER_IS_GNUCC
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
  
        # gcc 4.2 gives annoying warnings on every file with this
--      if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
++      if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
                ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
        endif()
  
-       if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6")
-               ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_REDUNDANT_DECLS -Wredundant-decls)
 +      # versions before gcc4.6 give many BLI_math warnings
++      if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6")
++              ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_REDUNDANT_DECLS       -Wredundant-decls)
++              ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS -Wredundant-decls)
 +      endif()
 +
        # disable because it gives warnings for printf() & friends.
        # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
  
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self)  # needs -Wuninitialized
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
-       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS -Wredundant-decls)
  
        # gcc 4.2 gives annoying warnings on every file with this
--      if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
++      if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
                ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
        endif()
  
diff --cc SConstruct
@@@ -379,11 -372,10 +379,14 @@@ if btools.ENDIAN == "big"
  else:
      env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
  
 -# TODO, make optional
 +# TODO, make optional (as with CMake)
  env['CPPFLAGS'].append('-DWITH_AUDASPACE')
  env['CPPFLAGS'].append('-DWITH_AVI')
 +env['CPPFLAGS'].append('-DWITH_BOOL_COMPAT')
 +
++if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
++    env['CPPFLAGS'].append('-DHAVE_STDBOOL_H')
  # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
  B.root_build_dir = env['BF_BUILDDIR']
  B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
@@@ -168,13 -125,6 +168,12 @@@ PYTHON_SOURCE="http://python.org/ftp/py
  PYTHON_FORCE_REBUILD=false
  PYTHON_SKIP=false
  
- #Could not get numpy-1.6.2 to compile with python-3.3
- NUMPY_VERSION="1.7.0rc1"
++NUMPY_VERSION="1.7.0"
 +NUMPY_VERSION_MIN="1.7"
 +NUMPY_SOURCE="http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz"
 +NUMPY_FORCE_REBUILD=false
 +NUMPY_SKIP=false
 +
  BOOST_VERSION="1.51.0"
  _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
  BOOST_SOURCE="http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download"
@@@ -224,8 -168,8 +223,6 @@@ _ffmpeg_list_sep=";
  # FFMPEG optional libs.
  VORBIS_USE=false
  VORBIS_DEV=""
--SCHRO_USE=false
--SCRHO_DEV=""
  THEORA_USE=false
  THEORA_DEV=""
  XVID_USE=false
@@@ -471,22 -397,10 +468,22 @@@ version_match() 
  detect_distro() {
    if [ -f /etc/debian_version ]; then
      DISTRO="DEB"
-   elif [ -f /etc/redhat-release -o /etc/SuSE-release ]; then
-     DISTRO="RPM"
 -  elif [ -f /etc/redhat-release ]; then
 +  elif [ -f /etc/arch-release ]; then
 +    DISTRO="ARCH"
++  elif [ -f /etc/redhat-release -o /etc/SuSE-release ]; then
+     DISTRO="RPM"
 +  fi
 +}
 +
 +rpm_flavour() {
 +  if [ -f /etc/redhat-release ]; then
 +    if [ "`grep '6\.' /etc/redhat-release`" ]; then
 +      RPM="RHEL"
 +    else
 +      RPM="FEDORA"
 +    fi
    elif [ -f /etc/SuSE-release ]; then
 -    DISTRO="SUSE"
 +    RPM="SUSE"
    fi
  }
  
@@@ -1041,70 -920,6 +1038,74 @@@ compile_OSL() 
    fi
  }
  
-     git pull origin
 +compile_OpenCOLLADA() {
 +  # To be changed each time we make edits that would modify the compiled results!
 +  opencollada_magic=5
 +
 +  _src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
 +  _inst=$INST/opencollada-$OPENCOLLADA_VERSION
 +
 +  # Clean install if needed!
 +  magic_compile_check opencollada-$OPENCOLLADA_VERSION $opencollada_magic
 +  if [ $? -eq 1 -o $OPENCOLLADA_FORCE_REBUILD == true ]; then
 +    rm -rf $_inst
 +  fi
 +
 +  if [ ! -d $_inst ]; then
 +    INFO "Building OpenCOLLADA-$OPENCOLLADA_VERSION"
 +
 +    prepare_opt
 +
 +    if [ ! -d $_src ]; then
 +      mkdir -p $SRC
 +      git clone $OPENCOLLADA_SOURCE $_src
 +    fi
 +
 +    cd $_src
 +
 +    # XXX For now, always update from latest repo...
++    git pull origin master
++
++    # XXX We have to stick to this revision, the next one introduced a change to ExtraHandler' parseElement signature :/
++    git checkout c89cf095c40aa2a518b1104c448825eacc92d174
++    git reset --hard
 +
 +    # Always refresh the whole build!
 +    if [ -d build ]; then
 +      rm -rf build
 +    fi
 +    mkdir build
 +    cd build
 +
 +    cmake_d="-D CMAKE_BUILD_TYPE=Release"
 +    cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
 +    cmake_d="$cmake_d -D USE_EXPAT=OFF"
 +    cmake_d="$cmake_d -D USE_LIBXML=ON"
 +    cmake_d="$cmake_d -D USE_STATIC=ON"
 +
 +    cmake $cmake_d ../
 +
 +    make -j$THREADS && make install
 +    make clean
 +
 +    if [ -d $_inst ]; then
 +      rm -f $INST/opencollada
 +      ln -s opencollada-$OPENCOLLADA_VERSION $INST/opencollada
 +    else
 +      ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
 +      exit 1
 +    fi
 +
 +    magic_compile_set opencollada-$OPENCOLLADA_VERSION $opencollada_magic
 +
 +    cd $CWD
 +    INFO "Done compiling OpenCOLLADA-$OPENCOLLADA_VERSION!"
 +  else
 +    INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
 +    INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
 +  fi
 +}
 +
  compile_FFmpeg() {
    # To be changed each time we make edits that would modify the compiled result!
    ffmpeg_magic=3
        extra="$extra --enable-libtheora"
      fi
  
--    # XXX At least under Debian, static schro gives problem at blender linking time... :/
--    if $SCHRO_USE && ! $ALL_STATIC; then
--      extra="$extra --enable-libschroedinger"
--    fi
--
      if $XVID_USE; then
        extra="$extra --enable-libxvid"
      fi
@@@ -1362,14 -1161,12 +1358,6 @@@ install_DEB() 
        install_packages_DEB $VPX_DEV
        VPX_USE=true
      fi
--
--    INFO ""
-     SCHRO_DEV="libschroedinger-dev"
-     check_package_DEB $SCHRO_DEV
 -    check_package_DEB libspnav-dev
--    if [ $? -eq 0 ]; then
-       install_packages_DEB $SCHRO_DEV
-       SCHRO_USE=true
 -      install_packages_DEB libspnav-dev
--    fi
    fi
  
    INFO ""
@@@ -1601,138 -1345,48 +1589,139 @@@ install_RPM() 
    INFO "`eval _echo "$COMMON_INFO"`"
    INFO ""
  
 -  sudo yum -y update
 +  read -p "Do you want to continue (Y/n)?"
 +  [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
  
 -  # These libs should always be available in debian/ubuntu official repository...
 +  # Enable non-free repositories for all flavours
 +  rpm_flavour
 +  if [ $RPM = "FEDORA" ]; then
++    _fedora_rel="`egrep "[0-9]{1,}" /etc/fedora-release -o`"
 +    sudo yum -y localinstall --nogpgcheck \
-     http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \
-     http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
++    http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$_fedora_rel.noarch.rpm \
++    http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$_fedora_rel.noarch.rpm
 +
 +    sudo yum -y update
 +
 +    # Install cmake now because of difference with RHEL
 +    sudo yum -y install cmake
 +
 +  elif [ $RPM = "RHEL" ]; then
 +    sudo yum -y localinstall --nogpgcheck \
 +    http://download.fedoraproject.org/pub/epel/6/$(uname -i)/epel-release-6-8.noarch.rpm \
 +    http://download1.rpmfusion.org/free/el/updates/6/$(uname -i)/rpmfusion-free-release-6-1.noarch.rpm \
 +    http://download1.rpmfusion.org/nonfree/el/updates/6/$(uname -i)/rpmfusion-nonfree-release-6-1.noarch.rpm
 +
 +    sudo yum -y update
 +
 +    # Install cmake 2.8 from other repo
 +    mkdir -p $SRC
 +    if [ -f $SRC/cmake-2.8.8-4.el6.$(uname -m).rpm ]; then
 +      INFO ""
 +      INFO "Special cmake already installed"
 +    else
 +      curl -O ftp://ftp.pbone.net/mirror/atrpms.net/el6-$(uname -i)/atrpms/testing/cmake-2.8.8-4.el6.$(uname -m).rpm
 +      mv cmake-2.8.8-4.el6.$(uname -m).rpm $SRC/
 +      sudo rpm -ihv $SRC/cmake-2.8.8-4.el6.$(uname -m).rpm
 +    fi
 +
 +  elif [ $RPM = "SUSE" ]; then
++    # Install this now to avoid using the version from packman repository...
++    if $WITH_ALL; then
++      install_packages_RPM libjack-devel
++    fi
++
 +    _suse_rel="`grep VERSION /etc/SuSE-release | gawk '{print $3}'`"
 +    sudo zypper ar -f http://packman.inode.at/suse/openSUSE_$_suse_rel/ packman
 +
 +    sudo zypper --non-interactive --gpg-auto-import-keys update --auto-agree-with-licenses
 +  fi
 +
 +  # These libs should always be available in fedora/suse official repository...
    OPENJPEG_DEV="openjpeg-devel"
 -  SCHRO_DEV="schroedinger-devel"
    VORBIS_DEV="libvorbis-devel"
    THEORA_DEV="libtheora-devel"
  
-   _packages="gcc gcc-c++ make scons libpng-devel libtiff-devel \
-              freetype-devel libX11-devel libXi-devel wget ncurses-devel \
 -  _packages="gawk gcc gcc-c++ cmake scons libpng-devel libtiff-devel freetype-devel \
 -             libX11-devel libXi-devel wget libsqlite3x-devel ncurses-devel \
 -             readline-devel $OPENJPEG_DEV openexr-devel openal-soft-devel \
 -             glew-devel yasm $THEORA_DEV $VORBIS_DEV SDL-devel fftw-devel \
 -             lame-libs libjpeg-devel patch python-devel"
++  _packages="gcc gcc-c++ make scons libtiff-devel freetype-devel libjpeg-devel\
++             libpng-devel libX11-devel libXi-devel wget ncurses-devel \
 +             readline-devel $OPENJPEG_DEV openal-soft-devel \
-              glew-devel yasm $THEORA_DEV $VORBIS_DEV SDL-devel fftw-devel \
-              libjpeg-devel patch"
++             glew-devel yasm $THEORA_DEV $VORBIS_DEV patch"
 +
    OPENJPEG_USE=true
    VORBIS_USE=true
    THEORA_USE=true
  
 -  if $WITH_ALL; then
 -    _packages="$_packages $SCHRO_DEV jack-audio-connection-kit-devel libspnav-devel"
 -    SCHRO_USE=true
 -  fi
 +  if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
  
-     _packages="$_packages libsqlite3-devel openexr-devel"
 -  INFO ""
 -  install_packages_RPM $_packages
++    _packages="$_packages libsqlite3x-devel openexr-devel fftw-devel SDL-devel"
  
 -  INFO ""
 -  X264_DEV="x264-devel"
 -  check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
 -  if [ $? -eq 0 ]; then
 -    install_packages_RPM $X264_DEV
 -    X264_USE=true
 -  fi
 +    if $WITH_ALL; then
-       _packages="$_packages jack-audio-connection-kit-devel libspnav-devel"
++      _packages="$_packages jack-audio-connection-kit-devel"
 +    fi
  
 -  if $WITH_ALL; then
      INFO ""
 -    XVID_DEV="xvidcore-devel"
 -    check_package_RPM $XVID_DEV
 +    install_packages_RPM $_packages
 +
 +    INFO ""
 +    X264_DEV="x264-devel"
 +    check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
      if [ $? -eq 0 ]; then
 -      install_packages_RPM $XVID_DEV
 -      XVID_USE=true
 +      install_packages_RPM $X264_DEV
 +      X264_USE=true
 +    fi
 +
 +    if $WITH_ALL; then
 +      INFO ""
 +      XVID_DEV="xvidcore-devel"
 +      check_package_RPM $XVID_DEV
 +      if [ $? -eq 0 ]; then
 +        install_packages_RPM $XVID_DEV
 +        XVID_USE=true
 +      fi
 +
 +      INFO ""
 +      MP3LAME_DEV="lame-devel"
 +      check_package_RPM $MP3LAME_DEV
 +      if [ $? -eq 0 ]; then
 +        install_packages_RPM $MP3LAME_DEV
 +        MP3LAME_USE=true
 +      fi
 +    fi
 +
 +  elif [ $RPM = "SUSE" ]; then
 +
-     _packages="$_packages cmake sqlite3-devel libopenexr-devel"
-     if $WITH_ALL; then
-       _packages="$_packages libjack-devel libspnav-devel"
-     fi
++    _packages="$_packages cmake sqlite3-devel libopenexr-devel fftw3-devel libSDL-devel"
 +
 +    INFO ""
 +    install_packages_RPM $_packages
 +
 +    INFO ""
 +    X264_DEV="libx264-devel"
 +    check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
 +    if [ $? -eq 0 ]; then
 +      install_packages_RPM $X264_DEV
 +      X264_USE=true
      fi
  
 +    if $WITH_ALL; then
 +      INFO ""
 +      XVID_DEV="libxvidcore-devel"
 +      check_package_RPM $XVID_DEV
 +      if [ $? -eq 0 ]; then
 +        install_packages_RPM $XVID_DEV
 +        XVID_USE=true
 +      fi
 +
 +      INFO ""
 +      MP3LAME_DEV="libmp3lame-devel"
 +      check_package_RPM $MP3LAME_DEV
 +      if [ $? -eq 0 ]; then
 +        install_packages_RPM $MP3LAME_DEV
 +        MP3LAME_USE=true
 +      fi
 +    fi
 +  fi
 +
 +  if $WITH_ALL; then
      INFO ""
      VPX_DEV="libvpx-devel"
      check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
        install_packages_RPM $VPX_DEV
        VPX_USE=true
      fi
--
      INFO ""
-     SCHRO_DEV="schroedinger-devel"
-     check_package_RPM $SCHRO_DEV
 -    MP3LAME_DEV="lame-devel"
 -    check_package_RPM $MP3LAME_DEV
--    if [ $? -eq 0 ]; then
-       install_packages_RPM $SCHRO_DEV
-       SCHRO_USE=true
 -      install_packages_RPM $MP3LAME_DEV
 -      MP3LAME_USE=true
--    fi
++    install_packages_RPM libspnav-devel
    fi
-  
    INFO ""
    if $PYTHON_SKIP; then
      INFO "WARNING! Skipping Python installation, as requested..."
      if $LLVM_SKIP; then
        INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
      else
--      check_package_RPM llvm-$LLVM_VERSION-devel
++      # Problem compiling with LLVM 3.2 so match version 3.1 ...
++      check_package_version_match_RPM llvm $LLVM_VERSION
        if [ $? -eq 0 ]; then
-         install_packages_RPM llvm-$LLVM_VERSION-devel clang
 -        install_packages_RPM llvm-$LLVM_VERSION-devel
++        if [ $RPM = "SUSE" ]; then
++          install_packages_RPM llvm-devel llvm-clang-devel
++        else
++          install_packages_RPM llvm-devel clang-devel
++        fi
          have_llvm=true
          LLVM_VERSION_FOUND=$LLVM_VERSION
        else
 -#        check_package_RPM llvm-$LLVM_VERSION_MIN-devel
 -#        if [ $? -eq 0 ]; then
 -#          install_packages_RPM llvm-$LLVM_VERSION_MIN-devel
 -#          have_llvm=true
 -#          LLVM_VERSION_FOUND=$LLVM_VERSION_MIN
 -#        else
 -#          check_package_version_ge_RPM llvm-devel $LLVM_VERSION_MIN
 -#          if [ $? -eq 0 ]; then
 -#            install_packages_RPM llvm-devel
 -#            have_llvm=true
 -#            LLVM_VERSION_FOUND=`get_package_version_RPM llvm-devel`
 -#          fi
 -#        fi
 -      install_packages_RPM libffi-devel
 -      # XXX Stupid fedora puts ffi header into a darn stupid dir!
 -      _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
 -      INFO ""
 -      compile_LLVM
 -      have_llvm=true
 -      LLVM_VERSION_FOUND=$LLVM_VERSION
 +        #
 +        # Better to compile it than use minimum version from repo...
 +        #
-       install_packages_RPM libffi-devel
-       # LLVM can't find the fedora ffi header dir...
-       _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
-       INFO ""
-       compile_LLVM
-       have_llvm=true
-       LLVM_VERSION_FOUND=$LLVM_VERSION
++        install_packages_RPM libffi-devel
++        # LLVM can't find the fedora ffi header dir...
++        _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
++        INFO ""
++        compile_LLVM
++        have_llvm=true
++        LLVM_VERSION_FOUND=$LLVM_VERSION
        fi
      fi
  
      fi
    fi
  
 -  INFO ""
 +  if $WITH_OPENCOLLADA; then
 +    if $OPENCOLLADA_SKIP; then
 +      INFO "WARNING! Skipping OpenCOLLADA installation, as requested..."
 +    else
 +      INFO ""
 +      install_packages_RPM pcre-devel libxml2-devel git
 +      # Find path to libxml shared lib...
 +      _XML2_LIB=`rpm -ql libxml2-devel | grep -e ".*/libxml2.so"`
 +      # No package...
 +      INFO ""
 +      compile_OpenCOLLADA
 +    fi
 +  fi
 +
-   INFO ""
    if $FFMPEG_SKIP; then
      INFO "WARNING! Skipping FFMpeg installation, as requested..."
    else
--    # Always for now, not sure which packages should be installed
--    compile_FFmpeg
++    check_package_version_ge_RPM ffmpeg $FFMPEG_VERSION_MIN
++    if [ $? -eq 0 ]; then
++      install_packages_RPM ffmpeg ffmpeg-devel
++    else
++      INFO ""
++      compile_FFmpeg
++    fi
+   fi
+ }
 -get_package_version_SUSE() {
 -  zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
++
++get_package_version_ARCH() {
++  pacman -Si $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'
+ }
 -check_package_SUSE() {
 -  r=`zypper info $1 | grep -c 'Summary'`
++check_package_ARCH() {
++  r=`pacman -Si $1 | grep -c 'Description'`
+   if [ $r -ge 1 ]; then
+     return 0
+   else
+     return 1
    fi
  }
  
 -check_package_version_match_SUSE() {
 -  v=`get_package_version_SUSE $1`
++check_package_version_match_ARCH() {
++  v=`get_package_version_ARCH $1`
+   if [ -z "$v" ]; then
+     return 1
+   fi
+   version_match $v $2
+   return $?
+ }
 -check_package_version_ge_SUSE() {
 -  v=`get_package_version_SUSE $1`
++check_package_version_ge_ARCH() {
++  v=`get_package_version_ARCH $1`
+   if [ -z "$v" ]; then
+     return 1
+   fi
+   version_ge $v $2
+   return $?
+ }
 -install_packages_SUSE() {
 -  sudo zypper --non-interactive install --auto-agree-with-licenses $@
++install_packages_ARCH() {
++  sudo pacman -S --needed --noconfirm $@
+   if [ $? -ge 1 ]; then
 -    ERROR "zypper failed to install requested packages, exiting."
++    ERROR "pacman failed to install requested packages, exiting."
+     exit 1
+   fi
+ }
 -
 -install_SUSE() {
++install_ARCH() {
+   INFO ""
 -  INFO "Installing dependencies for SuSE-based distribution"
++  INFO "Installing dependencies for ARCH-based distribution"
+   INFO ""
+   INFO "`eval _echo "$COMMON_INFO"`"
+   INFO ""
 -  sudo zypper --non-interactive update --auto-agree-with-licenses
++  read -p "Do you want to continue (Y/n)?"
++  [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" != "y" ] && exit
 -  # These libs should always be available in debian/ubuntu official repository...
 -  OPENJPEG_DEV="openjpeg-devel"
 -  SCHRO_DEV="schroedinger-devel"
 -  VORBIS_DEV="libvorbis-devel"
 -  THEORA_DEV="libtheora-devel"
++  # Check for sudo...
++  if [ ! -x "/usr/bin/sudo" ]; then
++    INFO ""
++    INFO "This script requires sudo but it is not installed."
++    INFO "Please setup sudo according to:" 
++    INFO "https://wiki.archlinux.org/index.php/Sudo"
++    INFO "and try again."
++    INFO ""
++    exit
++  fi
++
++  sudo pacman -Sy
++
++  # These libs should always be available in arch official repository...
++  OPENJPEG_DEV="openjpeg"
++  VORBIS_DEV="libvorbis"
++  THEORA_DEV="libtheora"
++
++  _packages="base-devel scons cmake libxi glew libpng libtiff wget openal \
++             $OPENJPEG_DEV $VORBIS_DEV $THEORA_DEV  openexr yasm sdl fftw"
 -  _packages="gawk gcc gcc-c++ cmake scons libpng12-devel libtiff-devel freetype-devel \
 -             libX11-devel libXi-devel wget sqlite3-devel ncurses-devel \
 -             readline-devel $OPENJPEG_DEV libopenexr-devel openal-soft-devel \
 -             glew-devel yasm $THEORA_DEV $VORBIS_DEV libSDL-devel fftw3-devel \
 -             libjpeg62-devel patch python-devel"
+   OPENJPEG_USE=true
+   VORBIS_USE=true
+   THEORA_USE=true
+   if $WITH_ALL; then
 -    _packages="$_packages $SCHRO_DEV libjack-devel libspnav-devel"
 -    SCHRO_USE=true
++    # No libspacenav in official arch repos...
++    _packages="$_packages jack"
+   fi
+   INFO ""
 -  install_packages_SUSE $_packages
++  install_packages_ARCH $_packages
+   INFO ""
 -  X264_DEV="x264-devel"
 -  check_package_version_ge_SUSE $X264_DEV $X264_VERSION_MIN
++  X264_DEV="x264"
++  check_package_version_ge_ARCH $X264_DEV $X264_VERSION_MIN
+   if [ $? -eq 0 ]; then
 -    install_packages_SUSE $X264_DEV
++    install_packages_ARCH $X264_DEV
+     X264_USE=true
+   fi
+   if $WITH_ALL; then
+     INFO ""
 -    XVID_DEV="xvidcore-devel"
 -    check_package_SUSE $XVID_DEV
++    XVID_DEV="xvidcore"
++    check_package_ARCH $XVID_DEV
+     if [ $? -eq 0 ]; then
 -      install_packages_SUSE $XVID_DEV
++      install_packages_ARCH $XVID_DEV
+       XVID_USE=true
+     fi
+     INFO ""
 -    VPX_DEV="libvpx-devel"
 -    check_package_version_ge_SUSE $VPX_DEV $VPX_VERSION_MIN
++    MP3LAME_DEV="lame"
++    check_package_ARCH $MP3LAME_DEV
+     if [ $? -eq 0 ]; then
 -      install_packages_SUSE $VPX_DEV
 -      VPX_USE=true
++      install_packages_ARCH $MP3LAME_DEV
++      MP3LAME_USE=true
+     fi
+     INFO ""
 -    # No mp3 in suse, it seems.
 -    MP3LAME_DEV="lame-devel"
 -    check_package_SUSE $MP3LAME_DEV
++    VPX_DEV="libvpx"
++    check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
+     if [ $? -eq 0 ]; then
 -      install_packages_SUSE $MP3LAME_DEV
 -      MP3LAME_USE=true
++      install_packages_ARCH $VPX_DEV
++      VPX_USE=true
+     fi
+   fi
+   INFO ""
+   if $PYTHON_SKIP; then
+     INFO "WARNING! Skipping Python installation, as requested..."
+   else
 -    check_package_version_match_SUSE python3-devel 3.3.
++    check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
+     if [ $? -eq 0 ]; then
 -      install_packages_SUSE python3-devel
++      install_packages_ARCH python
++      INFO ""
++      if $WITH_NUMPY; then
++        if $NUMPY_SKIP; then
++          INFO "WARNING! Skipping NumPy installation, as requested..."
++        else
++          check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN
++          if [ $? -eq 0 ]; then
++            install_packages_ARCH python-numpy
++          else
++            INFO "WARNING! Sorry, using python package but no numpy package available!"
++          fi
++        fi
++      fi
+     else
+       compile_Python
++      INFO ""
++      if $WITH_NUMPY; then
++        if $NUMPY_SKIP; then
++          INFO "WARNING! Skipping NumPy installation, as requested..."
++        else
++          compile_Numpy
++        fi
++      fi
+     fi
+   fi
+   INFO ""
+   if $BOOST_SKIP; then
+     INFO "WARNING! Skipping Boost installation, as requested..."
+   else
 -    # No boost_locale currently available, so let's build own boost.
 -    compile_Boost
++    check_package_version_ge_ARCH boost $BOOST_VERSION_MIN
++    if [ $? -eq 0 ]; then
++      install_packages_ARCH boost
++    else
++      compile_Boost
++    fi
+   fi
+   INFO ""
+   if $OCIO_SKIP; then
+     INFO "WARNING! Skipping OpenColorIO installation, as requested..."
+   else
 -    # No ocio currently available, so let's build own boost.
 -    compile_OCIO
++    check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
++    if [ $? -eq 0 ]; then
++      install_packages_ARCH opencolorio yaml-cpp tinyxml
++    else
++      install_packages_ARCH yaml-cpp tinyxml
++      compile_OCIO
++    fi
+   fi
+   INFO ""
+   if $OIIO_SKIP; then
+     INFO "WARNING! Skipping OpenImageIO installation, as requested..."
+   else
 -    # No oiio currently available, so let's build own boost.
 -    compile_OIIO
++    check_package_version_ge_ARCH openimageio $OIIO_VERSION_MIN
++    if [ $? -eq 0 ]; then
++      install_packages_ARCH openimageio
++    else
++      compile_OIIO
++    fi
+   fi
+   if $WITH_OSL; then
+     have_llvm=false
+     INFO ""
+     if $LLVM_SKIP; then
+       INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
+     else
 -      # Suse llvm package *_$SUCKS$_* (tm) !!!
 -#      check_package_version_ge_SUSE llvm-devel $LLVM_VERSION_MIN
 -#      if [ $? -eq 0 ]; then
 -#        install_packages_SUSE llvm-devel
 -#        have_llvm=true
 -#        LLVM_VERSION_FOUND=`get_package_version_SUSE llvm-devel`
 -#      fi
 -
 -      install_packages_SUSE libffi47-devel
 -      INFO ""
 -      compile_LLVM
 -      have_llvm=true
 -      LLVM_VERSION_FOUND=$LLVM_VERSION
++      check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
++      if [ $? -eq 0 ]; then
++        install_packages_ARCH llvm clang
++        have_llvm=true
++        LLVM_VERSION=`check_package_version_ge_ARCH llvm`
++        LLVM_VERSION_FOUND=$LLVM_VERSION
++      else
++        install_packages_ARCH libffi
++        # LLVM can't find the arch ffi header dir...
++        _FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
++        # LLVM 3.1 needs python2 to build and arch defaults to python3
++        _PYTHON2_BIN="/usr/bin/python2"
++        INFO ""
++        compile_LLVM
++        have_llvm=true
++        LLVM_VERSION_FOUND=$LLVM_VERSION
++      fi
+     fi
+     if $OSL_SKIP; then
+       INFO ""
 -      INFO "WARNING! Skipping OpenShaderLanguage installation, as requested..."
++      INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
+     else
+       if $have_llvm; then
++        check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
++        if [ $? -eq 0 ]; then
++          install_packages_ARCH openshadinglanguage
++        else
++          #XXX Note: will fail to build with LLVM 3.2! 
++          INFO ""
++          install_packages_ARCH git intel-tbb
++          INFO ""
++          compile_OSL
++        fi
++      fi
++    fi
++  fi
++
++  INFO ""
++  if $WITH_OPENCOLLADA; then
++    if $OPENCOLLADA_SKIP; then
++      INFO "WARNING! Skipping OpenCOLLADA installation, as requested..."
++    else
++      INFO ""
++      check_package_ARCH opencollada
++      if [ $? -eq 0 ]; then
++        install_packages_ARCH opencollada
++      else
++        install_packages_ARCH pcre git
+         INFO ""
 -        # XXX No tbb lib!
 -        install_packages_SUSE flex bison git
 -        # No package currently!
 -        INFO ""
 -        compile_OSL
++        compile_OpenCOLLADA
+       fi
++    # Find path to libxml shared lib...
++    _XML2_LIB=`pacman -Ql libxml2 | grep -e ".*/libxml2.so$" | gawk '{print $2}'`
+     fi
+   fi
+   INFO ""
+   if $FFMPEG_SKIP; then
+     INFO "WARNING! Skipping FFMpeg installation, as requested..."
+   else
 -    # No ffmpeg currently available, so let's build own boost.
 -    compile_FFmpeg
++    check_package_version_ge_ARCH ffmpeg $FFMPEG_VERSION_MIN
++    if [ $? -eq 0 ]; then
++      install_packages_ARCH ffmpeg
++    else
++      compile_FFmpeg
++    fi
+   fi
+ }
  
 +
  print_info_ffmpeglink_DEB() {
    if $ALL_STATIC; then
      dpkg -L $_packages | grep -e ".*\/lib[^\/]\+\.a" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", $0); nlines++ }'
  }
  
  print_info_ffmpeglink_RPM() {
 -  if $ALL_STATIC; then
 -    rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.a" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", $0); nlines++ }'
 -  else
 -    rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
 -  fi
 +#  # XXX No static libs...
 +#  if $ALL_STATIC; then
 +#    rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.a" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", $0); nlines++ }'
 +#  else
 +  rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
 +#  fi
  }
  
 -print_info_ffmpeglink_SUSE() {
 -  if $ALL_STATIC; then
 -    rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.a" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", $0); nlines++ }'
 -  else
 -    rpm -ql $_packages | grep -e ".*\/lib[^\/]\+\.so" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
 -  fi
++print_info_ffmpeglink_ARCH() {
++# No static libs...
++  pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", $0)); nlines++ }'
+ }
  print_info_ffmpeglink() {
    # This func must only print a ';'-separated list of libs...
    if [ -z "$DISTRO" ]; then
      _packages="$_packages $OPENJPEG_DEV"
    fi
  
-   if $SCHRO_USE; then
 -  # XXX At least under Debian, static schro gives problem at blender linking time... :/
 -  if $SCHRO_USE && ! $ALL_STATIC; then
--    _packages="$_packages $SCHRO_DEV"
--  fi
--
    if [ "$DISTRO" = "DEB" ]; then
      print_info_ffmpeglink_DEB
    elif [ "$DISTRO" = "RPM" ]; then
      print_info_ffmpeglink_RPM
- #  elif [ "$DISTRO" = "ARCH" ]; then
- #    print_info_ffmpeglink_ARCH
 -  elif [ "$DISTRO" = "SUSE" ]; then
 -    print_info_ffmpeglink_SUSE
++  elif [ "$DISTRO" = "ARCH" ]; then
++    print_info_ffmpeglink_ARCH
    # XXX TODO!
    else INFO "<Could not determine additional link libraries needed for ffmpeg, replace this by valid list of libs...>"
    fi
@@@ -1957,71 -1787,33 +2218,101 @@@ print_info() 
    INFO ""
    INFO "If you're using CMake add this to your configuration flags:"
  
 +  _buildargs=""
 +
    if $ALL_STATIC; then
 -    INFO "  -D WITH_STATIC_LIBS=ON"
 +    _1="-D WITH_STATIC_LIBS=ON"
 +    # XXX Force linking with shared SDL lib!
 +    _2="-D SDL_LIBRARY='libSDL.so;-lpthread'"
 +    INFO "  $_1"
 +    INFO "  $_2"
 +    _buildargs="$_buildargs $_1 $_2"
++    # XXX Arch linux needs to link freetype dynamically...
++    if [ "$DISTRO" = "ARCH" ]; then
++      _1="-D FREETYPE_LIBRARY=/usr/lib/libfreetype.so"
++      INFO "  $_1"
++      _buildargs="$_buildargs $_1"
++    fi
    fi
  
    if [ -d $INST/boost ]; then
 -    INFO "  -D BOOST_ROOT=$INST/boost"
 -    INFO "  -D Boost_NO_SYSTEM_PATHS=ON"
 +    _1="-D BOOST_ROOT=$INST/boost"
 +    _2="-D Boost_NO_SYSTEM_PATHS=ON"
 +    INFO "  $_1"
 +    INFO "  $_2"
 +    _buildargs="$_buildargs $_1 $_2"
    elif $ALL_STATIC; then
 -    INFO "  -D Boost_USE_ICU=ON"
 +    _1="-D WITH_BOOST_ICU=ON"
 +    INFO "  $_1"
 +    _buildargs="$_buildargs $_1"
++    # XXX Arch linux fails static linking without these...
++    if [ "$DISTRO" = "ARCH" ]; then
++      _1="-D ICU_LIBRARY_DATA=/usr/lib/libicudata.so"
++      _2="-D ICU_LIBRARY_I18N=/usr/lib/libicui18n.so"
++      _3="-D ICU_LIBRARY_IO=/usr/lib/libicuio.so"
++      _4="-D ICU_LIBRARY_LE=/usr/lib/libicule.so"
++      _5="-D ICU_LIBRARY_LX=/usr/lib/libiculx.so"
++      _6="-D ICU_LIBRARY_TU=/usr/lib/libicutu.so"
++      _7="-D ICU_LIBRARY_UC=/usr/lib/libicuuc.so"
++      INFO "  $_1"
++      INFO "  $_2"
++      INFO "  $_3"
++      INFO "  $_4"
++      INFO "  $_5"
++      INFO "  $_6"
++      INFO "  $_7"
++      _buildargs="$_buildargs $_1 $_2 $_3 $_4 $_5 $_6 $_7"
++    fi
    fi
  
--  if [ -d $INST/osl -a $WITH_OSL == true ]; then
-     _1="-D CYCLES_OSL=$INST/osl"
-     _2="-D WITH_CYCLES_OSL=ON"
 -    INFO "  -D CYCLES_OSL=$INST/osl"
 -    INFO "  -D WITH_CYCLES_OSL=ON"
 -    INFO "  -D LLVM_VERSION=$LLVM_VERSION_FOUND"
++  if $WITH_OSL; then
++    _1="-D WITH_CYCLES_OSL=ON"
++    _2="-D WITH_LLVM=ON"
 +    _3="-D LLVM_VERSION=$LLVM_VERSION_FOUND"
 +    INFO "  $_1"
 +    INFO "  $_2"
 +    INFO "  $_3"
 +    _buildargs="$_buildargs $_1 $_2 $_3"
++    if [ -d $INST/osl ]; then
++      _1="-D CYCLES_OSL=$INST/osl"
++      INFO "  $_1"
++      _buildargs="$_buildargs $_1"
++    fi
      if [ -d $INST/llvm ]; then
 -      INFO "  -D LLVM_DIRECTORY=$INST/llvm"
 -      INFO "  -D LLVM_STATIC=ON"
 +      _1="-D LLVM_DIRECTORY=$INST/llvm"
 +      _2="-D LLVM_STATIC=ON"
 +      INFO "  $_1"
 +      INFO "  $_2"
 +      _buildargs="$_buildargs $_1 $_2"
      fi
    fi
  
-   if [ -d $INST/opencollada -a $WITH_OPENCOLLADA == true ]; then
++  if $WITH_OPENCOLLADA; then
 +    _1="-D WITH_OPENCOLLADA=ON"
 +    INFO "  $_1"
 +    _buildargs="$_buildargs $_1"
 +    if $ALL_STATIC; then
 +      _1="-D XML2_LIBRARY=$_XML2_LIB"
 +      INFO "  $_1"
 +      _buildargs="$_buildargs $_1"
 +    fi
 +  fi
 +
++  _1="-D WITH_CODEC_FFMPEG=ON"
++  _2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;rt;`print_info_ffmpeglink`'"
++  INFO "  $_1"
++  INFO "  $_2"
++  _buildargs="$_buildargs $_1 $_2"
    if [ -d $INST/ffmpeg ]; then
-     _1="-D WITH_CODEC_FFMPEG=ON"
-     _2="-D FFMPEG=$INST/ffmpeg"
-     _3="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;rt;`print_info_ffmpeglink`'"
 -    INFO "  -D WITH_CODEC_FFMPEG=ON"
 -    INFO "  -D FFMPEG=$INST/ffmpeg"
 -    INFO "  -D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;rt;`print_info_ffmpeglink`'"
++    _1="-D FFMPEG=$INST/ffmpeg"
 +    INFO "  $_1"
-     INFO "  $_2"
-     INFO "  $_3"
-     _buildargs="$_buildargs $_1 $_2 $_3"
++    _buildargs="$_buildargs $_1"
    fi
  
 +  INFO ""
 +  INFO "Or even simpler, just run (in your blender-source dir):"
 +  INFO "  make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\""
 +
    INFO ""
    INFO "If you're using SCons add this to your user-config:"
  
      INFO "BF_PYTHON_ABI_FLAGS = 'm'"
    fi
  
++  INFO "WITH_BF_OCIO = True"
    if [ -d $INST/ocio ]; then
      INFO "BF_OCIO = '$INST/ocio'"
    fi
  
++  INFO "WITH_BF_OIIO = True"
    if [ -d $INST/oiio ]; then
      INFO "BF_OIIO = '$INST/oiio'"
    fi
++  INFO "WITH_BF_CYCLES = True"
 +
 +  if [ -d $INST/osl ]; then
 +    INFO "BF_OSL = '$INST/osl'"
 +  fi
  
++  INFO "WITH_BF_BOOST = True"
    if [ -d $INST/boost ]; then
      INFO "BF_BOOST = '$INST/boost'"
-     INFO "WITH_BF_BOOST = True"
    fi
  
++  _ffmpeg_list_sep=" "
++  INFO "BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
    if [ -d $INST/ffmpeg ]; then
      INFO "BF_FFMPEG = '$INST/ffmpeg'"
--    _ffmpeg_list_sep=" "
--    INFO "BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
++  fi
++
++  if ! $WITH_ALL; then
++    INFO "WITH_BF_3DMOUSE = False"
++  # No libspacenav in official arch repos...
++  elif [ "$DISTRO" = "ARCH" ]; then
++    INFO "WITH_BF_3DMOUSE = False"
    fi
  
    INFO ""
@@@ -2073,14 -1860,11 +2374,14 @@@ elif [ "$DISTRO" = "DEB" ]; the
    install_DEB
  elif [ "$DISTRO" = "RPM" ]; then
    install_RPM
- #elif [ "$DISTRO" = "ARCH" ]; then
- #  install_ARCH
 -elif [ "$DISTRO" = "SUSE" ]; then
 -  install_SUSE
++elif [ "$DISTRO" = "ARCH" ]; then
++  install_ARCH
  fi
  
 -print_info
 +print_info | tee BUILD_NOTES.txt
 +INFO ""
 +INFO "This information has been written to BUILD_NOTES.txt"
 +INFO ""
  
  # Switch back to user language.
  LANG=LANG_BACK
@@@ -398,6 -388,6 +398,10 @@@ Utility function
  .. function:: PrintMemInfo()
  
     Prints engine statistics into the console
++
++.. function:: getProfileInfo()
++
++   Returns a Python dictionary that contains the same information as the on screen profiler. The keys are the profiler categories and the values are tuples with the first element being time taken (in ms) and the second element being the percentage of total time.
     
  *********
  Constants
@@@ -1110,7 -1106,8 +1110,8 @@@ namespace 
          }
  
          // copy up to the end of the path.
-         std::copy(base_loop.begin() + pos, base_loop.begin() + e1_1, std::back_inserter(out));
+               if (pos < e1_1)
 -            std::copy(base_loop.begin() + pos, base_loop.begin() + e1_1, std::back_inserter(out));
++                      std::copy(base_loop.begin() + pos, base_loop.begin() + e1_1, std::back_inserter(out));
  
          CARVE_ASSERT(base_loop[e1_1] == p1.back());
          std::copy(p1.rbegin(), p1.rend() - 1, std::back_inserter(out));
 -commit 552f9f85bba89f00ca307bc18fbda1dff23bd0e4
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 31 07:27:22 2012 -0700
++commit f46de9e697eb5b8756084615e29ded48600a4d39
++Author: Sergey Sharybin <sergey.vfx@gmail.com>
++Date:   Thu Mar 21 15:31:35 2013 +0600
 -    Various minor bug fixes to the solver logic.
 -    
 -    1. CostFunction returning false is handled better.
 -    If only the cost is being evaluated, it is possible to
 -    use the false value as an infinite value signal/outside
 -    a region of validity. This allows a weak form of constraint
 -    handling. Useful for example in handling infinities.
 -    
 -    2. Changed the way how the slop around zero when model_cost
 -    is larger than the current cost. Relative instead of absolute
 -    tolerances are used. The same logic is propagated how the
 -    corresponding clamping of the model_cost is done.
++    Silent no previous declaration warning for FindParameterBlockOrDie
+     
 -    3. Fixed a minor indexing bug in nist.cc.
++    Use anonymous namespace for this. Also move some surrounding static
++    function to this anonymous namespace.
+     
 -    4. Some minor logging fixes to nist.cc to make it more
 -    compatible with the rest of ceres.
++    Change-Id: Ie235eb7936976563a9db115ec13c59e6e6869b96
++
++commit 16636efeffacdd69d075a60ea8a94d98fd81c6fd
++Author: Sergey Sharybin <sergey.vfx@gmail.com>
++Date:   Thu Mar 21 15:12:01 2013 +0600
++
++    Compilation fix for msvc2010
+     
 -    Together these changes, take the successful solve count from
 -    41/54 to 46/54 and eliminate all NUMERICAL_FAILURE problems.
++    Usage of back_inserter requires <iterator> header when using msvc2010
+     
 -    Change-Id: If94170ea4731af5b243805c0200963dd31aa94a7
++    Change-Id: I92ee1649795ce0468ce337fc414eb0ca6e90c51e
 -commit 0b776b5cc9634d3b88d623905b96006f7647ce3e
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 30 15:26:17 2012 -0700
++commit ac0d416991274ed67fe85371f09b07f706a6db9a
++Author: Pablo Speciale <pablo.speciale@gmail.com>
++Date:   Wed Mar 20 18:32:14 2013 -0700
 -    Update docs.
++    google-glog link wasn't working, 'http://' twice
+     
 -    Change-Id: I69d50bcd37aed3bea2190ca614f023e83172901b
++    Change-Id: I9cd96d3609f9b1ba31cd480fef1702972be86741
 -commit 2d7176ad7c8fb7238ca8abd6de73415d95877494
 -Author: Petter Strandmark <petter.strandmark@gmail.com>
 -Date:   Thu Aug 30 19:51:24 2012 -0700
++commit 55b6c966c4f697cb5d11982201733aa3bce7a5a7
++Author: Pablo Speciale <pablo.speciale@gmail.com>
++Date:   Wed Mar 20 17:44:04 2013 -0700
 -    max_consecutive_nonmonotonic_steps should be int
++    * Fixed the location of the Ceres doc (once installed with 'make install')
++    * Doing 'make ceres_docs' can be used to create the documentation (if the BUILD_DOCUMENTATION=ON)
++    * Included the copyright boilerplate for FindSphinx.cmake
+     
 -    Found via Visual Studio warning.
 -    
 -    Change-Id: Id2cd7de562dfc8cd35df5d5f5220dd2d7350eb2c
++    Change-Id: Iea21eba9e68384b4fe72c85fa88c76b0ba8a7a1d
 -commit 1a89bcc94e88933f89b20427a45bc40cdd23c056
++commit a986912555b304a47dd0c2a02892046fde15d091
+ Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 30 15:26:17 2012 -0700
++Date:   Wed Mar 20 11:50:34 2013 -0700
 -    Better reporting on the NIST problems.
++    Update version history
+     
 -    Change-Id: I7cf774ec3242c0612dbe52fc233c3fc6cff3f031
++    Change-Id: I238279719219a26d0d1bb32e0610f41007d3dcef
 -commit ea11704857a1e4a735e096896e4d775d83981499
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Wed Aug 29 18:18:48 2012 -0700
++commit 16dbf11626c52c013f1dca6375f993a554e31d51
++Author: Pablo Speciale <pablo.speciale@gmail.com>
++Date:   Mon Mar 11 14:44:02 2013 -0700
 -    Basic harness for testing NIST problems.
++    Added CeresConfig.cmake based on this example:
++        https://projects.kde.org/projects/kde/kdeexamples/repository/revisions/master/show/buildsystem/HowToInstallALibrary
+     
 -    Change-Id: I5baaa24dbf0506ceedf4a9be4ed17c84974d71a1
++    Change-Id: I130cac5d43d9fbbf359abc04d3691e25c4e2bb63
 -commit 98bf14d2b95386c2c4a6c29154637943dae4c36c
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 30 10:26:44 2012 -0700
++commit 015d57f173fab7ea040ee01474101e208ff72be6
++Author: Pablo Speciale <pablo.speciale@gmail.com>
++Date:   Tue Mar 19 14:05:14 2013 -0700
 -    Miscellaneous fixes.
++    Avoiding the Warning: "deprecated conversion from string constant to char*"
+     
 -    Change-Id: I521e11f2d20bf24960bbc6b5dab4ec8bb1503d23
++    Change-Id: Ifa47f9b0724f79c5c695828628c89818ddefd844
 -commit 1e3cbd9a4442cdd8fda43a7fb452f19dac8c74af
 -Author: Petter Strandmark <strandmark@google.com>
 -Date:   Wed Aug 29 09:39:56 2012 -0700
++commit c51b11c1046366035e7da95e4d8a78100ef3f153
++Author: Pablo Speciale <pablo.speciale@gmail.com>
++Date:   Tue Mar 12 00:56:56 2013 -0700
 -    Caching the symbolic Cholesky factorization when using CXSparse
++    Sphinx and CMake, based on this example:
++       http://ericscottbarr.com/blog/2012/03/sphinx-and-cmake-beautiful-documentation-for-c-projects/
+     
 -    Average factorization times for bundle adjustment test problem:
 -    SuiteSparse: 0.2794 s.
 -    CXSparse: 0.4039 s.
 -    CXSparse cached: 0.2399 s.
++    The 'docs/CMakeLists.txt' file was deleted in this commit: 0abfb8f46f534b05413bb4d64b960d6fd0a9befb
+     
 -    CXSparse will still be slower, though, because it has to compute
 -    the transpose and J^T * J.
++    Thanks to Arnaud Gelas, he has passed some links:
++       https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMake/FindSphinx.cmake
++       https://github.com/InsightSoftwareConsortium/ITKExamples/blob/master/CMakeLists.txt#L120-L154
+     
 -    Change-Id: If9cdaa3dd520bee84b56e5fd4953b56a93db6bde
++    Change-Id: Ic65e7f8ec5280d1e71a897a144417a21761c5553
 -commit 8b64140878ccd1e183d3715c38942a81fdecefde
++commit 793a339335d8d52279efb49bcd704d196646efb5
+ Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Wed Aug 29 05:41:22 2012 -0700
++Date:   Wed Mar 13 12:14:00 2013 -0700
 -    Documentation update
++    Make Android.mk play better with the external consraints
+     
 -    Change-Id: I271a0422e7f6f42bcfd1dc6b5dc10c7a18f6a179
++    Change-Id: Ia0a1037d97c032a4ba1a9acbf4e04c192d12ee61
 -commit a5353acd85a9fd19370b3d74035d87b0f0bac230
 -Author: Petter Strandmark <petter.strandmark@gmail.com>
 -Date:   Tue Aug 28 18:16:41 2012 -0700
++commit 700d50d8074f0273b305fe6d9f795f1dcb988048
++Author: Sameer Agarwal <sameeragarwal@google.com>
++Date:   Tue Mar 12 16:12:42 2013 -0700
 -    Adding gflags include to test_util.cc
 -    
 -    test_util seems to need gflags.
++    Lint cleanup from William Rucklidge
+     
 -    Change-Id: I0c4757960f8ac69ad599c138aea58e3c88a4ea28
++    Change-Id: Iacbf77246109f687708696eee7fb6144d23e7ec5
 -commit 87ca1b2ba28ec512752bbcf5fc994ce1434eb765
 -Author: Petter Strandmark <petter.strandmark@gmail.com>
 -Date:   Tue Aug 28 18:05:20 2012 -0700
++commit 8140f0fc979f5728f37cfb68362f31e7e37b46bb
++Author: Sameer Agarwal <sameeragarwal@google.com>
++Date:   Tue Mar 12 09:45:08 2013 -0700
 -    Changing random.h to use cstdlib for Windows compability.
++    Modularize the build.
+     
 -    As discussed with Sameer today.
++    1. Add -DLINE_SEARCH_MINIMIZER to CMake to make the line search
++       minimizer optional.
++    2. Better handling of -DSUITESPARSE/-DCXSPARSE in top level cmake
++       file.
++    3. Disable code which will never be used if SuiteSparse and/or
++       CXSparse is not available.
++    4. Update build docs.
++    5. Update jni/Android.mk
++    6. Minor lint cleanup from William Rucklidge.
+     
 -    Change-Id: If3d0284830c6591c71cc77b8400cafb45c0da61f
++    Change-Id: If60460a858000df82faed7a6bb056dd2bfdde562
 -commit aeb00a07323808a0a1816e733ad18a87d5109ea3
 -Author: Petter Strandmark <strandmark@google.com>
 -Date:   Mon Aug 27 22:22:57 2012 -0700
++commit c59c1e44727c62d43523b672c1c132865cd25784
++Author: Sameer Agarwal <sameeragarwal@google.com>
++Date:   Mon Mar 11 17:28:38 2013 -0700
 -    Removing gomp for Visual Studio
++    Propagate ifdefs correctly to improve build efficiency.
+     
 -    Linking currently fails in Visual Studio due to a missing library
 -    "gomp.lib". This is not needed in Visual Studio. OpenMP works
 -    without it.
++    With -DRESTRICT_SCHUR_SPECIALIZATIONS, now the various
++    specializations are empty, decreasing build time and
++    reducing the size of the static library.
+     
 -    Change-Id: I39e204a8dd4f1b7425df7d4b222d86a8bb961432
++    Change-Id: I8ec431279741a9a83516a4167c54a364c4608143
 -commit 6f362464ba99b800494d2f15c27768a342ddaa68
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Tue Aug 28 01:03:38 2012 +0200
++commit 32874b861fc54b33aa4272e8c81bb001aa1e1e60
++Author: Yuliy Schwartzburg <syx818@gmail.com>
++Date:   Fri Mar 8 11:30:44 2013 +0100
 -    Add some tests for DoglegStrategy.
 -    
 -    Not necessarily a complete set.
++    Fix CMake "LIB_SUFFIX" for non-linux installations
+     
 -    Change-Id: I14eb3a38c6fe976c8212f3934655411b6d1e0aa4
++    Change-Id: Ieb8a2825a4378b388149e7934ecc7b96ba5a29fa
 -commit 122cf836a6dc9726489ce2fbecc6143bddc1caaf
++commit 58b8c68f29c2c15edbc5f77102796df661020312
+ Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 24 16:28:27 2012 -0700
++Date:   Sat Mar 9 17:17:43 2013 -0800
 -    Documentation update.
++    Clean up rotation.h
+     
 -    Change-Id: I0a3c5ae4bc981a8f5bdd5a8905f923dc5f09a024
++    Change-Id: I3370c9883728cda068c9650a2c2a50641fd8299c
 -commit 69081719f73da8de2935774a42d237837a91952a
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Mon Aug 27 13:28:56 2012 -0700
++commit 020d8e1e48f341f3b990ac449998d36aaca2771f
++Author: Sameer Agarwal <sameeragarwal@google.com>
++Date:   Wed Mar 6 16:19:26 2013 -0800
 -    Remove unnecessary overload for hash<>
 -    
 -    The overload for pointers in hash tables was applied in normal
 -    usage of schur_ordering.cc. However, the tests did not include the
 -    overload since they only included collections_port.h. As a result,
 -    the routines in schur_ordering.cc were using a different hash
 -    function than that inside the tests.
++    Better error reporting in the modeling API.
+     
 -    The fix is to remove the specialization. If this breaks one of the
 -    compiler configurations, we will find a workaround at that time.
++    More informative error when user passes an
++    unknown parameter block to Problem methods.
+     
 -    Change-Id: Idbf60415d5e2aec0c865b514ad0c577d21b91405
++    Change-Id: I517360e4b0b55814904ca3e664877d76ad3f59e8
 -commit 1762420b6ed76b1c4d30b913b2cac1927b666534
++commit 5e7ce8a950cf5794c63817827ce66a3a4e66e7b6
+ Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Wed Aug 22 10:01:31 2012 -0700
++Date:   Wed Mar 6 11:38:41 2013 -0800
 -    Update changelog.
++    Fix Problem::Evaluate documentation
+     
 -    Change-Id: Idf5af69d5a9dbe35f58e30a8afcbfcd29bb7ebfe
++    Change-Id: I8c70a24743cff2d9cface99ef0f5d34c78f769c6
 -commit 976ab7aca908309b8282cb40bc080ca859136854
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Thu Aug 23 18:21:36 2012 -0700
++commit 0a4f5f8f7428148f21183e743d091d2079406604
++Author: Taylor Braun-Jones <taylor@braun-jones.org>
++Date:   Wed Mar 6 00:00:32 2013 -0500
 -    Remove Google-era vestigial unit test.
++    Fix operator() signature in several sections of the documentation
+     
 -    Change-Id: Ia7a295a5c759a17c1675a3055d287d3e40e9e0fe
++    Change-Id: I73f9d150a738f7b136fbc1f98fc60b0f306bd7f9
 -commit 6ad6257de0e2152ac5e77dc003758de45187d6ea
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Wed Aug 22 11:10:31 2012 -0700
++commit 2c648dbc43025927301684fc82d95ccf6b6c21bc
++Author: Sameer Agarwal <sameeragarwal@google.com>
++Date:   Tue Mar 5 15:20:15 2013 -0800
 -    Add a workaround for an Android NDK compiler bug.
++    Make examples independent of ceres internals.
+     
 -    On certain NDK build configurations, one of the innermost
 -    parts of the Schur eliminator would get compiled
 -    incorrectly. The compiler changed a -= to a +=.
++    Change-Id: I6b6913e067a86fea713646218c8da1439d349d74
++
 +commit e7148795c3f2ce1f6625a7c81545707a6cbde3eb
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Mon Mar 4 10:17:30 2013 -0800
 +
 +    Fix a memory leak in CXSparse::SolveCholesky.
      
 -    The normal Ceres unit tests caught the problem; however,
 -    since it is not possible to build the tests with the NDK
 -    (only with the standalone toolchain) this was difficult to
 -    track down. Finding the issue involved pasting the schur
 -    eliminator unit test inside of solver_impl.cc and other such
 -    hacks.
 +    Thanks to Alexander Mordvintsev for reporting this.
      
 -    Change-Id: Ie91bb545d74fe39f0c8cbd1a6eb69ee4d8b25fb2
 +    Change-Id: I5c6be4d3d28f062e83a1ad41cb8089c19362a005
  
 -commit aecb2dc92b4aa7f3bf77a1ac918e62953602392b
 +commit 480f9b8551c02c429bc027197f3d868c5cc522c9
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Wed Aug 22 10:08:17 2012 -0700
 +Date:   Sun Mar 3 20:15:22 2013 -0800
  
 -    Fix relative path bug in bibtex call.
 +    Add gerrit instructions to the docs.
      
 -    Change-Id: I0d31786564320a6831259bcdf4c75a6b665c43ad
 +    Change-Id: Ic98f20273f3ccbaeb8b4ca00c4ce0042a0d262f8
  
 -commit 1e2892009e591804df6286caebd5c960e7e3b099
 +commit 7c60b5c2c6170f0f81a29dbaa2ca7d8031db843b
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Tue Aug 21 18:00:54 2012 -0700
 +Date:   Sun Mar 3 18:28:02 2013 -0800
  
 -    Update Summary::FullReport to report dogleg type.
 +    version history update
      
 -    Change-Id: I0b4be8d7486c1c4b36b299693b3fe8b0d3426537
 +    Change-Id: Ia92caeb0f6659667ce1e56eefd0e3c87b3f6e538
  
 -commit 295ade1122a86b83e1ea605d5ca394f315874717
 +commit a363a7b69c7b97e17ad671ba1aee30f201eafdd1
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Wed Aug 22 06:51:22 2012 -0700
 +Date:   Sun Mar 3 18:06:00 2013 -0800
  
 -    Fix Eigen3 Row/Column Major storage issue.
 +    Multithread DENSE_SCHUR
      
 -    Eigen3 does not allow column vectors to be stored in row-major
 -    format. NumericDiffCostFunction by default stores its Jacobian
 -    matrices in row-major format. This works fine if the residual
 -    contains more than one variable. But if the residual block
 -    depends on one variable and has more than one residuals, the
 -    resulting Jacobian matrix is a column matrix in row-major format
 -    resulting in a compile time error.
 +    Replace the global lock in BlockRandomAccessDenseMatrix
 +    with a per cell lock.
      
 -    The fix is to check the template parameters and switch to column-major
 -    storage as needed.
 +    Change-Id: Iddbe38616157b6e0d3770eede3335a056c3ba18c
 +
 +commit 31730ef55df802d1e251edab3bac3c0cdcb30647
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Thu Feb 28 11:20:28 2013 -0800
 +
 +    DenseSparseMatrix is now column-major.
 +    
 +    1. Introduce new typdefs in eigen.h to allow for column
 +       major matrices.
 +    
 +    2. Clean up old unused typedefs, and the aligned typedefs
 +       since they do not actually add any real performance.
 +    
 +    3. Made eigen.h conform to the google style guide by removing
 +       the using directives. They were polluting the ceres namespace.
      
 -    Thanks to Lena Gieseke for reporting this.
 +    4. Made the template specialization generator work again.
      
 -    Change-Id: Icc51c5b38e1f3609e0e1ecb3c4e4a02aecd72c3b
 +    Change-Id: Ic2268c784534b737ebd6e1a043e2a327adaeca37
  
 -commit 9ad27e8e9fb1bbd2054e2f6ae37623e01428f1c0
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Tue Aug 21 09:56:30 2012 +0200
 +commit f8e43f7f2724c5413015e1f113ce860ee8b30428
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Wed Feb 27 08:55:20 2013 -0800
  
 -    Add one uninstall target to remove all installed files
 +    version history update
      
 -    Change-Id: Ifcf89a6c27b25f28403d95a50e29c093a525298f
 +    Change-Id: Ibd412a9e5beac3b3ac3e15b26fb11aa061956095
  
 -commit 0c3a748ee49e04fe334f8f5a433649d18003d550
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Tue Aug 21 14:44:59 2012 +0200
 +commit fef82b3a7af1e44f18f5343601fb19a4dd6f89ad
 +Author: Alex Stewart <alexs.mac@gmail.com>
 +Date:   Wed Feb 27 10:44:12 2013 +0000
  
 -    Allow equal lower and upper bound for diagonal scaling.
 +    Bugfix - commenting-out unused member which results in build error on OS X with latest Xcode.
      
 -    This way, setting the lower and upper bound both to 1.0, one can disable
 -    the automatic trust region scaling.
 +    - Build error due to -Werror,-Wunused-private-field clang args.
 +    - Raised with gtest group (as it also occurs with latest gtest:master but for a different
 +      variable) with patch, but they don't want to fix for compatibility with legacy compilers/OS
 +      see here: https://groups.google.com/forum/?fromgroups=#!topic/googletestframework/S1KLl2jkzws
      
 -    Change-Id: Ifa317a6911b813a89c1cf7fdfde25af603705319
 +    Change-Id: I99984bcd9d07f6eb0e3fac58e27ddf0ac9e54265
  
 -commit 3d644b76adefac6475b91dc53c3ae5e01c4f4d66
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Thu Aug 16 17:33:21 2012 +0200
 +commit 0bc3540b66cf9de4d4a317c6a760849aa66d414e
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Wed Feb 27 08:46:48 2013 -0800
  
 -    Install headers, libraries and pdf
 -    
 -    Headers are installed in ${CMAKE_INSTALL_PREFIX}/include/ceres
 -    Libraries are installed in ${CMAKE_INSTALL_PREFIX}/lib
 -    pdf is installed in ${CMAKE_INSTALL_PREFIX}/share/ceres/docs
 +    Version history update
      
 -    Change-Id: Ic175f2c2f5fa86820a1e8c64c2ed171f4a302a68
 +    Change-Id: I6f79dd87e45bedf4bcf821e7b44f8b9553c39a7b
  
 -commit d2fb5adea4d8c2aeb43c4289c6976798a54d3cf1
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Fri Aug 17 10:11:02 2012 +0200
 +commit b59ac43b9d1122da3d00882efa7c5d6833c06ea7
 +Author: Alex Stewart <alexs.mac@gmail.com>
 +Date:   Wed Feb 27 09:10:19 2013 +0000
  
 -    Configure gerrit hook at CMake time
 +    Issue 83 fix: use correct pthread linker flags with clang.
      
 -    If the source directory is a clone, at CMake time the commit-msg hook gets
 -    downloaded and installed in the right location.
 +    1. -lpthreads was previously added to the CMAKE_CXX_FLAGS which are
 +    not passed to the linker thus linking would fail.
 +    2. Clang would emit a warning about -lpthreads being added to a
 +    build instruction with -c (compile only).
      
 -    Change-Id: I5fee17d050ca22d8b92a49fdcc2a1cd6659f209b
 +    This patch fixes both of these issues by adding -lpthreads to the
 +    linker flags (and removes them from the CXX flags).
 +    
 +    Change-Id: I5e54de3ab7eced177aa31f311926893598af5b56
  
 -commit 73166098fc4b1072adc30321c666188a3909c43c
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Mon Aug 20 15:40:41 2012 +0200
 +commit 6fb1024ed5b197da261f71d1bb02716661da2fff
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Tue Feb 26 22:20:18 2013 -0800
  
 -    Add one CMake option to build the examples.
 +    Fix a small bug in evaluator.h
      
 -    Currently the examples are always built. For external projects, it is useful
 -    not to compile the examples.
 -    
 -    Change-Id: I41d3bde19c7e742818e60f78222d39c43992ca8b
 +    Change-Id: I2c4b8637e0ac8645721109f8b6bb2396ce8bb37b
  
 -commit 86d4f1ba41ef14eb1b6b61a7936af83387b35eb2
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Mon Aug 20 11:52:04 2012 -0700
 +commit 039ff07dd1a02e6c9cff335551f05bfe8269224b
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Tue Feb 26 09:15:39 2013 -0800
  
 -    Add missing return statement.
 +    Evaluate ResidualBlocks without LossFunction if needed.
      
 -    Change-Id: I5eaf718318e27040e3c97e32ee46cf0a11176a37
 +    1. Add the ability to evaluate the problem without loss function.
 +    2. Remove static Evaluator::Evaluate
 +    3. Refactor the common code from problem_test.cc and
 +       evaluator_test.cc into evaluator_test_utils.cc
 +    
 +    Change-Id: I1aa841580afe91d288fbb65288b0ffdd1e43e827
  
 -commit 51eb229da34187a4e8ce73ed9cc0e731998bb2be
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Mon Aug 20 11:46:12 2012 -0700
 +commit c3fd3b960e489348d5b2c8b8f0167760e52ecbd9
 +Author: Taylor Braun-Jones <taylor@braun-jones.org>
 +Date:   Tue Feb 26 00:30:35 2013 -0500
  
 -    Add Program::ToString() to aid debugging.
 +    Only use cmake28 macro for RHEL6
 +    
 +    This makes it possible to use the same spec to build on Fedora. It drops any
 +    chance of building on RHEL5, but I doubt that was possible anyway.
      
 -    Change-Id: I0ab37ed2fe0947ca87a152919d4e7dc9b56dedc6
 +    Change-Id: Ia956eb6416504e520962ec2f617e03b40ca18203
  
 -commit bcc7100635e2047dc2b77df19a4ded8a6ab4d4b9
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Mon Aug 20 11:45:04 2012 -0700
 +commit b73148b9f38fe41032e696436566b78043a368db
 +Author: Taylor Braun-Jones <taylor@braun-jones.org>
 +Date:   Mon Feb 25 02:34:00 2013 -0500
  
 -    Ignore minted.sty.
 +    Remove -Wno-return-type-c-linkage option when using gcc
 +    
 +    Only use this option when compiling with CLang which supports it.
      
 -    Change-Id: I2467a6f801812b9007b51bf14b00757f026e4322
 +    Change-Id: I8555c16e82d61302f6a43672d0d63e5d4800c6b6
  
 -commit 9705a736dd3d6fbead0d8a6ff77102c69bbcdc08
 +commit ba9442160dabf612a1dc51baf098937459b4b5ca
  Author: Keir Mierle <mierle@gmail.com>
 -Date:   Mon Aug 20 11:24:05 2012 -0700
 +Date:   Mon Feb 25 12:46:44 2013 -0800
  
 -    Add ParameterBlock::ToString() to aid debugging.
 +    Add the number of effective parameters to the final report.
      
 -    Change-Id: Id3f5cb27b855c536dd65a986f345bd8eb2799dfa
 -
 -commit 0c714a70e6123ceb68e5cfcd3cfbee0d09deb1db
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Mon Aug 20 11:18:16 2012 -0700
 -
 -    Fix blanks before private in loss_function.h
 +    Here is an example report, obtained by running:
      
 -    Change-Id: I068bed6431bc7c9b7958af391655df61499000b2
 -
 -commit 51cf7cbe3bac45c6807c2703a2fc3175d76a1b47
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Mon Aug 20 20:10:20 2012 +0200
 -
 -    Add the two-dimensional subspace search to DoglegStrategy
 +      bin/Debug/bundle_adjuster \
 +      --input=../ceres-solver/data/problem-16-22106-pre.txt \
 +      --linear_solver=iterative_schur \
 +      --num_iterations=1 \
 +      --alsologtostderr \
 +      --use_local_parameterization \
 +      --use_quaternions
 +    
 +    Note that effective parameters is less than parameters by 16, which is the
 +    number of cameras. In this case the local parameterization has a 3 dimensional
 +    tangent space for the 4-dimensional quaternions.
 +    
 +    Ceres Solver Report
 +    -------------------
 +                                         Original                  Reduced
 +    Parameter blocks                        22138                    22138
 +    Parameters                              66478                    66478
 +    Effective parameters                    66462                    66462
 +    Residual blocks                         83718                    83718
 +    Residual                               167436                   167436
 +    
 +    Minimizer                        TRUST_REGION
 +    Trust Region Strategy     LEVENBERG_MARQUARDT
 +    
 +                                            Given                     Used
 +    Linear solver                 ITERATIVE_SCHUR          ITERATIVE_SCHUR
 +    Preconditioner                         JACOBI                   JACOBI
 +    Threads:                                    1                        1
 +    Linear solver threads                       1                        1
 +    Linear solver ordering              AUTOMATIC                22106, 32
 +    
 +    Cost:
 +    Initial                          4.185660e+06
 +    Final                            7.221647e+04
 +    Change                           4.113443e+06
 +    
 +    Number of iterations:
 +    Successful                                  1
 +    Unsuccessful                                0
 +    Total                                       1
 +    
 +    Time (in seconds):
 +    Preprocessor                            0.697
 +    
 +      Residual Evaluations                  0.063
 +      Jacobian Evaluations                 27.608
 +      Linear Solver                        13.360
 +    Minimizer                              43.973
 +    
 +    Postprocessor                           0.004
 +    Total                                  44.756
      
 -    Change-Id: I5163744c100cdf07dd93343d0734ffe0e80364f3
 +    Termination:                   NO_CONVERGENCE
 +    
 +    Change-Id: I6b6b8ac24f71bd187e67d95651290917642be74f
  
 -commit ad1f7b772e559a911ac3a3b078b0aee1836fe785
 +commit 36dc14ddf2fd53238c2ce21f172aa1989b31c0fd
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Mon Aug 20 11:10:34 2012 -0700
 +Date:   Mon Feb 25 10:33:10 2013 -0800
  
 -    Add ArcTanLoss, TolerantLoss and ComposedLossFunction.
 -    
 -    Based on work by James Roseborough.
 +    Fix a clang warning
      
 -    Change-Id: Idc4e0b099028f67702bfc7fe3e43dbd96b6f9256
 +    Change-Id: I5ef32c6329f1f75efb30b16519b8de146a8339fa
  
 -commit 05292bf8fc5208b86b4a13544615b584f6efa936
 +commit 931c309b2734329ec6e5f0b88ce4a0b488ac47e5
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Mon Aug 20 07:40:45 2012 -0700
 +Date:   Mon Feb 25 09:46:21 2013 -0800
  
 -    Add a TrustRegionStrategy::Summary object.
 +    Cleanup based on comments by William Rucklidge
      
 -    Change-Id: I7caee35a3408ee4a0ec16ba407410d822929340d
 +    Change-Id: If269ba8e388965a8ea32260fd6f17a133a19ab9b
  
 -commit b12b906c4d21c3949f0dce62c4c0d083c8edecf1
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Wed Aug 15 16:27:38 2012 +0200
 +commit df36218c953e05d665df2cc96a6d7625e2307d97
 +Author: Taylor Braun-Jones <taylor@braun-jones.org>
 +Date:   Fri Feb 15 18:28:11 2013 -0500
  
 -    Add one option to generate the PDF from CMake at build time
 +    Add support for the CMake "LIB_SUFFIX" convention
      
 -    Make sure pygmentize is installed
 +    Allows `make install` to work correctly on e.g. 64-bit systems where the
 +    native libraries are installed to /usr/lib64
      
 -    Change-Id: I068ba45c33a8e96acc906a464b12d10d58b3e231
 +    Change-Id: I71b4fae7b459c003cb5fac981278c668f2e29779
  
 -commit b9f15a59361c609ffc4a328aea9be3d265b5da81
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Sat Aug 18 13:06:19 2012 -0700
 +commit 70701745b85fef7eeba2c978ae849fd48927699c
 +Author: Taylor Braun-Jones <taylor@braun-jones.org>
 +Date:   Fri Feb 15 19:09:48 2013 -0500
  
 -    Add a dense Cholesky factorization based linear solver.
 +    Add RPM .spec file
      
 -    For problems with a small number of variables, but a large
 -    number of residuals, it is sometimes beneficial to use the
 -    Cholesky factorization on the normal equations, instead of
 -    the dense QR factorization of the Jacobian, even though it
 -    is numerically the better thing to do.
 +    Tested on RHEL6.1 (with epel repository for dependencies).
      
 -    Change-Id: I3506b006195754018deec964e6e190b7e8c9ac8f
 +    make_release checks that that the version string in the .spec file is in
 +    sync with the rest of the project and reminds the user to bump the
 +    release string if necessary and to build/upload the RPM package.
 +    
 +    Change-Id: I5f454f2a7301d1e0e120cb3c0e13a68d03bca917
  
 -commit b3fa009435acf476cd373052e62988f6437970b1
 -Author: Arnaud Gelas <arnaudgelas@gmail.com>
 -Date:   Fri Aug 17 10:31:41 2012 +0200
 +commit d2a5195b512164fec286c6a52b40d7766977caa3
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Sun Feb 24 15:09:17 2013 -0800
  
 -    Set CMAKE_*_OUTPUT_DIRECTORY
 -    
 -    Gather
 -     * all executables in ${CMAKE_BINARY_DIR}/bin
 -     * all libraries (static and dynamic) in ${CMAKE_BINARY_DIR}/lib
 +    Version history update.
      
 -    Change-Id: Ibc2fa1adfb6f0aea65d66d570259b79546bf3b07
 +    Change-Id: I477ec05a78ca4cd735a525253c9b6adfa3bddea7
  
 -commit 1b8a4d5d11671ed83cf6077e363dd95333f08ef8
 +commit 2160c5b757c44206c6face6ca62d381f1db7a291
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 17 16:49:11 2012 -0700
 +Date:   Sun Feb 24 14:15:45 2013 -0800
  
 -    Fix a minor bug in detect_structure logging.
 +    Minor release script fixes.
      
 -    Change-Id: I117f7745e4c67595b3ff9244cde82b5b5b34ee4b
 +    Change-Id: Ifd0a7f4f584c85d4d9574eca46094b372a8d7aff
  
 -commit 31c1e784ab2cb9294c6e05414cf06aae2b3766de
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Fri Aug 17 16:16:32 2012 -0700
 +commit b53c9667f508c125b8aa833e7a063fa44ef8a98e
 +Author: Sergey Sharybin <sergey.vfx@gmail.com>
 +Date:   Mon Feb 25 01:14:26 2013 +0600
  
 -    Minor cleanups.
 +    Solve No Previous Prototype GCC warning
 +    
 +    In some cases there were missing includes of own
 +    header files from implementation files.
 +    
 +    In other cases moved function which are only used
 +    within single file into an anonymous namespace.
      
 -    Change-Id: Ida4866997deeaa1bc2cebd6b69313a05ac82e457
 +    Change-Id: I2c6b411bcfbc521e2a5f21265dc8e009a548b1c8
  
 -commit e83f7879a8b21c6976e116958caf35bcdcf41cb0
 -Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 17 15:34:42 2012 -0700
 +commit 267ccc45a3e875bf87832a8ad615be690b4926d3
 +Author: Sergey Sharybin <sergey.vfx@gmail.com>
 +Date:   Mon Feb 25 01:04:16 2013 +0600
  
 -    Fix SuiteSparse3 UFConfig.h detection really.
 +    Fix for MinGW build on Windows
 +    
 +    GG_LONGLONG and GG_ULONGLONG shall use LL and ULL suffixes,
 +    since MinGW is actuall a GCC compiler.
      
 -    Change-Id: Id187102e755b7d778dff4363f22f9a4697ed12dd
 +    Solved by checking whether compilation happens with MinGW
 +    or not using standard MinGW's __MINGW32__ and __MINGW64__
 +    definitions.
 +    
 +    Change-Id: I789b34f6342a56ba42f4b280f7242700022ab7a1
  
 -commit 96f25dc57658d296ee6b6633818b4f1e51d7d587
 +commit 509f68cfe3fd13b794c4e67ff38c761407c858cf
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 17 15:34:42 2012 -0700
 +Date:   Wed Feb 20 01:39:03 2013 -0800
  
 -    Fix SuiteSparse3 UFConfig.h detection.
 +    Problem::Evaluate implementation.
 +    
 +    1. Add Problem::Evaluate and tests.
 +    2. Remove Solver::Summary::initial/final_*
 +    3. Remove Solver::Options::return_* members.
 +    4. Various cpplint cleanups.
      
 -    Change-Id: Ia59aefdb0ad7f713f76ed79692f2db4fa2821e5b
 +    Change-Id: I4266de53489896f72d9c6798c5efde6748d68a47
  
 -commit c497bd6cd9aa944f518aa491d3bc645851ff9594
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Fri Aug 17 14:40:13 2012 +0200
 +commit d4a0bf86d688d1b68e00ff302858de5a4e0d9727
 +Author: Keir Mierle <mierle@gmail.com>
 +Date:   Sun Feb 24 10:35:44 2013 -0800
  
 -    Add UFconfig and/or SuiteSparse_config test to CMakeLists.txt
 +    Fix threading build on Windows.
 +    
 +    On Windows, including the "windows.h" header defines an enormous number of
 +    symbols; some of which are macros with common names. In particular, "ERROR" and
 +    "min" and "max" get defined. This causes clashes when user code references
 +    these names in a context other than the intended use in windows.h.
 +    
 +    To deal with this, the Microsoft engineers added the ability to control the
 +    definition of these symbols by adding extra defines. In particular, including
 +    windows.h in the following way
 +    
 +      #define NOGDI
 +      #define NOMINMAX
      
 -    SuiteSparse 4 requires linking to libsuitesparseconfig.a.
 -    Both SuiteSparse 3 and SuiteSparse 4 require an additional header
 -    (either UFconfig.h or SuiteSparse_config.h) that is not found if it is
 -    in a separate path. Therefore, add explicit checks.
 +    will reduce the number of macros defined. This way they will not conflict with
 +    other uses in Ceres. For example, numeric_limits<double>::max() is impossible
 +    to call without defining NOMINMAX.
      
 -    Change-Id: I699902b5db4f1b7f17134b5a54f9aa681445e294
 +    Change-Id: I166f5d3bb6dc0e2e4b2ebf800fb19e49206f7874
  
 -commit 383c04f4236d92801c7c674892814362dedf7ad6
 +commit beb4505311011130a7e54632137b0fbb5824cc9b
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Fri Aug 17 10:14:04 2012 -0700
 +Date:   Fri Feb 22 13:37:01 2013 -0800
  
 -    Fix QuaternionToAngleAxis to ensure rotations are between -pi and pi.
 +    Minor fixes
      
 -    Thanks to Guoxuan Zhang for reporting this.
 +    Based on William Rucklidge's review, including
 +    a nasty bug in parameter block removal.
      
 -    Change-Id: I2831ca3a04d5dc6467849c290461adbe23faaea3
 +    Change-Id: I3a692e589f600ff560ecae9fa85bb0b76063d403
  
 -commit dd2b17d7dd9750801ba4720bdece2062e59b7ae3
 +commit 9a88bd7c4b40e2a1e0cd9b0dc09a3517c467e04e
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 16 19:34:57 2012 -0700
 +Date:   Tue Feb 19 13:09:12 2013 -0800
  
 -    CERES_DONT_HAVE_PROTOCOL_BUFFERS -> CERES_NO_PROTOCOL_BUFFERS.
 +    Minor bug fixes
      
 -    Change-Id: I6c9f50e4c006faf4e75a8f417455db18357f3187
 +    Change-Id: I94e4521adf76a6c77db954c4a8955168e9d37b55
  
 -commit 8b4cb7aa2c74a0da62c638b2023566aa242af995
 +commit 956ed7e8f2054623615e6ae3601055d613897f26
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 16 19:26:55 2012 -0700
 +Date:   Tue Feb 19 07:06:15 2013 -0800
  
 -    Fix sparse linear algebra library logging in Summary::FullReport.
 +    Various minor fixes.
      
 -    Change-Id: Id2c902dc86c00954fde7749c7b4a67dd94215a31
 +    1. Unused variable warnings and fixes.
 +    2. Minor documentation update.
 +    
 +    Change-Id: I815588a5806df1030a7c8750f4fb594c503f8998
  
 -commit 47d26bcd3b38b5ff53b34768c33b499d47b26bd0
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Thu Aug 16 00:23:38 2012 +0200
 +commit 3e2c4ef9ad35e94198f4f3367b99fd91e26996a1
 +Author: Keir Mierle <mierle@gmail.com>
 +Date:   Sun Feb 17 12:37:55 2013 -0800
  
 -    Do not implicitly negate the step in the TrustRegionMinimizer.
 +    Add adapters for column/row-major matrices to rotation.h
      
 -    In the TrustRegionMinimizer, the step is currently implicitly negated.
 -    This is done so that the linearized residual is |r - J*step|^2, which
 -    corresponds to J*step = r, so neither J nor r have to be modified.
 -    However, it leads to the rather unintuitive situation that the strategy
 -    returns a step in positive gradient direction, which you would expect to
 -    increase the function value. One way is to rename the "step" parameter in
 -    the strategy to "negative_step" and document it.
 -    This patch instead moves the negation inside the strategy, just around
 -    the linear solver call, so that it is done in a local context and easier
 -    to document.
 +    This patch introduces a matrix wrapper (MatrixAdapter) that allows to
 +    transparently pass pointers to row-major or column-major matrices
 +    to the conversion functions.
      
 -    Change-Id: Idb258149a01f61c64e22128ea221c5a30cd89c89
 +    Change-Id: I7f1683a8722088cffcc542f593ce7eb46fca109b
  
 -commit 51da590c8457e6664f76fe9813425a0c71351497
 -Author: Markus Moll <markus.moll@esat.kuleuven.be>
 -Date:   Fri Aug 17 12:56:09 2012 +0200
 +commit 04938efe4bedec112083c5ceb227ba004f96bd01
 +Author: Keir Mierle <mierle@gmail.com>
 +Date:   Sun Feb 17 12:37:55 2013 -0800
  
 -    Remove tmp file
 +    Add support for removing parameter and residual blocks.
 +    
 +    This adds support for removing parameter and residual blocks.
 +    There are two modes of operation: in the first, removals of
 +    paremeter blocks are expensive, since each remove requires
 +    scanning all residual blocks to find ones that depend on the
 +    removed parameter. In the other, extra memory is sacrificed to
 +    maintain a list of the residuals a parameter block depends on,
 +    removing the need to scan. In both cases, removing residual blocks
 +    is fast.
 +    
 +    As a caveat, any removals destroys the ordering of the parameters,
 +    so the residuals or jacobian returned from Solver::Solve() is
 +    meaningless. There is some debate on the best way to handle this;
 +    the details remain for a future change.
      
 -    Change-Id: I07496fafae7b0c5c12cc26ae336e0db3b5592735
 +    This also adds some overhead, even in the case that fast removals
 +    are not requested:
 +    
 +    - 1 int32 to each residual, to track its position in the program.
 +    - 1 pointer to each parameter, to store the dependent residuals.
 +    
 +    Change-Id: I71dcac8656679329a15ee7fc12c0df07030c12af
  
 -commit 7006a1f2b1701b8d89b8d1525fc0101943802221
 +commit fa21df8cd969bb257b87c9ef7c0147d8d5ea8725
  Author: Sameer Agarwal <sameeragarwal@google.com>
 -Date:   Thu Aug 16 18:04:22 2012 -0700
 +Date:   Mon Feb 18 08:48:52 2013 -0800
  
 -    Correct example code in Powell's function example.
 +    Add script for building documentation.
      
 -    Thanks to Petter Strandmark for pointing this out.
 +    Update make_release
      
 -    Change-Id: I967632235dccdb481396e94904bb911c9a1efe1e
 -
 -commit 57a44b27bc6fc95b4e70fdc25c25c9925a2072a0
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Thu Aug 16 17:04:50 2012 -0700
 -
 -    Remove unnecessary flags in NDK build.
 +    Minor documentation fixes.
      
 -    Change-Id: Ib5b4d0b7f2d898671252734978c789b8171d96a8
 +    Change-Id: I1248ec3f58be66b5929aee6f2aa392c15d53ed83
  
 -commit f21bee247251a8b2e836c215a84c4668c31d75cd
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Thu Aug 16 16:27:10 2012 -0700
 +commit 290b975d1d4eba44205bbeb0fa6b3ce8a6fa4a0c
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Sun Feb 17 16:50:37 2013 -0800
  
 -    Fix for fpclassify.h NDK porting work.
 +    Preconditioner refactoring.
 +    
 +    1. Added a Preconditioner interface.
 +    2. SCHUR_JACOBI is now its own class and is independent of
 +    SuiteSparse.
      
 -    Change-Id: I69df1b4caf2941ed96a53e35e43ec54073f84f59
 +    Change-Id: Id912ab19cf3736e61d1b90ddaf5bfba33e877ec4
  
 -commit 8ceb02cb75b66602de44a35e413225386cb21c27
 -Author: Keir Mierle <mierle@gmail.com>
 -Date:   Thu Aug 16 14:23:47 2012 -0700
 +commit d010de543530001fa917501a13ba02879c8ea52f
 +Author: Sameer Agarwal <sameeragarwal@google.com>
 +Date:   Fri Feb 15 14:26:56 2013 -0800
  
 -    Add Android NDK build files.
 -    
 -    This adds a Android.mk build that builds a Ceres static library
 -    suitable for embetting in larger Android applications. This is
 -    useful when needing to build Ceres without GPL'd components, since
 -    the standalone toolchain (needed for the CMake Android build) does
 -    not work with STLPort.
 +    Solver::Summary::FullReport() supports line search now.
      
 -    Change-Id: I8d857237f6f82658741017d161b2e31d9a20e5a7
 +    Change-Id: Ib08d300198b85d9732cfb5785af4235ca4bd5226
- commit fbbea464d1c9575d8224220d3e61f92d93fe9739
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Fri Feb 15 11:25:03 2013 -0800
-     Update documentation.
-     
-     Change-Id: Idb03741fab9facbbbda85d5a82723f0b4c1c6c60
- commit 8e1f83c4c457fb7238eb342eab744c5570b73c4d
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Fri Feb 15 08:35:40 2013 -0800
-     Speed up Problem construction and destruction.
-     
-     Change-Id: I3147b0b60eedf40f8453d5a39ff04a572c445a2f
- commit efb47f39c31f0ef1bb9c015c8c0d114153df6379
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Thu Feb 14 19:44:11 2013 -0800
-     Documentation update
-     
-     Change-Id: I0fec43bff4fe0ea6cd2d2a8b34dac2330a517da0
- commit be418a336cae5672111e0f6989e6d8d6c1fa24a6
- Author: Markus Moll <markus.moll@esat.kuleuven.be>
- Date:   Fri Feb 15 17:19:28 2013 +0100
-     Fix evaluation of initial cost and corresponding test
-     
-     Commit f102a68e411d11b4864e17b69a2d781e9c2692ad seems to have introduced
-     a bug in both solver_impl.cc and solver_impl_test.cc
-     solver_impl_test showed 3 errors, where two were due to ceres NOT
-     failing when the test expected that, and one was due to the initial cost
-     being wrong (-1 instead of 0.5)
-     Ceres now does not attempt to evaluate the initial cost if
-     options.return_initial_xxx is not set. It therefore did not fail in
-     the tests.
-     It also seems that the CERES_EVALUATE macro erroneously always sets
-     final_cost, even when called with 'initial' as argument.
-     
-     Change-Id: Ia3c3eeb476e7023a3f80b201124010d6c67e9824
- commit 974513a41ff1ddc671d3dc6aa09ce708bbe447da
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Tue Feb 12 14:22:40 2013 -0800
-     Bug fix in DynamicAutoDiffCostFunction
-     
-     Add handling of constant parameter blocks.
-     
-     Change-Id: I8b2ea79f47e190604fc4bed27705798240689f71
- commit 3130b3cea4028c71d9ae18b7465d7627f29fef7d
- Author: Keir Mierle <mierle@gmail.com>
- Date:   Mon Feb 11 19:39:29 2013 -0800
-     Add support for dynamic autodiff
-     
-     Change-Id: I17d573696172ab691a9653db99a620e4bc1bd0d0
- commit c58e6dc3ea550302c8151003b17e9bc2a1acc316
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 11 16:41:06 2013 -0800
-     More refined event logging in solver_impl.cc
-     
-     Change-Id: Ie3061c921c006d2600d16185c690f52ccf816f68
- commit f102a68e411d11b4864e17b69a2d781e9c2692ad
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 11 15:08:40 2013 -0800
-     Remove extraneous initial and final evals.
-     
-     Change-Id: I80ed87435f399cbf452c68be7ea1e7139696aa4a
- commit 0593747ee09e21a9c0a2b604d51e21a6cdd21315
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 11 13:57:12 2013 -0800
-     Fix a memory leak in cxsparse.cc
-     
-     Thanks to Alexander Mordvintsev for reporting it.
-     
-     Change-Id: Ia872be42ce80209e46722fc16a928496cf97e256
- commit 0abfb8f46f534b05413bb4d64b960d6fd0a9befb
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 11 13:40:04 2013 -0800
-     Delete the tex documentation.
-     
-     Change-Id: I15c78a8b33c5fd94941238814ac023a8fb251a20
- commit 085cd4a6641c404334d17e5ea38f9e5b68a06ba7
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Wed Feb 6 14:31:07 2013 -0800
-     Rewrite of the tutorial.
-     
-     1. Quicker starting point.
-     2. Better discussion of derivatives.
-     3. Better hyperlinking to code and class documentation.
-     4. New robust estimation example.
-     5. Better naming of example code.
-     6. Removed dependency on gflags in all the core examples covered
-        in the tutorial.
-     
-     Change-Id: Ibf3c7fe946fa2b4d22f8916a9366df267d34ca26
- commit c0fdc9753909fc37fed2cb5e0fcc02fc65789d68
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Wed Feb 6 14:31:07 2013 -0800
-     Update nist.cc to better evaluate results.
-     
-     Ceres beats Minpack and HBN handily.
-     
-     Change-Id: I7df8a47b753202ed0b53ab128ce48466bf9f8083
- commit d91b671798125fd4889914d92a29cf0f7a5fef21
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Wed Feb 6 01:08:40 2013 -0800
-     More small changes
-     More small changes to the docs.
-     
-     1. Better landing page.
-     2. Minor tweaks to the side bar.
-     3. Reference to more example code.
-     4. Local MathJax references.
-     
-     Change-Id: I39b9436dc2803732a875bbbee7f15802c4934031
- commit 42a84b87fa5cc34551244a3b2b6a3e1f13a29514
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Fri Feb 1 12:22:53 2013 -0800
-     Expand reporting of timing information.
-     
-     1. Add an ExecutionSummary object to record execution
-        information about Ceres objects.
-     2. Add an EventLogger object to log events in a function call.
-     3. Add a ScopedExecutionTimer object to log times in ExecutionSummary.
-     4. Instrument ProgramEvaluator and all the linear solvers
-        to report their timing statistics.
-     5. Connect the timing statistics to Summary::FullReport.
-     6. Add high precision timer on unix systems using
-        gettimeofday() call.
-     7. Various minor clean ups all around.
-     
-     Change-Id: I5e09804b730b09535484124be7dbc1c58eccd1d4
- commit 08c891fcb6ea1bf66e6d4619273765a644605dfc
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 4 20:18:58 2013 -0800
-     Various small changes.
-     
-     1. Compact build instructions.
-     2. Lots of small edits by Simon Fuhrmann.
-     
-     Change-Id: I8c0c67922021041dcf7f4ecdb6c6e6dd2e2fd7e5
- commit e2e857ad6be322e9cf750d4b11ccf10800e57d96
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 4 19:40:45 2013 -0800
-     Sidebar has global table of contents.
-     
-     Change-Id: I7fe9053868a4660b0db8d7607ee618fc30ddaefd
- commit b9182147d96f865673c2756ced4cbb127ca082a3
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Mon Feb 4 17:55:25 2013 -0800
-     Change the theme to be closer to ReadTheDocs.org
-     
-     Change-Id: I61a76f5b5e5c292b54fdf51b66940ce80bd1cd5f
- commit 3d87b72c895835bbfc10965d50dc96608632114d
- Author: Sameer Agarwal <sameeragarwal@google.com>
- Date:   Sat Feb 2 00:49:31 2013 -0800
-     Convert documentation from LaTeX to Sphinx.
-     
-     A live version of the doc can be found at
-     
-     http://homes.cs.washington.edu/~sagarwal/ceres-solver/
-     
-     As it stands, the documentation has better hyperlinking
-     and coverage than the latex documentation now.
-     
-     Change-Id: I7ede3aa83b9b9ef25104caf331e5727b4f5beae5
index b30ecd0,0000000..fa1012d
mode 100644,000000..100644
--- /dev/null
@@@ -1,752 -1,0 +1,752 @@@
- //   bool operator(const T* rotation,
- //                 const T* translation,
- //                 const T* intrinsics,
- //                 const T* point,
- //                 T* residual) const {
 +// Ceres Solver - A fast non-linear least squares minimizer
 +// Copyright 2013 Google Inc. All rights reserved.
 +// http://code.google.com/p/ceres-solver/
 +//
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are met:
 +//
 +// * Redistributions of source code must retain the above copyright notice,
 +//   this list of conditions and the following disclaimer.
 +// * Redistributions in binary form must reproduce the above copyright notice,
 +//   this list of conditions and the following disclaimer in the documentation
 +//   and/or other materials provided with the distribution.
 +// * Neither the name of Google Inc. nor the names of its contributors may be
 +//   used to endorse or promote products derived from this software without
 +//   specific prior written permission.
 +//
 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 +// POSSIBILITY OF SUCH DAMAGE.
 +//
 +// Author: sameeragarwal@google.com (Sameer Agarwal)
 +//
 +// CostFunctionToFunctor is an adapter class that allows users to use
 +// CostFunction objects in templated functors which are to be used for
 +// automatic differentiation.  This allows the user to seamlessly mix
 +// analytic, numeric and automatic differentiation.
 +//
 +// For example, let us assume that
 +//
 +//  class IntrinsicProjection : public SizedCostFunction<2, 5, 3> {
 +//    public:
 +//      IntrinsicProjection(const double* observations);
 +//      virtual bool Evaluate(double const* const* parameters,
 +//                            double* residuals,
 +//                            double** jacobians) const;
 +//  };
 +//
 +// is a cost function that implements the projection of a point in its
 +// local coordinate system onto its image plane and subtracts it from
 +// the observed point projection. It can compute its residual and
 +// either via analytic or numerical differentiation can compute its
 +// jacobians.
 +//
 +// Now we would like to compose the action of this CostFunction with
 +// the action of camera extrinsics, i.e., rotation and
 +// translation. Say we have a templated function
 +//
 +//   template<typename T>
 +//   void RotateAndTranslatePoint(const T* rotation,
 +//                                const T* translation,
 +//                                const T* point,
 +//                                T* result);
 +//
 +// Then we can now do the following,
 +//
 +// struct CameraProjection {
 +//   CameraProjection(double* observation) {
 +//     intrinsic_projection_.reset(
 +//         new CostFunctionToFunctor<2, 5, 3>(
 +//             new IntrinsicProjection(observation_)));
 +//   }
 +//   template <typename T>
++//   bool operator()(const T* rotation,
++//                   const T* translation,
++//                   const T* intrinsics,
++//                   const T* point,
++//                   T* residual) const {
 +//     T transformed_point[3];
 +//     RotateAndTranslatePoint(rotation, translation, point, transformed_point);
 +//
 +//     // Note that we call intrinsic_projection_, just like it was
 +//     // any other templated functor.
 +//
 +//     return (*intrinsic_projection_)(intrinsics, transformed_point, residual);
 +//   }
 +//
 +//  private:
 +//   scoped_ptr<CostFunctionToFunctor<2,5,3> > intrinsic_projection_;
 +// };
 +
 +#ifndef CERES_PUBLIC_COST_FUNCTION_TO_FUNCTOR_H_
 +#define CERES_PUBLIC_COST_FUNCTION_TO_FUNCTOR_H_
 +
 +#include <numeric>
 +#include <vector>
 +
 +#include "ceres/cost_function.h"
 +#include "ceres/internal/fixed_array.h"
 +#include "ceres/internal/port.h"
 +#include "ceres/internal/scoped_ptr.h"
 +
 +namespace ceres {
 +
 +template <int kNumResiduals,
 +          int N0, int N1 = 0, int N2 = 0, int N3 = 0, int N4 = 0,
 +          int N5 = 0, int N6 = 0, int N7 = 0, int N8 = 0, int N9 = 0>
 +class CostFunctionToFunctor {
 + public:
 +  explicit CostFunctionToFunctor(CostFunction* cost_function)
 +  : cost_function_(cost_function) {
 +    CHECK_NOTNULL(cost_function);
 +
 +    CHECK_GE(kNumResiduals, 0);
 +    CHECK_EQ(cost_function->num_residuals(), kNumResiduals);
 +
 +    // This block breaks the 80 column rule to keep it somewhat readable.
 +    CHECK((!N1 && !N2 && !N3 && !N4 && !N5 && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && !N2 && !N3 && !N4 && !N5 && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && !N3 && !N4 && !N5 && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && !N4 && !N5 && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && !N5 && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && (N5 > 0) && !N6 && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && (N5 > 0) && (N6 > 0) && !N7 && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && (N5 > 0) && (N6 > 0) && (N7 > 0) && !N8 && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && (N5 > 0) && (N6 > 0) && (N7 > 0) && (N8 > 0) && !N9) ||
 +          ((N1 > 0) && (N2 > 0) && (N3 > 0) && (N4 > 0) && (N5 > 0) && (N6 > 0) && (N7 > 0) && (N8 > 0) && (N9 > 0)))
 +        << "Zero block cannot precede a non-zero block. Block sizes are "
 +        << "(ignore trailing 0s): " << N0 << ", " << N1 << ", " << N2 << ", "
 +        << N3 << ", " << N4 << ", " << N5 << ", " << N6 << ", " << N7 << ", "
 +        << N8 << ", " << N9;
 +
 +    const vector<int16>& parameter_block_sizes =
 +        cost_function->parameter_block_sizes();
 +    const int num_parameter_blocks =
 +        (N0 > 0) + (N1 > 0) + (N2 > 0) + (N3 > 0) + (N4 > 0) +
 +        (N5 > 0) + (N6 > 0) + (N7 > 0) + (N8 > 0) + (N9 > 0);
 +    CHECK_EQ(parameter_block_sizes.size(), num_parameter_blocks);
 +
 +    CHECK_EQ(N0, parameter_block_sizes[0]);
 +    if (parameter_block_sizes.size() > 1) CHECK_EQ(N1, parameter_block_sizes[1]);  // NOLINT
 +    if (parameter_block_sizes.size() > 2) CHECK_EQ(N2, parameter_block_sizes[2]);  // NOLINT
 +    if (parameter_block_sizes.size() > 3) CHECK_EQ(N3, parameter_block_sizes[3]);  // NOLINT
 +    if (parameter_block_sizes.size() > 4) CHECK_EQ(N4, parameter_block_sizes[4]);  // NOLINT
 +    if (parameter_block_sizes.size() > 5) CHECK_EQ(N5, parameter_block_sizes[5]);  // NOLINT
 +    if (parameter_block_sizes.size() > 6) CHECK_EQ(N6, parameter_block_sizes[6]);  // NOLINT
 +    if (parameter_block_sizes.size() > 7) CHECK_EQ(N7, parameter_block_sizes[7]);  // NOLINT
 +    if (parameter_block_sizes.size() > 8) CHECK_EQ(N8, parameter_block_sizes[8]);  // NOLINT
 +    if (parameter_block_sizes.size() > 9) CHECK_EQ(N9, parameter_block_sizes[9]);  // NOLINT
 +
 +    CHECK_EQ(accumulate(parameter_block_sizes.begin(),
 +                        parameter_block_sizes.end(), 0),
 +             N0 + N1 + N2 + N3 + N4 + N5 + N6 + N7 + N8 + N9);
 +  }
 +
 +  bool operator()(const double* x0, double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_EQ(N1, 0);
 +    CHECK_EQ(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +
 +    return cost_function_->Evaluate(&x0, residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_EQ(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(2);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(3);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(4);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(5);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(6);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    parameter_blocks[5] = x5;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(7);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    parameter_blocks[5] = x5;
 +    parameter_blocks[6] = x6;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(8);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    parameter_blocks[5] = x5;
 +    parameter_blocks[6] = x6;
 +    parameter_blocks[7] = x7;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  const double* x8,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_NE(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(9);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    parameter_blocks[5] = x5;
 +    parameter_blocks[6] = x6;
 +    parameter_blocks[7] = x7;
 +    parameter_blocks[8] = x8;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  const double* x8,
 +                  const double* x9,
 +                  double* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_NE(N8, 0);
 +    CHECK_NE(N9, 0);
 +    internal::FixedArray<const double*> parameter_blocks(10);
 +    parameter_blocks[0] = x0;
 +    parameter_blocks[1] = x1;
 +    parameter_blocks[2] = x2;
 +    parameter_blocks[3] = x3;
 +    parameter_blocks[4] = x4;
 +    parameter_blocks[5] = x5;
 +    parameter_blocks[6] = x6;
 +    parameter_blocks[7] = x7;
 +    parameter_blocks[8] = x8;
 +    parameter_blocks[9] = x9;
 +    return cost_function_->Evaluate(parameter_blocks.get(), residuals, NULL);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0, JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_EQ(N1, 0);
 +    CHECK_EQ(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    return EvaluateWithJets(&x0, residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_EQ(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(2);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_EQ(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(3);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_EQ(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(4);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_EQ(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(5);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  const JetT* x5,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_EQ(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(6);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    jets[5] = x5;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  const JetT* x5,
 +                  const JetT* x6,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_EQ(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(7);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    jets[5] = x5;
 +    jets[6] = x6;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  const JetT* x5,
 +                  const JetT* x6,
 +                  const JetT* x7,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_EQ(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(8);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    jets[5] = x5;
 +    jets[6] = x6;
 +    jets[7] = x7;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  const JetT* x5,
 +                  const JetT* x6,
 +                  const JetT* x7,
 +                  const JetT* x8,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_NE(N8, 0);
 +    CHECK_EQ(N9, 0);
 +    internal::FixedArray<const JetT*> jets(9);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    jets[5] = x5;
 +    jets[6] = x6;
 +    jets[7] = x7;
 +    jets[8] = x8;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 +  template <typename JetT>
 +  bool operator()(const JetT* x0,
 +                  const JetT* x1,
 +                  const JetT* x2,
 +                  const JetT* x3,
 +                  const JetT* x4,
 +                  const JetT* x5,
 +                  const JetT* x6,
 +                  const JetT* x7,
 +                  const JetT* x8,
 +                  const JetT* x9,
 +                  JetT* residuals) const {
 +    CHECK_NE(N0, 0);
 +    CHECK_NE(N1, 0);
 +    CHECK_NE(N2, 0);
 +    CHECK_NE(N3, 0);
 +    CHECK_NE(N4, 0);
 +    CHECK_NE(N5, 0);
 +    CHECK_NE(N6, 0);
 +    CHECK_NE(N7, 0);
 +    CHECK_NE(N8, 0);
 +    CHECK_NE(N9, 0);
 +    internal::FixedArray<const JetT*> jets(10);
 +    jets[0] = x0;
 +    jets[1] = x1;
 +    jets[2] = x2;
 +    jets[3] = x3;
 +    jets[4] = x4;
 +    jets[5] = x5;
 +    jets[6] = x6;
 +    jets[7] = x7;
 +    jets[8] = x8;
 +    jets[9] = x9;
 +    return EvaluateWithJets(jets.get(), residuals);
 +  }
 +
 + private:
 +  template <typename JetT>
 +  bool EvaluateWithJets(const JetT** inputs, JetT* output) const {
 +    const int kNumParameters =  N0 + N1 + N2 + N3 + N4 + N5 + N6 + N7 + N8 + N9;
 +    const vector<int16>& parameter_block_sizes =
 +        cost_function_->parameter_block_sizes();
 +    const int num_parameter_blocks = parameter_block_sizes.size();
 +    const int num_residuals = cost_function_->num_residuals();
 +
 +    internal::FixedArray<double> parameters(kNumParameters);
 +    internal::FixedArray<double*> parameter_blocks(num_parameter_blocks);
 +    internal::FixedArray<double> jacobians(num_residuals * kNumParameters);
 +    internal::FixedArray<double*> jacobian_blocks(num_parameter_blocks);
 +    internal::FixedArray<double> residuals(num_residuals);
 +
 +    // Build a set of arrays to get the residuals and jacobians from
 +    // the CostFunction wrapped by this functor.
 +    double* parameter_ptr = parameters.get();
 +    double* jacobian_ptr = jacobians.get();
 +    for (int i = 0; i < num_parameter_blocks; ++i) {
 +      parameter_blocks[i] = parameter_ptr;
 +      jacobian_blocks[i] = jacobian_ptr;
 +      for (int j = 0; j < parameter_block_sizes[i]; ++j) {
 +        *parameter_ptr++ = inputs[i][j].a;
 +      }
 +      jacobian_ptr += num_residuals * parameter_block_sizes[i];
 +    }
 +
 +    if (!cost_function_->Evaluate(parameter_blocks.get(),
 +                                  residuals.get(),
 +                                  jacobian_blocks.get())) {
 +      return false;
 +    }
 +
 +    // Now that we have the incoming Jets, which are carrying the
 +    // partial derivatives of each of the inputs w.r.t to some other
 +    // underlying parameters. The derivative of the outputs of the
 +    // cost function w.r.t to the same underlying parameters can now
 +    // be computed by applying the chain rule.
 +    //
 +    //  d output[i]               d output[i]   d input[j]
 +    //  --------------  = sum_j   ----------- * ------------
 +    //  d parameter[k]            d input[j]    d parameter[k]
 +    //
 +    // d input[j]
 +    // --------------  = inputs[j], so
 +    // d parameter[k]
 +    //
 +    //  outputJet[i]  = sum_k jacobian[i][k] * inputJet[k]
 +    //
 +    // The following loop, iterates over the residuals, computing one
 +    // output jet at a time.
 +    for (int i = 0; i < num_residuals; ++i) {
 +      output[i].a = residuals[i];
 +      output[i].v.setZero();
 +
 +      for (int j = 0; j < num_parameter_blocks; ++j) {
 +        const int16 block_size = parameter_block_sizes[j];
 +        for (int k = 0; k < parameter_block_sizes[j]; ++k) {
 +          output[i].v +=
 +              jacobian_blocks[j][i * block_size + k] * inputs[j][k].v;
 +        }
 +      }
 +    }
 +
 +    return true;
 +  }
 +
 + private:
 +  internal::scoped_ptr<CostFunction> cost_function_;
 +};
 +
 +}  // namespace ceres
 +
 +#endif  // CERES_PUBLIC_COST_FUNCTION_TO_FUNCTOR_H_
@@@ -38,7 -38,7 +38,7 @@@
  //
  //   struct F {
  //     template<typename T>
--//     bool operator(const T *x, const T *y, ..., T *z) {
++//     bool operator()(const T *x, const T *y, ..., T *z) {
  //       // Compute z[] based on x[], y[], ...
  //       // return true if computation succeeded, false otherwise.
  //     }
  //
  //   struct F {
  //     template<typename T>
--//     bool operator(const T *p, const T *q, T *z) {
++//     bool operator()(const T *p, const T *q, T *z) {
  //       // ...
  //     }
  //   };
index 593c371,0000000..039e1a1
mode 100644,000000..100644
--- /dev/null
@@@ -1,346 -1,0 +1,346 @@@
- //   bool operator(const T* rotation,
- //                 const T* translation,
- //                 const T* intrinsics,
- //                 const T* point,
- //                 T* residuals) const {
 +// Ceres Solver - A fast non-linear least squares minimizer
 +// Copyright 2013 Google Inc. All rights reserved.
 +// http://code.google.com/p/ceres-solver/
 +//
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are met:
 +//
 +// * Redistributions of source code must retain the above copyright notice,
 +//   this list of conditions and the following disclaimer.
 +// * Redistributions in binary form must reproduce the above copyright notice,
 +//   this list of conditions and the following disclaimer in the documentation
 +//   and/or other materials provided with the distribution.
 +// * Neither the name of Google Inc. nor the names of its contributors may be
 +//   used to endorse or promote products derived from this software without
 +//   specific prior written permission.
 +//
 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 +// POSSIBILITY OF SUCH DAMAGE.
 +//
 +// Author: sameeragarwal@google.com (Sameer Agarwal)
 +//
 +// A wrapper class that takes a variadic functor evaluating a
 +// function, numerically differentiates it and makes it available as a
 +// templated functor so that it can be easily used as part of Ceres'
 +// automatic differentiation framework.
 +//
 +// For example:
 +//
 +// For example, let us assume that
 +//
 +//  struct IntrinsicProjection
 +//    IntrinsicProjection(const double* observations);
 +//    bool operator()(const double* calibration,
 +//                    const double* point,
 +//                    double* residuals);
 +//  };
 +//
 +// is a functor that implements the projection of a point in its local
 +// coordinate system onto its image plane and subtracts it from the
 +// observed point projection.
 +//
 +// Now we would like to compose the action of this functor with the
 +// action of camera extrinsics, i.e., rotation and translation, which
 +// is given by the following templated function
 +//
 +//   template<typename T>
 +//   void RotateAndTranslatePoint(const T* rotation,
 +//                                const T* translation,
 +//                                const T* point,
 +//                                T* result);
 +//
 +// To compose the extrinsics and intrinsics, we can construct a
 +// CameraProjection functor as follows.
 +//
 +// struct CameraProjection {
 +//    typedef NumericDiffFunctor<IntrinsicProjection, CENTRAL, 2, 5, 3>
 +//       IntrinsicProjectionFunctor;
 +//
 +//   CameraProjection(double* observation) {
 +//     intrinsic_projection_.reset(
 +//         new IntrinsicProjectionFunctor(observation)) {
 +//   }
 +//
 +//   template <typename T>
++//   bool operator()(const T* rotation,
++//                   const T* translation,
++//                   const T* intrinsics,
++//                   const T* point,
++//                   T* residuals) const {
 +//     T transformed_point[3];
 +//     RotateAndTranslatePoint(rotation, translation, point, transformed_point);
 +//     return (*intrinsic_projection_)(intrinsics, transformed_point, residual);
 +//   }
 +//
 +//  private:
 +//   scoped_ptr<IntrinsicProjectionFunctor> intrinsic_projection_;
 +// };
 +//
 +// Here, we made the choice of using CENTRAL differences to compute
 +// the jacobian of IntrinsicProjection.
 +//
 +// Now, we are ready to construct an automatically differentiated cost
 +// function as
 +//
 +// CostFunction* cost_function =
 +//    new AutoDiffCostFunction<CameraProjection, 2, 3, 3, 5>(
 +//        new CameraProjection(observations));
 +//
 +// cost_function now seamlessly integrates automatic differentiation
 +// of RotateAndTranslatePoint with a numerically differentiated
 +// version of IntrinsicProjection.
 +
 +#ifndef CERES_PUBLIC_NUMERIC_DIFF_FUNCTOR_H_
 +#define CERES_PUBLIC_NUMERIC_DIFF_FUNCTOR_H_
 +
 +#include "ceres/numeric_diff_cost_function.h"
 +#include "ceres/types.h"
 +#include "ceres/cost_function_to_functor.h"
 +
 +namespace ceres {
 +
 +template<typename Functor,
 +         NumericDiffMethod kMethod = CENTRAL,
 +         int kNumResiduals = 0,
 +         int N0 = 0, int N1 = 0 , int N2 = 0, int N3 = 0, int N4 = 0,
 +         int N5 = 0, int N6 = 0 , int N7 = 0, int N8 = 0, int N9 = 0>
 +class NumericDiffFunctor {
 + public:
 +  // relative_step_size controls the step size used by the numeric
 +  // differentiation process.
 +  explicit NumericDiffFunctor(double relative_step_size = 1e-6)
 +      : functor_(
 +          new NumericDiffCostFunction<Functor,
 +                                      kMethod,
 +                                      kNumResiduals,
 +                                      N0, N1, N2, N3, N4,
 +                                      N5, N6, N7, N8, N9>(new Functor,
 +                                                          relative_step_size)) {
 +  }
 +
 +  NumericDiffFunctor(Functor* functor, double relative_step_size = 1e-6)
 +      : functor_(new NumericDiffCostFunction<Functor,
 +                                             kMethod,
 +                                             kNumResiduals,
 +                                             N0, N1, N2, N3, N4,
 +                                             N5, N6, N7, N8, N9>(
 +                                                 functor, relative_step_size)) {
 +  }
 +
 +  bool operator()(const double* x0, double* residuals) const {
 +    return functor_(x0, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  double* residuals) const {
 +    return functor_(x0, x1, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  const double* x8,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, x8, residuals);
 +  }
 +
 +  bool operator()(const double* x0,
 +                  const double* x1,
 +                  const double* x2,
 +                  const double* x3,
 +                  const double* x4,
 +                  const double* x5,
 +                  const double* x6,
 +                  const double* x7,
 +                  const double* x8,
 +                  const double* x9,
 +                  double* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0, T* residuals) const {
 +    return functor_(x0, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  T* residuals) const {
 +    return functor_(x0, x1, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  const T* x5,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  const T* x5,
 +                  const T* x6,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  const T* x5,
 +                  const T* x6,
 +                  const T* x7,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  const T* x5,
 +                  const T* x6,
 +                  const T* x7,
 +                  const T* x8,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, x8, residuals);
 +  }
 +
 +  template <typename T>
 +  bool operator()(const T* x0,
 +                  const T* x1,
 +                  const T* x2,
 +                  const T* x3,
 +                  const T* x4,
 +                  const T* x5,
 +                  const T* x6,
 +                  const T* x7,
 +                  const T* x8,
 +                  const T* x9,
 +                  T* residuals) const {
 +    return functor_(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, residuals);
 +  }
 +
 +
 + private:
 +  CostFunctionToFunctor<kNumResiduals,
 +                        N0, N1, N2, N3, N4,
 +                        N5, N6, N7, N8, N9> functor_;
 +};
 +
 +}  // namespace ceres
 +
 +#endif  // CERES_PUBLIC_NUMERIC_DIFF_FUNCTOR_H_
@@@ -328,86 -254,6 +328,86 @@@ class Problem 
    // sizes of all of the residual blocks.
    int NumResiduals() const;
  
-   //   problem.Add(new MyCostFunction, NULL, &x);
 +  // Options struct to control Problem::Evaluate.
 +  struct EvaluateOptions {
 +    EvaluateOptions()
 +        : apply_loss_function(true),
 +          num_threads(1) {
 +    }
 +
 +    // The set of parameter blocks for which evaluation should be
 +    // performed. This vector determines the order that parameter
 +    // blocks occur in the gradient vector and in the columns of the
 +    // jacobian matrix. If parameter_blocks is empty, then it is
 +    // assumed to be equal to vector containing ALL the parameter
 +    // blocks.  Generally speaking the parameter blocks will occur in
 +    // the order in which they were added to the problem. But, this
 +    // may change if the user removes any parameter blocks from the
 +    // problem.
 +    //
 +    // NOTE: This vector should contain the same pointers as the ones
 +    // used to add parameter blocks to the Problem. These parameter
 +    // block should NOT point to new memory locations. Bad things will
 +    // happen otherwise.
 +    vector<double*> parameter_blocks;
 +
 +    // The set of residual blocks to evaluate. This vector determines
 +    // the order in which the residuals occur, and how the rows of the
 +    // jacobian are ordered. If residual_blocks is empty, then it is
 +    // assumed to be equal to the vector containing all the residual
 +    // blocks. If this vector is empty, then it is assumed to be equal
 +    // to a vector containing ALL the residual blocks. Generally
 +    // speaking the residual blocks will occur in the order in which
 +    // they were added to the problem. But, this may change if the
 +    // user removes any residual blocks from the problem.
 +    vector<ResidualBlockId> residual_blocks;
 +
 +    // Even though the residual blocks in the problem may contain loss
 +    // functions, setting apply_loss_function to false will turn off
 +    // the application of the loss function to the output of the cost
 +    // function. This is of use for example if the user wishes to
 +    // analyse the solution quality by studying the distribution of
 +    // residuals before and after the solve.
 +    bool apply_loss_function;
 +
 +    int num_threads;
 +  };
 +
 +  // Evaluate Problem. Any of the output pointers can be NULL. Which
 +  // residual blocks and parameter blocks are used is controlled by
 +  // the EvaluateOptions struct above.
 +  //
 +  // Note 1: The evaluation will use the values stored in the memory
 +  // locations pointed to by the parameter block pointers used at the
 +  // time of the construction of the problem. i.e.,
 +  //
 +  //   Problem problem;
 +  //   double x = 1;
++  //   problem.AddResidualBlock(new MyCostFunction, NULL, &x);
 +  //
 +  //   double cost = 0.0;
 +  //   problem.Evaluate(Problem::EvaluateOptions(), &cost, NULL, NULL, NULL);
 +  //
 +  // The cost is evaluated at x = 1. If you wish to evaluate the
 +  // problem at x = 2, then
 +  //
 +  //    x = 2;
 +  //    problem.Evaluate(Problem::EvaluateOptions(), &cost, NULL, NULL, NULL);
 +  //
 +  // is the way to do so.
 +  //
 +  // Note 2: If no local parameterizations are used, then the size of
 +  // the gradient vector (and the number of columns in the jacobian)
 +  // is the sum of the sizes of all the parameter blocks. If a
 +  // parameter block has a local parameterization, then it contributes
 +  // "LocalSize" entries to the gradient vector (and the number of
 +  // columns in the jacobian).
 +  bool Evaluate(const EvaluateOptions& options,
 +                double* cost,
 +                vector<double>* residuals,
 +                vector<double>* gradient,
 +                CRSMatrix* jacobian);
 +
   private:
    friend class Solver;
    internal::scoped_ptr<internal::ProblemImpl> problem_impl_;
@@@ -83,7 -58,7 +83,7 @@@ MatrixAdapter<T, 3, 1> RowMajorAdapter3
  // The implementation may be used with auto-differentiation up to the first
  // derivative, higher derivatives may have unexpected results near the origin.
  template<typename T>
--void AngleAxisToQuaternion(T const* angle_axis, T* quaternion);
++void AngleAxisToQuaternion(const T* angle_axis, T* quaternion);
  
  // Convert a quaternion to the equivalent combined axis-angle representation.
  // The value quaternion must be a unit quaternion - it is not normalized first,
  // The implemention may be used with auto-differentiation up to the first
  // derivative, higher derivatives may have unexpected results near the origin.
  template<typename T>
--void QuaternionToAngleAxis(T const* quaternion, T* angle_axis);
++void QuaternionToAngleAxis(const T* quaternion, T* angle_axis);
  
  // Conversions between 3x3 rotation matrix (in column major order) and
  // axis-angle rotation representations.  Templated for use with
  // autodifferentiation.
  template <typename T>
- void RotationMatrixToAngleAxis(T const* R, T* angle_axis);
 -void RotationMatrixToAngleAxis(T const * R, T * angle_axis);
++void RotationMatrixToAngleAxis(const T* R, T* angle_axis);
 +
 +template <typename T, int row_stride, int col_stride>
 +void RotationMatrixToAngleAxis(
 +    const MatrixAdapter<const T, row_stride, col_stride>& R,
 +    T* angle_axis);
 +
  template <typename T>
- void AngleAxisToRotationMatrix(T const* angle_axis, T* R);
 -void AngleAxisToRotationMatrix(T const * angle_axis, T * R);
++void AngleAxisToRotationMatrix(const T* angle_axis, T* R);
 +
 +template <typename T, int row_stride, int col_stride>
 +void AngleAxisToRotationMatrix(
-     T const* angle_axis,
++    const T* angle_axis,
 +    const MatrixAdapter<T, row_stride, col_stride>& R);
  
  // Conversions between 3x3 rotation matrix (in row major order) and
  // Euler angle (in degrees) rotation representations.
@@@ -300,18 -227,11 +300,18 @@@ inline void QuaternionToAngleAxis(cons
  // occurs and deals with them by taking code paths that are guaranteed
  // to not perform division by a small number.
  template <typename T>
--inline void RotationMatrixToAngleAxis(const T * R, T * angle_axis) {
++inline void RotationMatrixToAngleAxis(const T* R, T* angle_axis) {
 +  RotationMatrixToAngleAxis(ColumnMajorAdapter3x3(R), angle_axis);
 +}
 +
 +template <typename T, int row_stride, int col_stride>
 +void RotationMatrixToAngleAxis(
 +    const MatrixAdapter<const T, row_stride, col_stride>& R,
-     T * angle_axis) {
++    T* angle_axis) {
    // x = k * 2 * sin(theta), where k is the axis of rotation.
 -  angle_axis[0] = R[5] - R[7];
 -  angle_axis[1] = R[6] - R[2];
 -  angle_axis[2] = R[1] - R[3];
 +  angle_axis[0] = R(2, 1) - R(1, 2);
 +  angle_axis[1] = R(0, 2) - R(2, 0);
 +  angle_axis[2] = R(1, 0) - R(0, 1);
  
    static const T kOne = T(1.0);
    static const T kTwo = T(2.0);
  }
  
  template <typename T>
--inline void AngleAxisToRotationMatrix(const T * angle_axis, T * R) {
++inline void AngleAxisToRotationMatrix(const T* angle_axis, T* R) {
 +  AngleAxisToRotationMatrix(angle_axis, ColumnMajorAdapter3x3(R));
 +}
 +
 +template <typename T, int row_stride, int col_stride>
 +void AngleAxisToRotationMatrix(
-     const T * angle_axis,
++    const T* angle_axis,
 +    const MatrixAdapter<T, row_stride, col_stride>& R) {
    static const T kOne = T(1.0);
    const T theta2 = DotProduct(angle_axis, angle_axis);
    if (theta2 > 0.0) {
@@@ -29,6 -29,6 +29,8 @@@
  // Author: David Gallup (dgallup@google.com)
  //         Sameer Agarwal (sameeragarwal@google.com)
  
++#ifndef CERES_NO_SUITESPARSE
++
  #include "ceres/canonical_views_clustering.h"
  
  #include "ceres/collections_port.h"
@@@ -236,3 -236,3 +238,5 @@@ void CanonicalViewsClustering::ComputeC
  
  }  // namespace internal
  }  // namespace ceres
++
++#endif  // CERES_NO_SUITESPARSE
  #ifndef CERES_INTERNAL_CANONICAL_VIEWS_CLUSTERING_H_
  #define CERES_INTERNAL_CANONICAL_VIEWS_CLUSTERING_H_
  
++#ifndef CERES_NO_SUITESPARSE
++
  #include <vector>
  
 -#include <glog/logging.h>
  #include "ceres/collections_port.h"
  #include "ceres/graph.h"
 -#include "ceres/map_util.h"
  #include "ceres/internal/macros.h"
 +#include "ceres/map_util.h"
 +#include "glog/logging.h"
  
  namespace ceres {
  namespace internal {
@@@ -130,4 -130,4 +132,5 @@@ struct CanonicalViewsClusteringOptions 
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_NO_SUITESPARSE
  #endif  // CERES_INTERNAL_CANONICAL_VIEWS_CLUSTERING_H_
@@@ -63,37 -65,10 +63,36 @@@ SPECIALIZATIONS = [(2, 2, 2)
                     (4, 4, 2),
                     (4, 4, 3),
                     (4, 4, 4),
 -                   (4, 4, "Dynamic"),
 -                   ("Dynamic", "Dynamic", "Dynamic")]
 -
 -SPECIALIZATION_FILE = """// Copyright 2011 Google Inc. All Rights Reserved.
 +                   (4, 4, "Eigen::Dynamic"),
 +                   ("Eigen::Dynamic", "Eigen::Dynamic", "Eigen::Dynamic")]
- SPECIALIZATION_FILE = """// Ceres Solver - A fast non-linear least squares minimizer
++HEADER = """// Ceres Solver - A fast non-linear least squares minimizer
 +// Copyright 2010, 2011, 2012, 2013 Google Inc. All rights reserved.
 +// http://code.google.com/p/ceres-solver/
 +//
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are met:
 +//
 +// * Redistributions of source code must retain the above copyright notice,
 +//   this list of conditions and the following disclaimer.
 +// * Redistributions in binary form must reproduce the above copyright notice,
 +//   this list of conditions and the following disclaimer in the documentation
 +//   and/or other materials provided with the distribution.
 +// * Neither the name of Google Inc. nor the names of its contributors may be
 +//   used to endorse or promote products derived from this software without
 +//   specific prior written permission.
 +//
 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 +// POSSIBILITY OF SUCH DAMAGE.
 +//
  // Author: sameeragarwal@google.com (Sameer Agarwal)
  //
  // Template specialization of SchurEliminator.
  // THIS FILE IS AUTOGENERATED. DO NOT EDIT.
  //=========================================
  //
--// This file is generated using generate_eliminator_specializations.py.
++// This file is generated using generate_eliminator_specialization.py.
  // Editing it manually is not recommended.
++"""
++
++DYNAMIC_FILE = """
  
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
@@@ -118,22 -93,22 +120,26 @@@ template class SchurEliminator<%s, %s, 
  
  }  // namespace internal
  }  // namespace ceres
--
  """
  
--FACTORY_FILE_HEADER = """// Copyright 2011 Google Inc. All Rights Reserved.
--// Author: sameeragarwal@google.com (Sameer Agarwal)
--//
--// ========================================
--// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
--// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
--// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
--// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
--//=========================================
--//
--// This file is generated using generate_template_specializations.py.
--// Editing it manually is not recommended.
++SPECIALIZATION_FILE = """
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
  
++#include "ceres/schur_eliminator_impl.h"
++#include "ceres/internal/eigen.h"
++
++namespace ceres {
++namespace internal {
++
++template class SchurEliminator<%s, %s, %s>;
++
++}  // namespace internal
++}  // namespace ceres
++
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
++"""
++
++FACTORY_FILE_HEADER = """
  #include "ceres/linear_solver.h"
  #include "ceres/schur_eliminator.h"
  #include "ceres/internal/eigen.h"
@@@ -184,6 -159,6 +190,7 @@@ def Specialize()
    Generate specialization code and the conditionals to instantiate it.
    """
    f = open("schur_eliminator.cc", "w")
++  f.write(HEADER)
    f.write(FACTORY_FILE_HEADER)
  
    for row_block_size, e_block_size, f_block_size in SPECIALIZATIONS:
                                      e_block_size,
                                      f_block_size) + ".cc"
      fptr = open(output, "w")
--    fptr.write(SPECIALIZATION_FILE % (row_block_size,
--                                      e_block_size,
--                                      f_block_size))
++    fptr.write(HEADER)
++
++    template = SPECIALIZATION_FILE
++    if (row_block_size == "Eigen::Dynamic" and
++        e_block_size == "Eigen::Dynamic" and
++        f_block_size == "Eigen::Dynamic"):
++      template = DYNAMIC_FILE
++
++    fptr.write(template % (row_block_size, e_block_size, f_block_size))
      fptr.close()
  
      f.write(FACTORY_CONDITIONAL % (row_block_size,
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 2, 2>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 2, 3>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 2, 4>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 2, Ei
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 3, 3>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 3, 4>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 3, 9>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 3, Ei
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 4, 3>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 4, 4>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<2, 4, Ei
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<4, 4, 2>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<4, 4, 3>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<4, 4, 4>
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,8 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -51,3 -51,3 +53,4 @@@ template class SchurEliminator<4, 4, Ei
  }  // namespace internal
  }  // namespace ceres
  
++#endif  // CERES_RESTRICT_SCHUR_SPECIALIZATION
@@@ -40,6 -40,6 +40,7 @@@
  // This file is generated using generate_eliminator_specializations.py.
  // Editing it manually is not recommended.
  
++
  #include "ceres/schur_eliminator_impl.h"
  #include "ceres/internal/eigen.h"
  
@@@ -50,4 -50,4 +51,3 @@@ template class SchurEliminator<Eigen::D
  
  }  // namespace internal
  }  // namespace ceres
--
index e7508ca,0000000..437f742
mode 100644,000000..100644
--- /dev/null
@@@ -1,211 -1,0 +1,214 @@@
 +// Ceres Solver - A fast non-linear least squares minimizer
 +// Copyright 2012 Google Inc. All rights reserved.
 +// http://code.google.com/p/ceres-solver/
 +//
 +// Redistribution and use in source and binary forms, with or without
 +// modification, are permitted provided that the following conditions are met:
 +//
 +// * Redistributions of source code must retain the above copyright notice,
 +//   this list of conditions and the following disclaimer.
 +// * Redistributions in binary form must reproduce the above copyright notice,
 +//   this list of conditions and the following disclaimer in the documentation
 +//   and/or other materials provided with the distribution.
 +// * Neither the name of Google Inc. nor the names of its contributors may be
 +//   used to endorse or promote products derived from this software without
 +//   specific prior written permission.
 +//
 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THE