//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // 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 version 2 of the License. // // 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. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //===========================================================================
00001 #ifndef _SOLVECGCO_H_ 00002 #define _SOLVECGCO_H_ 00003 00004 00005 #include "GoTools/creators/SolveCG.h" 00006 00007 00008 // ----------------------------------------------------------------------- 00009 // Interface file for class SolveCGCO 00010 // ----------------------------------------------------------------------- 00011 // 00012 // Solve the equation system Ax=b where A is a symmetric 00013 // positive definite matrix using Conjugate Gradient Method. 00014 // Assuming A describes a constrained optimization problem, i.e. 00015 // (B^TB C^T) 00016 // A = ( ), 00017 // (C 0 ) 00018 // We create a block preconditioner using the CG preconditioner for the 00019 // upper left block, and a (currently) diagonal preconditioner to the 00020 // lower right. 00021 // 00022 // ----------------------------------------------------------------------- 00023 // Written by: Vibeke Skytt 09.99 00024 // Based on : PrCGCO.h written by Mike Floater 00025 // ----------------------------------------------------------------------- 00026 00027 namespace Go 00028 { 00029 00030 class SolveCGCO : public SolveCG 00031 { 00032 00033 public: 00034 00035 // Constructor. 00036 // m: size of original system. 00037 // n: number of constraints. 00038 SolveCGCO(int m, int n); 00039 00040 // Prepare for preconditioning. 00041 virtual void precondRILU(double relaxfac); 00042 00043 // Destructor. 00044 virtual ~SolveCGCO(); 00045 00046 00047 private: 00048 00049 00050 int m_; 00051 int n_; 00052 00053 }; 00054 00055 } // end namespace Go 00056 00057 #endif // _SOLVECGCO_H_