Package pycv :: Package cs :: Package linalg :: Module blas
[hide private]
[frames] | no frames]

Source Code for Module pycv.cs.linalg.blas

 1  # PyCV - A Computer Vision Package for Python Incorporating Fast Training of Face Detection 
 2   
 3  # Copyright 2007 Nanyang Technological University, Singapore. 
 4  # Authors: Minh-Tri Pham, Viet-Dung D. Hoang, and Tat-Jen Cham. 
 5   
 6  # This file is part of PyCV. 
 7   
 8  # PyCV is free software: you can redistribute it and/or modify 
 9  # it under the terms of the GNU General Public  
10  # License as published by the Free Software Foundation, either version  
11  # 3 of the License, or (at your option) any later version. 
12   
13  # PyCV is distributed in the hope that it will be useful, 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  # GNU General Public License for more details. 
17   
18  # You should have received a copy of the GNU General Public License 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
20   
21  # --------------------------------------------------------------------- 
22  #!/usr/bin/env python 
23   
24   
25  __all__ = ['dger', 'daxpy'] 
26   
27  try: 
28      from scipy.lib.blas.fblas import daxpy, dger 
29  except ImportError: 
30      # Make this usable by people who don't have BLAS installed 
31      from numpy import multiply 
32           
33 - def daxpy(x,y,n=(len(x)-offx)/abs(incx),a=1.0,offx=0,incx=1,offy=0,incy=1):
34 """Return a*x+y, ignoring all other parameters.""" 35 return a*x+y
36 - def dger(alpha,x,y,incx=1,incy=1,a=0.0,overwrite_x=1,overwrite_y=1,overwrite_a=0):
37 """Return alpha*multiply.outer(x,y)+a, ignoring all other paramters.""" 38 if a == 0.0: 39 return alpha*multiply.outer(x,y) 40 return alpha*multiply.outer(x,y)+a
41