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: 2009-01-29 21:55:13 $
00007   Version:   $Revision: 1.14 $
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 __itkFEMItpackSparseMatrix_h
00019 #define __itkFEMItpackSparseMatrix_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 long      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);
00121 
00125   integer*     GetJA();
00126 
00130   doublereal*  GetA();
00131 
00135   doublereal* GetValueArray()       { return GetA();  }
00136 
00140   integer*    GetColumnArray()      { return GetJA(); }
00141 
00145   integer*    GetRowArray()         { return GetIA(); }
00146 
00150   integer     GetOrder()       const     { return m_N; }
00151 
00155   integer     GetMaxNonZeroValues() const { return m_NZ; }
00156 
00160   void Clear();
00161 
00165   void mult(doublereal* vector, doublereal* result);
00166 
00170   void mult(ItpackSparseMatrix* rightMatrix, ItpackSparseMatrix* resultMatrix);
00171 
00173   void PrintCompressedRow();
00174 
00175 private:
00176 
00178   friend class LinearSystemWrapperItpack;
00179 
00181   void Initialize();
00182 
00184   void UnFinalize();
00185 
00187   void Finalize();
00188 
00190   integer m_MatrixFinalized;
00191 
00193   integer m_MatrixInitialized;
00194 
00196   integer m_N;
00197 
00199   integer m_NZ;
00200 
00202   integer *m_IA;
00203 
00205   integer *m_JA;
00206 
00208   doublereal *m_A;
00209 
00211   integer *m_IWORK;
00212 
00219   integer m_MODE;
00220 
00222   integer m_NOUT;
00223 
00231   integer m_LEVEL;
00232 
00240   //integer m_IER;
00241 };
00242 
00249 class FEMExceptionItpackSparseMatrixSbagn : public FEMException
00250 {
00251 public:
00252 
00254   typedef long      integer;
00255   typedef double    doublereal;
00256 
00262   FEMExceptionItpackSparseMatrixSbagn(const char *file, unsigned int lineNumber, std::string location, integer errorCode);
00263 
00265   virtual ~FEMExceptionItpackSparseMatrixSbagn() throw() {}
00266 
00268   itkTypeMacro(FEMExceptionItpackSparseMatrixSbagn,FEMException);
00269 
00270 };
00271 
00278 class FEMExceptionItpackSparseMatrixSbsij : public FEMException
00279 {
00280 public:
00281 
00283   typedef long      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 Tue Sep 15 02:55:26 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000