[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29339] branches/soc-2010-rohith291991: Comiso solver is complete.

Rohith B V rohith291991 at gmail.com
Tue Jun 8 13:39:14 CEST 2010


Revision: 29339
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29339
Author:   rohith291991
Date:     2010-06-08 13:39:13 +0200 (Tue, 08 Jun 2010)

Log Message:
-----------
Comiso solver is complete. The C interface remains. Output was compared step by step with that of the original Comiso solver for several cases, and found to be correct. Some more checking may be done, followed by optimization.

Modified Paths:
--------------
    branches/soc-2010-rohith291991/intern/comiso/extern/comiso.h
    branches/soc-2010-rohith291991/intern/comiso/intern/ConstrainedSolver.cpp
    branches/soc-2010-rohith291991/intern/comiso/intern/MISolver.cpp
    branches/soc-2010-rohith291991/intern/comiso/intern/comiso.cpp
    branches/soc-2010-rohith291991/intern/comiso/intern/common.h
    branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_quadrangulate.c

Removed Paths:
-------------
    branches/soc-2010-rohith291991/intern/comiso/CMakeLists.txt
    branches/soc-2010-rohith291991/intern/comiso/CoMISo.cmake
    branches/soc-2010-rohith291991/intern/comiso/Makefile

Deleted: branches/soc-2010-rohith291991/intern/comiso/CMakeLists.txt
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/CMakeLists.txt	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/CMakeLists.txt	2010-06-08 11:39:13 UTC (rev 29339)
@@ -1,150 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-
-project(CoMISo)
-
-# add our macro directory to cmake search path
-set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
-
-include (ACGCommon)
-
-acg_qt4 ()
-# change to 0 if QT should not be used
-set( WANT_COMISO_QT 1 )
-if( QT4_FOUND)
-  #message( WARNING " QT4 FOUND" )
-  if( WANT_COMISO_QT )
-    add_definitions (-DQT4_FOUND)
-  #  message( WARNING " USING QT4" )
-  endif ()
-endif ()
-
-acg_get_version ()
-
-include (ACGOutput)
-
-find_package (GMM)
-if (NOT GMM_FOUND)
-  message (FATAL_ERROR "GMM not found!")
-endif ()
-
-find_package (Boost)
-if (NOT Boost_FOUND)
-  message (FATAL_ERROR "Boost not found!")
-endif ()
-
-find_package (BLAS)
-if (NOT BLAS_FOUND )
-  message (FATAL_ERROR "BLAS not found!")
-endif ()
-
-#added by CAT
-find_package (SUITESPARSE)
-if (NOT SUITESPARSE_FOUND )
-  message (FATAL_ERROR "SUITESPARSE not found!")
-endif ()
-
-if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/factored_solver/CMakeLists.txt" )
-	add_subdirectory (Examples/factored_solver)
-endif()
-
-if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/quadratic_solver/CMakeLists.txt" )
-	add_subdirectory (Examples/quadratic_solver)
-endif()
-if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/test2/CMakeLists.txt" )
-	add_subdirectory (Examples/test2)
-endif()
-if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_quadratic_example/CMakeLists.txt" )
-	add_subdirectory (Examples/small_quadratic_example)
-endif()
-if( EXISTS "${CMAKE_SOURCE_DIR}/Examples/small_factored_example/CMakeLists.txt" )
-	add_subdirectory (Examples/small_factored_example)
-endif()
-
-
-
-include_directories (
-  ..
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${Boost_INCLUDE_DIR}
-  ${GMM_INCLUDE_DIR}
-  ${SUITESPARSE_INCLUDE_DIRS}
-)
-
-# generate dllexport macros on windows
-if (WIN32)
-  add_definitions(-DCOMISODLL)
-endif ()
-
-
-link_directories (
-  ${SUITESPARSE_LIBRARY_DIRS}
-)
-
-# source code directories
-set (directories 
-  .
-  Solver 
-  Config
-  Utils
-  QtWidgets
-)
-
-# generate dllexport macros on windows
-if (WIN32)
-  add_definitions(-DCOMISODLL)
-endif ()
-
-if (WIN32)
-  add_definitions(
-      -D_USE_MATH_DEFINES -DNOMINMAX
-  )
-endif ()
-
-# collect all header,source and ui files
-acg_append_files (headers "*.hh" ${directories})
-acg_append_files (sources "*.cc" ${directories})
-acg_append_files (ui "*.ui" ${directories})
-
-
-macro (of_list_filter _list)
-  if (WIN32)
-   foreach (_element ${${_list}})
-     if (_element MATCHES "gnuplot_i\\.(cc|hh)$")
-       list (REMOVE_ITEM ${_list} ${_element})
-     endif ()
-   endforeach ()
-  endif ()
-endmacro ()
-
-of_list_filter  ( headers )
-of_list_filter  ( sources )
-
-
-# remove template cc files from source file list
-acg_drop_templates (sources)
-
-if( QT4_FOUND)
-# genereate uic and moc targets
-acg_qt4_autouic (uic_targets ${ui})
-acg_qt4_automoc (moc_targets ${headers})
-endif()
-acg_add_library (CoMISo SHARED ${uic_targets} ${sources} ${headers} ${moc_targets})
-
-if (NOT APPLE)
-	target_link_libraries (CoMISo 
-	  ${QT_LIBRARIES}
-	  ${SUITESPARSE_LIBRARIES}
-	  ${BLAS_LIBRARIES}
-	)
-else(NOT APPLE)
-	target_link_libraries (CoMISo
-	  ${QT_LIBRARIES}
-	  ${SUITESPARSE_LIBRARIES}
-	  ${BLAS_LIBRARIES}
-	)
-endif(NOT APPLE)
-
-# display results
-acg_print_configure_header (COMISO "CoMISo")
-

Deleted: branches/soc-2010-rohith291991/intern/comiso/CoMISo.cmake
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/CoMISo.cmake	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/CoMISo.cmake	2010-06-08 11:39:13 UTC (rev 29339)
@@ -1,2 +0,0 @@
-# add our macro directory to cmake search path
-set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

Deleted: branches/soc-2010-rohith291991/intern/comiso/Makefile
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/Makefile	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/Makefile	2010-06-08 11:39:13 UTC (rev 29339)
@@ -1,54 +0,0 @@
-# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
-# vim: tabstop=8
-#
-# $Id: Makefile 19330 2009-03-19 01:50:45Z hos $
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Hans Lambermont, GSR
-#
-# ***** END GPL LICENSE BLOCK *****
-# elbeem main makefile.
-#
-
-include nan_definitions.mk
-
-unexport NAN_QUIET
-
-LIBNAME = elbeem
-SOURCEDIR = intern/$(LIBNAME)
-DIR = $(OCGDIR)/$(SOURCEDIR)
-DIRS = intern
-#not ready yet TESTDIRS = test
-
-include nan_subdirs.mk
-
-install: $(ALL_OR_DEBUG)
-	@[ -d $(NAN_ELBEEM) ] || mkdir $(NAN_ELBEEM)
-	@[ -d $(NAN_ELBEEM)/include ] || mkdir $(NAN_ELBEEM)/include
-	@[ -d $(NAN_ELBEEM)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_ELBEEM)/lib/$(DEBUG_DIR)
-	@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libelbeem.a $(NAN_ELBEEM)/lib/$(DEBUG_DIR)
-ifeq ($(OS),darwin)
-	ranlib $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
-endif
-	@../tools/cpifdiff.sh extern/*.h $(NAN_ELBEEM)/include/
-

Modified: branches/soc-2010-rohith291991/intern/comiso/extern/comiso.h
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/extern/comiso.h	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/extern/comiso.h	2010-06-08 11:39:13 UTC (rev 29339)
@@ -5,7 +5,7 @@
 extern "C"  {
 #endif
 
-int MyFunc();
+int MISolve();
 
 
 #ifdef __cplusplus

Modified: branches/soc-2010-rohith291991/intern/comiso/intern/ConstrainedSolver.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/ConstrainedSolver.cpp	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/ConstrainedSolver.cpp	2010-06-08 11:39:13 UTC (rev 29339)
@@ -120,14 +120,14 @@
 				// redundant or incompatible?
 
 				if( fabs(_constraints(i,n_vars-1) )> 1e-6 )
-					std::cerr << "Warning: incompatible condition:\n";
+					std::cerr << "Warning: incompatible condition.\n";
 				else
-					std::cerr << "Warning: redundant condition:\n";
+					std::cerr << "Warning: redundant condition.\n";
 
 				}
 			else
 				if(roundmap[elim_j] && fabs(elim_val-1.0) > 1e-6)
-					std::cerr << "Warning: eliminate non +-1 integer -> correct rounding cannot be guaranteed:\n" 
+					std::cerr << "Warning: eliminate non +-1 integer -> correct rounding cannot be guaranteed.\n" 
 
 					<< (_constraints.row(i)) << std::endl;
 
@@ -232,7 +232,7 @@
 					  std::vector<int>&           _new_idx,
 					  SparseXdc&                 _Acsc)
 	{
-	std::cerr << __FUNCTION__ << std::endl;
+	
 	ACG::StopWatch sw;
 	sw.start();
 
@@ -266,7 +266,6 @@
 
 			double constraint_rhs = _constraints(i, constraint.size()-1);
 
-			std::cerr << "constraint_rhs " << constraint_rhs << std::endl;
 			// temporarliy set last element to zero (to avoid iterator finding it)
 			constraint(0,constraint.size()-1) = 0; // <- for sparse only
 

Modified: branches/soc-2010-rohith291991/intern/comiso/intern/MISolver.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/MISolver.cpp	2010-06-08 11:09:20 UTC (rev 29338)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/MISolver.cpp	2010-06-08 11:39:13 UTC (rev 29339)
@@ -56,7 +56,6 @@
 bool MISolver::choleskySolve(MatrixXd _A, std::vector<double>& _b, std::vector<double>& _x)
 	{
 
-	SparseLDLT<SparseXdc> cholSolver;
 	VectorXd x;
 
 	x.resize(_b.size());
@@ -72,39 +71,8 @@
 
 _A.ldlt().solveInPlace(x);
 
-/*
-	SparseXdc Acsc;
-	Acsc.resize(dimn,dimm);
+_x.resize(_b.size());
 
-	Acsc.startFill(dimn*dimm);
-
-	for(i=0;i<dimn;i++)
-		{
-
-		for(j=0;j<dimm;j++)
-
-			{
-
-			Acsc.fill(j,i)=_A(j,i);
-
-			}
-
-		}
-
-	Acsc.endFill();
-
-std::cout<<Acsc<<"\n\n";
-
-	cholSolver.compute(Acsc);
-
-	if(!cholSolver.solveInPlace(x))
-		{
-		std::cerr<<"Error occured  during Cholesky Solve"<<"\n\n";
-		return false;
-		}
-*/
-	_x.resize(_b.size());
-
 	for(i=0;i<_b.size();i++)
 		{
 		_x[i]=x[i];
@@ -215,17 +183,9 @@
 
 		++n_full;
 
-std::cout<<"1:\n\n";
-for(int l=0;l<_x.size();l++)
-{
-std::cout<<_x[l]<<"\n";
-
-}
 		}
 
-     
-
-	if( no_rounding_)
+     if( no_rounding_)
 		return;
 
 	// preconditioner for CG
@@ -236,8 +196,6 @@
 	//PS.setIdentity();
 	//PR.setIdentity();
 
-
-
 	// neighbors for local optimization
 	Vecui neigh_i;
 
@@ -269,13 +227,7 @@
 		if(elim_i.size()!=0)
 			eliminate_csc_vars2( elim_i, elim_v, _A, xr, _rhs);
 
-std::cout<<"2:\n\n";
-for(int l=0;l<xr.size();l++)
-{
-std::cout<<xr[l]<<"\n";
 
-}
-
 		}
 
 	else
@@ -343,13 +295,6 @@
 
 				eliminate_var_idx(i_best, to_round, -1);
 
-std::cout<<"3:\n\n";
-for(int l=0;l<xr.size();l++)
-{
-std::cout<<xr[l]<<"\n";
-
-}
-
 				// update old_idx
 				old_idx.erase( old_idx.begin()+i_best );
 
@@ -364,17 +309,8 @@
 					{
 					if( noisy_ > 2)std::cerr << "use local iteration ";
 
-
 					n_its = gauss_seidel_local(_A, xr, _rhs, neigh_i, max_local_iters_, max_local_error_);
 
-std::cout<<"4:\n\n";
-for(int l=0;l<xr.size();l++)
-{
-std::cout<<xr[l]<<"\n";
-
-}
-
-
 					++n_local;
 					}
 
@@ -419,12 +355,7 @@
 
 						++n_full;
 						}
-std::cout<<"5:\n\n";
-for(int l=0;l<xr.size();l++)
-{
-std::cout<<xr[l]<<"\n";
 
-}
 					}
 
 				if( noisy_ > 2)std::cerr << std::endl;
@@ -436,13 +367,6 @@

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list