Main Page   Class Hierarchy   Compound List   File List   Compound Members  

matrix_char.cpp

00001 /*=============================================================================
00002         File: matrix.cpp
00003      Purpose:       
00004     Revision: $Id: matrix_char.cpp,v 1.2 2002/05/13 21:07:45 philosophil Exp $
00005   Created by: Philippe Lavoie          (3 Oct, 1996)
00006  Modified by: 
00007 
00008  Copyright notice:
00009           Copyright (C) 1996-1998 Philippe Lavoie
00010  
00011           This library is free software; you can redistribute it and/or
00012           modify it under the terms of the GNU Library General Public
00013           License as published by the Free Software Foundation; either
00014           version 2 of the License, or (at your option) any later version.
00015  
00016           This library is distributed in the hope that it will be useful,
00017           but WITHOUT ANY WARRANTY; without even the implied warranty of
00018           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019           Library General Public License for more details.
00020  
00021           You should have received a copy of the GNU Library General Public
00022           License along with this library; if not, write to the Free
00023           Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024 =============================================================================*/
00025 
00026 #include "matrix.cpp"
00027 
00028 namespace PLib {
00029 
00030   Matrix<char>&
00031     Matrix<char>::operator*=(double a)
00032     {
00033       char *p1 ;
00034       p1 = m-1 ;
00035       const int size = rows()*cols() ;
00036       for(int i=size; i>0; --i){
00037         *p1 = (char)(a*double(*p1)) ;  
00038         ++p1 ; 
00039       }
00040       return *this ;
00041     }
00042   
00043   Matrix<char>&
00044     Matrix<char>::operator+=(double a)
00045     {
00046       char *p1 ;
00047       p1 = m-1 ;
00048       const int size = rows()*cols() ;
00049       for(int i=size; i>0; --i)
00050         *(++p1) += (char)a ;  
00051       return *this ;
00052     }
00053   
00054   Matrix<char>&
00055     Matrix<char>::operator-=(double a)
00056     {
00057       char *p1 ;
00058       p1 = m-1 ;
00059       const int size = rows()*cols() ;
00060       for(int i=size; i>0; --i)
00061         *(++p1) -= (char)a ;  
00062       return *this ;
00063     }
00064   
00065   Matrix<char>&
00066     Matrix<char>::operator/=(double a)
00067     {
00068       char *p1 ;
00069       p1 = m-1 ;
00070       const int size = rows()*cols() ;
00071       for(int i=size; i>0; --i){
00072         *p1 = (char)(double(*p1)/a) ;  
00073         ++p1 ; 
00074       }
00075       return *this ;
00076     }
00077   
00078   
00079 
00080 #ifdef NO_IMPLICIT_TEMPLATES
00081   
00082   template class Matrix<char> ;
00083 
00084   template Matrix<char> operator+(const Matrix<char>&,const Matrix<char>&);
00085   template Matrix<char> operator-(const Matrix<char>&,const Matrix<char>&);
00086   template Matrix<char> operator*(const Matrix<char>&,const Matrix<char>&);
00087   template Matrix<char> operator*(const double,const Matrix<char>&);
00088   template Matrix<char> operator*(const Complex&,const Matrix<char>&);
00089   template Vector<char> operator*(const Matrix<char>&,const Vector<char>&);
00090   //template int operator!=(const Matrix<char>&,const Matrix<char>&);
00091   template int operator==(const Matrix<char>&,const Matrix<char>&);
00092   template Matrix<char> comm(const Matrix<char>&,const Matrix<char>&);
00093  
00094 #endif
00095 
00096 }

Generated on Tue Jun 24 13:26:55 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002