computation/interfaces/direct/Cholmod.hxx

00001 // Copyright (C) 2010 Marc Duruflé
00002 //
00003 // This file is part of the linear-algebra library Seldon,
00004 // http://seldon.sourceforge.net/.
00005 //
00006 // Seldon is free software; you can redistribute it and/or modify it under the
00007 // terms of the GNU Lesser General Public License as published by the Free
00008 // Software Foundation; either version 2.1 of the License, or (at your option)
00009 // any later version.
00010 //
00011 // Seldon is distributed in the hope that it will be useful, but WITHOUT ANY
00012 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
00014 // more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public License
00017 // along with Seldon. If not, see http://www.gnu.org/licenses/.
00018 
00019 
00020 #ifndef SELDON_FILE_CHOLMOD_HXX
00021 
00022 extern "C"
00023 {
00024 #include "cholmod.h"
00025 }
00026 
00027 
00028 namespace Seldon
00029 {
00030 
00032   class MatrixCholmod
00033   {
00034   protected :
00035     cholmod_common param_chol;
00036     cholmod_factor* L;
00037     int n;
00038 
00039   public :
00040     MatrixCholmod();
00041     ~MatrixCholmod();
00042 
00043     void Clear();
00044 
00045     template<class Prop, class Storage, class Allocator>
00046     void FactorizeMatrix(Matrix<double, Prop, Storage, Allocator> & mat,
00047                          bool keep_matrix = false);
00048 
00049     template<class Transpose_status, class Allocator>
00050     void Solve(const Transpose_status& TransA,
00051                Vector<double, VectFull, Allocator>& x);
00052   };
00053 
00054 }
00055 
00056 #define SELDON_FILE_CHOLMOD_HXX
00057 #endif
00058