8 Commits

Author SHA1 Message Date
jos
73b774a51b Use safe map, forEach, join 2017-05-05 12:32:21 +02:00
Pat Grasso
df83968ec7 Add spec for reshape() in test/function/matrix
This spec tests `reshape()` with more cases than the one in
test/utils/array.test.js, including various types.

Also, in `_reshape()`, throw a brand new `DimensionError` instead of
modifying the caught one (the error message does not change when other
attributes are modified, as it is computed when the error is created).
2017-02-24 10:05:42 -05:00
patgrasso
431d58ac4e Fix issue with thrown exceptions on edge cases
Return DimensionError when `sizes = []` and a TypeError if either type
presented is incorrect.
2016-10-15 21:28:00 -04:00
patgrasso
014e0e3ec0 Introduce reshape() to utils.array
`reshape()` takes an n-d array and a list of sizes for each dimension,
and fits the data into the specified shape. If the product of the sizes
of the new dimensions does not match that of the old, a DimensionError
is thrown.
2016-10-15 20:36:23 -04:00
jos
e9eda030ee Fixed matrix.subset mutating the replacement matrix when unsqueezing it 2016-04-26 09:11:59 +02:00
jos
41949b2253 Fixed IndexError not always providing a max property 2016-02-29 20:41:52 +01:00
jos
e0c82f1b01 Removed a few redundant clone operations 2016-02-26 21:08:37 +01:00
jos
2353c4a61e Renamed folders util to utils 2015-07-18 13:22:38 +02:00