Mercurial > hg > may
view yetilab/block/block.yeti @ 208:9997752223b8 matrix_opaque_immutable
Start (experimentally) converting matrix to block-style opaque+functions instead of class with methods + extra functions
author | Chris Cannam |
---|---|
date | Tue, 07 May 2013 22:18:50 +0100 |
parents | 3f4f3af724b0 |
children |
line wrap: on
line source
module yetilab.block.block; vec = load yetilab.block.fvector; load yetilab.block.blocktype; //!!! doc: block provides no api to modify contents, though it can be done through data accessor... consider formalising this somehow { zeros = vec.zeros, consts = vec.consts, ones = vec.ones, block v = v, data b = b, vector b = vec.copyOf b, floats = vec.floats, fromFloats ff = vec.fromFloats ff, fromList l = vec.vector l, list = vec.list, length = vec.length, empty? = vec.empty?, equal = vec.equal, copyOf = vec.copyOf, rangeOf = vec.rangeOf, resizedTo = vec.resizedTo, concat = vec.concat, } as { zeros is number -> block, consts is number -> number -> block, ones is number -> block, block is ~double[] -> block, data is block -> ~double[], vector is block -> ~double[], floats is block -> ~float[], fromFloats is ~float[] -> block, fromList is list?<number> -> block, list is block -> list<number>, length is block -> number, empty? is block -> boolean, equal is block -> block -> boolean, copyOf is block -> block, rangeOf is number -> number -> block -> block, //!!! not well-named now block arg is at the end resizedTo is number -> block -> block, concat is list?<block> -> block, }