
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Lisp exercises for homework set #5 in fall 2008, focusing on complex matrix operations and function definitions. Students are required to give a short description of the method or approach used, list each program, and provide at least three test cases for each function. Functions include cadd for adding complex matrices, ctransp for transposing complex matrices, mapc for mapping functions with premature stopping, allnums as a predicate for lists of numbers, and eqset as a predicate for set equality using mapc.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

EEL-5840 Hmwk 5
Fall 2008 Dr. Arroyo
(cadd '((1 2) (3 4)) '((5 6) (7 8))) > (cadd โ(((1 2) (3 4)) ((5 6) (7 8))) โ(((10 10) (10 10)) ((1 1) (1 1))) ) ( (6 8) (10 12) ) ( ((11 12) (13 14)) ((6 7) (8 9)) ) (cadd '((1 2) (3 4)) () ) > (cadd () '((1 2) (3 4)) ) () nil (cadd () () ) > (cadd '((1 2)) '((3 4))) nil ((4 6))
(ctransp '(((1 2) (3 -4)) ((5 6) (7 -8)))) > (ctransp () )
(((1 2) (5 6)) ((3 -4)) ((7 -8))) Nil
(ctransp '(((1 2) (3 4)) ((5 6) (7 8))) ) > (ctransp โ(((10 10) (10 10)) ((1 1) (1 1))) ) (((1 2) (5 6)) ((3 4)) ((7 8))) (((10 10) (1 1)) ((10 10)) ((1 1)))
Lisp> (ALLNUMS '(1 3 7)) ==> T
Lisp> (eqset '(a b c) '(b a) ) ==> Nil Lisp> (eqset '(a b) '(a b c) ) ==> Nil Lisp> (eqset '(a b c) '(b a c) ) ==> T Lisp> (eqset '(coke is it) '(is it coke) ) ==> T Lisp> (eqset '(inhuman acts are human mistakes) '(human acts are inhuman mistakes) ) ==> T
Lisp> (sort '(3 4 1 0)) ==> (4 3 1 0) Lisp> (sort '(1 5 3 2)) ==> (5 3 2 1) Lisp> (sort '(3 4 3 2 1 2)) ==> (4 3 3 2 2 1)