00001 //Copyright (c) 2004-2005, Baris Sumengen 00002 //All rights reserved. 00003 // 00004 // CIMPL Matrix Performance Library 00005 // 00006 //Redistribution and use in source and binary 00007 //forms, with or without modification, are 00008 //permitted provided that the following 00009 //conditions are met: 00010 // 00011 // * No commercial use is allowed. 00012 // This software can only be used 00013 // for non-commercial purposes. This 00014 // distribution is mainly intended for 00015 // academic research and teaching. 00016 // * Redistributions of source code must 00017 // retain the above copyright notice, this 00018 // list of conditions and the following 00019 // disclaimer. 00020 // * Redistributions of binary form must 00021 // mention the above copyright notice, this 00022 // list of conditions and the following 00023 // disclaimer in a clearly visible part 00024 // in associated product manual, 00025 // readme, and web site of the redistributed 00026 // software. 00027 // * Redistributions in binary form must 00028 // reproduce the above copyright notice, 00029 // this list of conditions and the 00030 // following disclaimer in the 00031 // documentation and/or other materials 00032 // provided with the distribution. 00033 // * The name of Baris Sumengen may not be 00034 // used to endorse or promote products 00035 // derived from this software without 00036 // specific prior written permission. 00037 // 00038 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 00039 //HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 00040 //EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 00041 //NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00042 //MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00043 //PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00044 //CONTRIBUTORS BE LIABLE FOR ANY 00045 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00046 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00047 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00048 //OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00049 //DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00050 //HOWEVER CAUSED AND ON ANY THEORY OF 00051 //LIABILITY, WHETHER IN CONTRACT, STRICT 00052 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00053 //OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00054 //OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00055 //POSSIBILITY OF SUCH DAMAGE. 00056 00057 00058 00059 #pragma once 00060 #ifndef SUBMATRIX_H 00061 #define SUBMATRIX_H 00062 00063 #include <iostream> 00064 00065 using std::cout; 00066 using std::cerr; 00067 using std::endl; 00068 00069 00070 #include "./cimpl.h" 00071 00072 namespace CIMPL 00073 { 00074 00075 00076 // forward declaration 00077 template< class T > class Matrix; 00078 template< class T > class Vector; 00079 template< class T > class Array; 00080 00082 template< class T > 00083 class SubMatrix 00084 { 00085 friend class Matrix<T>; 00086 friend class Vector<T>; 00087 00088 protected: 00089 Vector<T> *columns; 00090 Cleaner<T> *clean; 00091 int xDim; 00092 int yDim; 00093 00094 public: 00095 SubMatrix(void); 00096 SubMatrix(SubMatrix<T>& sm); 00097 ~SubMatrix(void); 00098 00099 const int Columns() const; 00100 const int Rows() const; 00101 const int XDim() const; 00102 const int YDim() const; 00103 00104 SubMatrix<T>& operator= (SubMatrix<T>& sm); 00105 SubMatrix<T>& operator= (Matrix<T>& m); 00106 00107 T& operator() (const int i, const int j); 00108 Vector<T>& operator[] (const int i); 00109 00110 00111 }; 00112 00113 00114 }; //namespace 00115 00116 00117 #include "./Submatrix.inl" 00118 00119 00120 00121 00122 #endif 00123
1.3.9.1