00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: MemoryManagerOptions.hpp,v 1.3 2007/06/09 10:37:07 delpinux Exp $ 00019 00020 #ifndef _MEMORY_MANAGER_OTIONS_HPP_ 00021 #define _MEMORY_MANAGER_OTIONS_HPP_ 00022 00023 class MemoryManagerOptions 00024 : public ParametrizableObject 00025 { 00026 private: 00027 std::ostream& put(std::ostream& os) const 00028 { 00029 os << this->identifier(); 00030 return os; 00031 } 00032 00033 public: 00034 enum MatrixType { 00035 none, 00036 sparse 00037 }; 00038 00039 static const char* identifier() 00040 { 00041 // autodoc: "sets memory management options" 00042 return "memory"; 00043 } 00044 00045 MatrixType matrixType() 00046 { 00047 MemoryManagerOptions::MatrixType __t = none; 00048 get("matrix", __t); 00049 return __t; 00050 } 00051 00052 explicit MemoryManagerOptions() 00053 { 00054 // autodoc: "sets matrix type" 00055 EnumParameter<MatrixType>* E 00056 = new EnumParameter<MatrixType>(MemoryManagerOptions::sparse, 00057 "matrix"); 00058 00059 // autodoc: "used for sparse matrices, cost is approximatly $27\times n_v\times {n_u}^2$, where $n_v$ is the number of vertices and $n_u$ the number of unknown (for a $Q_1$ discretization)" 00060 (*E).addSwitch("sparse", 00061 MemoryManagerOptions::sparse); 00062 00063 // autodoc: "do not store the matrix. Cost no memory, but is slower" 00064 (*E).addSwitch("none", 00065 MemoryManagerOptions::none); 00066 add(E); 00067 } 00068 }; 00069 00070 #endif // _MEMORY_MANAGER_OTIONS_HPP_ 00071
1.5.6