You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE.md
+4
Original file line number
Diff line number
Diff line change
@@ -29,3 +29,7 @@ A "contributor" is any person that distributes its contribution under this licen
29
29
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30
30
31
31
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
32
+
33
+
34
+
35
+
Original portions of the code are licensed under the MIT license
Copy file name to clipboardExpand all lines: README.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -158,11 +158,12 @@ Contributions are what make the open source community such an amazing place to b
158
158
<!-- LICENSE -->
159
159
## License
160
160
161
-
Distributed under the MS-PL License. See [LICENSE](LICENSE.md) for more information.
161
+
The original code from Tamas Papp and Ben Dudson is licensed under the MIT license. Modifications by Symbolics are
162
+
distributed under the MS-PL License. See [LICENSE](LICENSE.md) for more information.
162
163
163
164
## Notes
164
165
165
-
Expect spurious warnings from SBCL related to 'deleting unreachable code' when running the tests. The tests it's warning about _do_ run and we haven't had the time to debug SBCL's warnings.
166
+
Expect spurious warnings from SBCL related to 'deleting unreachable code' when running the tests. The tests it's warning about _do_ run and we haven't had the time to debug SBCL's warnings. See issue #4.
The array-operations system is a collection of functions and macros for manipulating Common Lisp arrays and performing numerical calculations with them.
1
+
The array-operations system is a collection of functions and macros for manipulating Common Lisp arrays and performing numerical calculations with them. It is extendible to array-like data structures, such as data frames. It is a core system for solving linear systems of equations in common lisp.
2
2
3
3
Array-operations is a 'generic' way of operating on array like data structures using a syntax that is natural for Common Lisp. Several aops functions have been implemented for data-frame. For those that haven't, you can transform arrays to data frames using the df:matrix-df function, and a data-frame to an array using df:as-array. This make it convenient to work with the data sets using either system.
NOTE: If it's important that these numbers are really random
81
-
(e.g. cryptographic applications), then you should probably
82
-
not use this function.
83
-
"
89
+
NOTE: If it's important that these numbers are really random (e.g. cryptographic applications), then you should probably not use this function. "
84
90
(rand! (make-array (ensure-dimensions dimensions)
85
91
:element-type element-type)))
86
92
87
-
(defunrand (dimensions)
88
-
"Makes an array of shape DIMENSIONS and type T, filled with random numbers uniformly distributed between 0 and 1.
93
+
(defunrand (dimensions&optional element-type)
94
+
"Makes an array of shape DIMENSIONS filled with random numbers uniformly distributed between 0 and 1. Elements are of type T, unless ELEMENT-TYPE is given.
NOTE: If it's important that these numbers are really random
158
-
(e.g. cryptographic applications), then you should probably
159
-
not use this function.
160
-
"
161
-
(randn* t dimensions))
162
+
NOTE: If it's important that these numbers are really random (e.g. cryptographic applications), then you should probably not use this function."
163
+
(assert (subtypep element-type 'number)
164
+
(element-type)
165
+
"Cannot create a normal random array because ~A is not a numeric type." element-type)
166
+
(if element-type
167
+
(randn* element-type dimensions)
168
+
(randn* t dimensions)))
169
+
162
170
163
171
(defunlinspace! (array start stop)
164
-
"Fill an array with evenly spaced numbers over an interval.
165
-
The first element is equal to START and last element STOP,
166
-
with constant difference between consecutive elements in ROW-MAJOR-INDEX."
172
+
"Fill an array with evenly spaced numbers over an interval. The first element is equal to START and last element STOP, with constant difference between consecutive elements in ROW-MAJOR-INDEX."
167
173
(assert (> stop start) (start stop) "Stop must be greater than start.")
168
174
(let* ((size (array-total-sizearray))
169
175
(element-type (array-element-typearray))
@@ -174,21 +180,22 @@ Returns ARRAY."
174
180
array))
175
181
176
182
(defunlinspace* (element-type start stop n)
177
-
"Make a vector of N elements and type ELEMENT-TYPE, containing evenly spaced numbers over an interval.
178
-
The first element is equal to START and last element STOP,
179
-
with constant difference between consecutive elements."
183
+
"Make a vector of N elements and type ELEMENT-TYPE, containing evenly spaced numbers over an interval. The first element is equal to START and last element STOP, with constant difference between consecutive elements."
180
184
(linspace! (make-array n :element-type element-type) start stop))
181
185
182
-
(defunlinspace (start stop n)
183
-
"Make a vector of N elements and type T, containing evenly spaced numbers over an interval.
184
-
The first element is equal to START and last element STOP,
185
-
with constant difference between consecutive elements.
186
+
(defunlinspace (start stop n &optional element-type)
187
+
"Make a vector of N elements containing evenly spaced numbers over an interval. The first element is equal to START and last element STOP, with constant difference between consecutive elements. Elements are of type T, unless ELEMENT-TYPE is given
186
188
187
189
(linspace 0 4 5) -> #(0 1 2 3 4)
188
190
(linspace 1 3 5) -> #(0 1/2 1 3/2 2)
189
-
(linspace 0 4d0 3) -> #(0.0d0 2.0d0 4.0d0)
190
-
"
191
-
(linspace* t start stop n))
191
+
(linspace 0 4d0 3) -> #(0.0d0 2.0d0 4.0d0)"
192
+
(assert (subtypep element-type 'number)
193
+
(element-type)
194
+
"Cannot create a linear sequence of numbers because ~A is not a numeric type." element-type)
0 commit comments