This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is an Ipython session (http://ipython.org/) | |
%run code/hw2.py | |
# generating the scatter plot for generateDataset(50,sin,0.03): | |
from numpy import sin; import pylab | |
data = generateDataset(50,sin,0.03) | |
scatter(data[0],data[1], marker='+', facecolor='g') | |
grid() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Copyright 2010 Yoav Goldberg | |
## | |
## This file is part of easyfirst | |
## | |
## easyfirst 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 3 of the License, or | |
## (at your option) any later version. | |
## | |
## easyfirst is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Copyright 2010 Yoav Goldberg | |
## | |
## This file is part of easyfirst | |
## | |
## easyfirst 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 3 of the License, or | |
## (at your option) any later version. | |
## | |
## easyfirst is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declaim (optimize (speed 3) (debug 0) (space 0) (safety 0))) | |
(defun build-btree (item depth) | |
(declare (fixnum item depth)) | |
(if (zerop depth) (list item) | |
(let ((item2 (+ item item)) | |
(depth-1 (1- depth))) | |
(declare (fixnum item2 depth-1)) | |
(cons item | |
(cons (build-btree (the fixnum (1- item2)) depth-1) |
OlderNewer