00001 #ifndef MATRIXFI_H 00002 #define MATRIXFI_H 00003 /*------------------------------------------------------------------------------ 00004 * matrixFI.h A simple, easy to use and efficient Matrix library. 00005 * Definition and partial implementation of class MatrixFI. 00006 * 00007 * Copyright 1997,1998,1999,2000 Roland Krause 00008 * ----------------------------------------------------------------------------- 00009 * RCS/CVS history of changes 00010 * 00011 * $Log: matrixFI.h,v $ 00012 * Revision 1.3 2000/11/09 18:41:31 rokrau 00013 * The first commit to the sourceforge repostory. Update of all 00014 * intermediate changes makes this the official repository from now on. 00015 * 00016 * Revision 1.3 2000/11/09 17:56:14 rokrau 00017 * "Virtual" constructor for a VectorI from rows and columns of MatrixFI. 00018 * 00019 * Revision 1.2 2000/10/27 17:08:09 rokrau 00020 * some fixes for integer matrices 00021 * 00022 * Revision 1.1 2000/10/24 06:03:04 rokrau 00023 * Split header files, made Ref constructor private w/ some drastic consequences for 00024 * Ref operators. A lot of minor changes. 00025 * 00026 * ----------------------------------------------------------------------------- 00027 * $Date: 2000/11/09 18:41:31 $ 00028 * $Revision: 1.3 $ 00029 * $Author: rokrau $ 00030 * $State: Exp $ 00031 * ----------------------------------------------------------------------------- 00032 */ 00033 // standard includes 00034 // project includes 00035 #include "matrix.h" 00036 #include "vectorI.h" 00037 // namespaces 00038 //using namespace std; 00039 #ifdef USE_NAMESPACE_LINAL 00040 namespace LinAl { 00041 #endif 00042 00050 class MatrixFI:public MatrixC<int> 00051 { 00052 public: 00054 00055 00056 explicit MatrixFI() : MatrixC<int>() {} 00058 explicit MatrixFI(const int nr, const int nc=1, const int value=0) 00059 : MatrixC<int>(nr,nc,value) {} 00061 MatrixFI(const MatrixC<int>& B) : MatrixC<int>(B) {} 00063 virtual ~MatrixFI() {} 00065 MatrixFI& operator= (const int value) {this->MatrixC<int>::operator=(value); return *this;} 00067 00071 00072 VectorI column(const int j) const { 00073 int nr=D->nrow; 00074 int *col=&THIS_CF(0,j); 00075 return VectorI(col,nr); 00076 } 00078 VectorI row(const int i) const { 00079 int nr=D->nrow,nc=D->ncol; 00080 VectorI V(nc); 00081 int *pV=V, *t=*this; 00082 for (int j=0;j<nc;++j) pV[j]=MAT_CF(t,nr,i,j); 00083 return V; 00084 } 00086 }; 00087 #ifdef USE_NAMESPACE_LINAL 00088 } // namespace LinAl 00089 #endif 00090 #endif // #ifndef MATRIXFI_H