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: 2006/11/07 23:23:16 $
00007   Version:   $Revision: 1.13 $
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 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 
00189 
00190 
00192   integer m_MatrixFinalized;
00193 
00195   integer m_MatrixInitialized;
00196 
00198   integer m_N;
00199 
00201   integer m_NZ;
00202 
00204   integer *m_IA;
00205 
00207   integer *m_JA;
00208 
00210   doublereal *m_A;
00211 
00213   integer *m_IWORK;
00214 
00221   integer m_MODE;
00222 
00224   integer m_NOUT;
00225 
00233   integer m_LEVEL;
00234 
00242   //integer m_IER;
00243 };
00244 
00251 class FEMExceptionItpackSparseMatrixSbagn : public FEMException
00252 {
00253 public:
00254 
00256   typedef long      integer;
00257   typedef double    doublereal;
00258 
00264   FEMExceptionItpackSparseMatrixSbagn(const char *file, unsigned int lineNumber, std::string location, integer errorCode);
00265 
00267   virtual ~FEMExceptionItpackSparseMatrixSbagn() throw() {}
00268 
00270   itkTypeMacro(FEMExceptionItpackSparseMatrixSbagn,FEMException);
00271 
00272 };
00273 
00280 class FEMExceptionItpackSparseMatrixSbsij : public FEMException
00281 {
00282 public:
00283 
00285   typedef long      integer;
00286   typedef double    doublereal;
00287 
00293   FEMExceptionItpackSparseMatrixSbsij(const char *file, unsigned int lineNumber, std::string location, integer errorCode);
00294 
00296   virtual ~FEMExceptionItpackSparseMatrixSbsij() throw() {}
00297 
00299   itkTypeMacro(FEMExceptionItpackSparseMatrixSbsij,FEMException);
00300 
00301 };
00302 
00303 }} // end namespace itk::fem
00304 
00305 #endif
00306 
00307 

Generated at Tue Jul 29 20:00:53 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000