Diana  0.8.3
CapeMatrix.hpp
00001 /* -----------------------------------------------------------------------------
00002  *  Diana process modelling, simulation and analysis software
00003  *  Copyright (c) 2005, Michael Krasnyk
00004  *  All rights reserved.
00005  *
00006  *  This file is a part of Diana process modelling, simulation and analysis software
00007  *
00008  *  Diana is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License as published
00010  *  by the Free Software Foundation (see accompanying file LICENSE)
00011  * -----------------------------------------------------------------------------
00012  *  $Id: CapeMatrix.hpp 8160 2009-03-16 18:36:30Z miha $
00013  * -----------------------------------------------------------------------------
00014  *  Description:
00015  */
00016 
00017 
00018 #ifndef CAPE_MATRIX_HPP
00019 #define CAPE_MATRIX_HPP
00020 
00021 #include "CapeTypes.hpp"
00022 #include "CapeException.hpp"
00023 #include "CapeBasic.hpp"
00024 
00029 namespace Numeric{
00030 
00034   namespace  Solvers {
00035 
00039     namespace  Eso{
00040 
00043       enum CapeMatrixType{
00044         CAPE_FULL,              
00045         CAPE_UNSTRUCTURED,      
00046         CAPE_BANDED             
00047       };
00048 
00050       enum CapeMatrixOrdering{
00051         CAPE_ROW,     
00052         CAPE_COLUMN,  
00053         CAPE_OTHER    
00054       };
00055 
00056 
00058       class ICapeNumericMatrix : public Common::Identification::ICapeIdentification {
00059       public:
00060 #ifndef SWIG
00061         virtual ~ICapeNumericMatrix(){}
00062 #endif
00063         
00065         virtual Common::Types::CapeLong GetNumRows() const 
00066           throw (Common::Error::ECapeUnknown) = 0;
00067 
00069         virtual Common::Types::CapeLong GetNumCols() const 
00070           throw (Common::Error::ECapeUnknown) = 0;
00071 
00075         virtual Common::Types::CapeBoolean QuerySymmetric() const 
00076           throw (Common::Error::ECapeUnknown) = 0;
00077 
00086         virtual CapeMatrixOrdering QueryOrdering() const 
00087           throw (Common::Error::ECapeUnknown) = 0;
00088 
00094         virtual CapeMatrixType QueryType() const 
00095           throw (Common::Error::ECapeUnknown) = 0;
00096 
00100         virtual const Common::Types::CapeArrayDouble& GetValues() const 
00101           throw (Common::Error::ECapeUnknown) = 0;
00102       };
00103 
00105       class ICapeNumericFullMatrix : public ICapeNumericMatrix {
00106       };
00107 
00109       class ICapeNumericUnstructuredMatrix : public ICapeNumericMatrix {
00110 #ifndef SWIG
00111 
00112         friend std::ostream& operator<<(std::ostream& os, const ICapeNumericUnstructuredMatrix& matrix);
00113 #endif
00114       public:
00119         virtual void GetStructure(Common::Types::CapeArrayLong& rowIndices,
00120                                   Common::Types::CapeArrayLong& colIndices) const 
00121           throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) = 0;
00122       };
00123 
00127       class ICapeNumericBandedMatrix : public ICapeNumericMatrix {
00130         virtual Common::Types::CapeLong GetBandWidth()
00131           throw (Common::Error::ECapeUnknown) = 0;
00132       };
00133 
00135       typedef std::vector<ICapeNumericMatrix> CapeArrayNumericMatrix;
00137       typedef std::vector<ICapeNumericFullMatrix> CapeArrayNumericFullMatrix;
00139       typedef std::vector<ICapeNumericUnstructuredMatrix> CapeArrayNumericUnstructuredMatrix;
00141       typedef std::vector<ICapeNumericBandedMatrix> CapeArrayNumericBandedMatrix;
00142     };
00143   };
00144 };
00145 
00146 #endif // CAPE_MATRIX_HPP