Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkFEMItpackSparseMatrix.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkFEMItpackSparseMatrix.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:42 $ 00007 Version: $Revision: 1.10 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __itkItpackSparseMatrix_h 00019 #define __itkItpackSparseMatrix_h 00020 00021 #include "itkFEMException.h" 00022 00023 00024 namespace itk { 00025 namespace fem { 00026 00034 // Forward declaration of friend class 00035 class ItpackLinearSystemWrapper; 00036 00037 class ItpackSparseMatrix 00038 { 00039 public: 00040 00042 typedef int integer; 00043 typedef double doublereal; 00044 00046 ItpackSparseMatrix(); 00047 00052 ItpackSparseMatrix(integer order); 00053 00054 00061 ItpackSparseMatrix(integer order, integer maxNonZeroValues); 00062 00066 ~ItpackSparseMatrix(); 00067 00073 void SetOrder(integer order) { m_N = order; } 00074 00080 void SetMaxNonZeroValues(integer maxNonZeroValues) { m_NZ = maxNonZeroValues; } 00081 00088 void Set(integer i, integer j, doublereal value); 00089 00096 void Add(integer i, integer j, doublereal value); 00097 00102 doublereal Get(integer i, integer j); 00103 00107 integer* GetN() { return &m_N; } 00108 00112 integer* GetIA(); 00113 00120 void SetCompressedRow(integer *ia, integer *ja, doublereal *a); 00124 integer* GetJA(); 00125 00129 doublereal* GetA(); 00130 00134 doublereal* GetValueArray() { return GetA(); } 00135 00139 integer* GetColumnArray() { return GetJA(); } 00140 00144 integer* GetRowArray() { return GetIA(); } 00145 00149 integer GetOrder() const { return m_N; } 00150 00154 integer GetMaxNonZeroValues() const { return m_NZ; } 00155 00159 void Clear(); 00160 00164 void mult(doublereal* vector, doublereal* result); 00165 00169 void mult(ItpackSparseMatrix* rightMatrix, ItpackSparseMatrix* resultMatrix); 00170 00172 void PrintCompressedRow(); 00173 00174 private: 00175 00177 friend class LinearSystemWrapperItpack; 00178 00180 void Initialize(); 00181 00183 void UnFinalize(); 00184 00186 void Finalize(); 00187 00188 00189 00191 integer m_MatrixFinalized; 00192 00194 integer m_MatrixInitialized; 00195 00197 integer m_N; 00198 00200 integer m_NZ; 00201 00203 integer *m_IA; 00204 00206 integer *m_JA; 00207 00209 doublereal *m_A; 00210 00212 integer *m_IWORK; 00213 00220 integer m_MODE; 00221 00223 integer m_NOUT; 00224 00232 integer m_LEVEL; 00233 00241 //integer m_IER; 00242 }; 00243 00250 class FEMExceptionItpackSparseMatrixSbagn : public FEMException 00251 { 00252 public: 00253 00255 typedef int integer; 00256 typedef double doublereal; 00257 00263 FEMExceptionItpackSparseMatrixSbagn(const char *file, unsigned int lineNumber, std::string location, integer errorCode); 00264 00266 virtual ~FEMExceptionItpackSparseMatrixSbagn() throw() {} 00267 00269 itkTypeMacro(FEMExceptionItpackSparseMatrixSbagn,FEMException); 00270 00271 }; 00272 00279 class FEMExceptionItpackSparseMatrixSbsij : public FEMException 00280 { 00281 public: 00283 typedef int integer; 00284 typedef double doublereal; 00285 00291 FEMExceptionItpackSparseMatrixSbsij(const char *file, unsigned int lineNumber, std::string location, integer errorCode); 00292 00294 virtual ~FEMExceptionItpackSparseMatrixSbsij() throw() {} 00295 00297 itkTypeMacro(FEMExceptionItpackSparseMatrixSbsij,FEMException); 00298 00299 }; 00300 00301 }} // end namespace itk::fem 00302 00303 #endif 00304

Generated at Sun Apr 1 02:28:21 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000