;;; Lisplab, matliap/mul.lisp ;;; Lapack-based matrix multiplicaiton ;;; Copyright (C) 2009 Joern Inge Vestgaarden ;;; ;;; This program is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2 of the License, or ;;; (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License along ;;; with this program; if not, write to the Free Software Foundation, Inc., ;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :lisplab) (defmethod m* ((a matrix-foreign-dge) (b matrix-foreign-dge)) (if cl-user::*lisplab-liblapack-path* (let* ((m (rows a)) (n (cols b)) (k (cols a)) (c (mcreate a 0 (list m n)))) (f77::dgemm "N" "N" m n k 1d0 (vector-store a) m (vector-store b) k 0d0 (vector-store c) m) c) (call-next-method))) (defmethod m* ((a matrix-foreign-zge) (b matrix-foreign-zge)) (if cl-user::*lisplab-liblapack-path* (let* ((m (rows a)) (n (cols b)) (k (cols a)) (c (mcreate a 0 (list m n)))) (f77::zgemm "N" "N" m n k #C(1d0 0d0) (vector-store a) m (vector-store b) k #C(0d0 0d0) (vector-store c) m) c) (call-next-method)))