Open orangeduck opened 9 years ago
Wow, that looks fantastic @sloisel just looking into some analysis libraries in the javascript world and some of the functionality here looks great for me to consider this. Are there any blocking issues for this to get merged?
Hi,
Here are the updates I've worked on to support broadcasting. As well as broadcasting I worked on allowing mapreduce functions to work over a specified axis. Also I have added a large number of new functions to the library covering a bunch of domains. My inspiration has been Numpy, so most of the new functions semantics are meant to match those of Numpy. If this isn't the case you can consider it a bug.
Now is the time for name changes if you can think of better names for any of my new functions please go ahead and re-name them. I've also not yet updated the version number.
I should mention so that you can get an idea of my use-case is that the reason I've contributed lots of these updates is because I'm working on a Javascript machine learning library using numeric and porting lots of code from Numpy.
Sorry that some of the commits are so messy. I made lots of changes which I later changed to something else or removed completely so the easiest file to examine might be
numeric.js
in the latest commit. I should have kept a change log but unfortunately I didn't. So here is a change log now. Hopefully I've not forgotten anything.numeric.pointwise
to support broadcasting. New interface is explained in documentation.numeric.mapreduce
to support folding over an axis. Main requirement now is that numeric functions are used, not JS operators. New method of using is also explained in documentation.numeric.inf
,numeric.sup
to documentation. Addednumeric.arginf
andnumeric.argsup
.numeric.mean
numeric.variance
numeric.std
numeric.empty
,numeric.ones
,numeric.zeros
for Array creation.numeric.range
,numeric.logspace
for Array creation.numeric.flatten
,numeric.reshape
,numeric.flip
,numeric.fliplr
,numeric.flipup
,numeric.rot90
,numeric.roll
,numeric.wrap
,numeric.concat
,numeric.stack
,numeric.hstack
,numeric.vstack
,numeric.dstack
for shape manipulation.numeric.slice
andnumeric.sliceeq
for accessing arrays using slice objectsnumeric.mask
andnumeric.maskeq
for accessing arrays using Boolean arraysnumeric.index
andnumeric.indexeq
for accessing arrays using Integer arraysnumeric.clip
andnumeric.saturate
functions to clip values to given rangenumeric.when
function to act like pointwise ternary operatorz = b ? x : y
numeric.bool
function to cast a JS value to a boolean valuey = !!x
numeric.inner
andnumeric.outer
numeric.kron
numeric.setDiag
numeric.pi
andnumeric.e