Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Extended map-column to handle vectors.

  • Loading branch information...
commit 96db888a8d2c4f9cf84f779dcdbebfce63547afa 1 parent e29b741
tpapp authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 src/array.lisp
7 src/array.lisp
@@ -544,7 +544,12 @@ instead of a matrix.")
544 544 (if result-nrow
545 545 (setf (sub result t col-index) mapped-col)
546 546 (setf (aref result col-index) mapped-col))))
547   - result)))
  547 + result))
  548 + (:method (function (vector vector) &key element-type)
  549 + ;; FIXME ugly hack, forming a vector then extracting an element is not
  550 + ;; really elegant
  551 + (map-columns (lambda (c) (funcall function (aref c 0)))
  552 + (as-row vector) :element-type element-type)))
548 553
549 554 (defgeneric map-rows (function object &key element-type &allow-other-keys)
550 555 (:documentation "Map rows of object (eg a matrix) using FUNCTION.")

0 comments on commit 96db888

Please sign in to comment.
Something went wrong with that request. Please try again.