00001 // This matrix class is a C++ wrapper for the GNU Scientific Library 00002 // Copyright (C) ULP-IPB Strasbourg 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2 of the License, or 00007 // (at your option) any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software 00016 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 00018 #ifndef __matrix_vector_operators_h 00019 #define __matrix_vector_operators_h 00020 00021 #include "gsl/gsl_blas.h" 00022 #include <gslwrap/matrix_double.h> 00023 #include <gslwrap/vector_double.h> 00024 00025 namespace gsl 00026 { 00027 00028 vector_float operator*(const matrix_float& m, const vector_float& v) 00029 { 00030 vector_float y(m.get_rows()); 00031 gsl_blas_sgemv(CblasNoTrans, 1.0, m.gslobj(), v.gslobj(), 0.0, y.gslobj()); 00032 return y; 00033 } 00034 00035 vector operator*(const matrix& m, const vector& v) 00036 { 00037 vector y(m.get_rows()); 00038 gsl_blas_dgemv(CblasNoTrans, 1.0, m.gslobj(), v.gslobj(), 0.0, y.gslobj()); 00039 return y; 00040 } 00041 00042 } 00043 00044 #endif //__matrix_vector_operators_h
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001