;;; Lisplab, level1-element.lisp ;;; Classes to help denoting element types ;;; 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) (defclass element-base () ((element-type :allocation :class :initform t :reader element-type) (element-type-class-name :allocation :class :initform 'element-base :reader element-type-class-name) (element-type-spec :allocation :class :initform :any :reader element-type-spec))) (defclass element-number (element-base) ((element-type :allocation :class :initform 'number :reader element-type) (element-type-class-name :allocation :class :initform 'element-number :reader element-type-class-name) (element-type-spec :allocation :class :initform :number :reader element-type-spec))) (defclass element-complex (element-number) ((element-type :allocation :class :initform 'complex :reader element-type) (element-type-class-name :allocation :class :initform 'element-complex :reader element-type-class-name) (element-type-spec :allocation :class :initform :complex :reader element-type-spec))) (defclass element-complex-double-float (element-complex) ((element-type :allocation :class :initform '(complex double-float) :reader element-type) (element-type-class-name :allocation :class :initform 'element-complex-double-float :reader element-type-class-name) (element-type-spec :allocation :class :initform :z :reader element-type-spec))) (defclass element-real (element-number) ((element-type :allocation :class :initform 'real :reader element-type) (element-type-class-name :allocation :class :initform 'element-real :reader element-type-class-name) (element-type-spec :allocation :class :initform :real :reader element-type-spec))) (defclass element-double-float (element-real) ((element-type :allocation :class :initform 'double-float :reader element-type) (element-type-class-name :allocation :class :initform 'element-double-float :reader element-type-class-name) (element-type-spec :allocation :class :initform :d :reader element-type-spec))) ;;;; Finite integer types (defclass element-idx (element-base) ((element-type :allocation :class :initform 'type-blas-idx :reader element-type) (element-type-class-name :allocation :class :initform 'element-idx :reader element-type-class-name) (element-type-spec :allocation :class :initform :idx :reader element-type-spec))) (defclass element-ub1 (element-base) ((element-type :allocation :class :initform '(unsigned-byte 1) :reader element-type) (element-type-class-name :allocation :class :initform 'element-ub1 :reader element-type-class-name) (element-type-spec :allocation :class :initform :ub1 :reader element-type-spec))) (defclass element-ub8 (element-base) ((element-type :allocation :class :initform '(unsigned-byte 8) :reader element-type) (element-type-class-name :allocation :class :initform 'element-ub8 :reader element-type-class-name) (element-type-spec :allocation :class :initform :ub8 :reader element-type-spec))) (defclass element-sb8 (element-base) ((element-type :allocation :class :initform '(signed-byte 8) :reader element-type) (element-type-class-name :allocation :class :initform 'element-sb8 :reader element-type-class-name) (element-type-spec :allocation :class :initform :sb8 :reader element-type-spec))) (defclass element-ub16 (element-base) ((element-type :allocation :class :initform '(unsigned-byte 16) :reader element-type) (element-type-class-name :allocation :class :initform 'element-ub16 :reader element-type-class-name) (element-type-spec :allocation :class :initform :ub16 :reader element-type-spec))) (defclass element-sb16 (element-base) ((element-type :allocation :class :initform '(signed-byte 16) :reader element-type) (element-type-class-name :allocation :class :initform 'element-sb16 :reader element-type-class-name) (element-type-spec :allocation :class :initform :sb16 :reader element-type-spec))) (defclass element-ub32 (element-base) ((element-type :allocation :class :initform '(unsigned-byte 32) :reader element-type) (element-type-class-name :allocation :class :initform 'element-ub32 :reader element-type-class-name) (element-type-spec :allocation :class :initform :ub32 :reader element-type-spec))) (defclass element-sb32 (element-base) ((element-type :allocation :class :initform '(signed-byte 32) :reader element-type) (element-type-class-name :allocation :class :initform 'element-sb32 :reader element-type-class-name) (element-type-spec :allocation :class :initform :sb32 :reader element-type-spec)))