diff --git a/README.md b/README.md index 7917cc9e..6f64f720 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,25 @@ Generic Numerical Library for Science and Machine Learning. Contents -------- - - `mir.ndslice` [Multidimensional Random Access Ranges and Arrays](http://dlang.org/phobos-prerelease/std_experimental_ndslice.html) - - `mir.las.sum` Functions and Output Ranges for Summation Algorithms. Works with user-defined types. - - Precise algorithm: improved analog of Python's `fsum` - - Pairwise algorithm: fast version for Input Ranges - - Kahan, KBN, and KB2 algorithms - - `mir.combinatorics` Combinations, combinations with repeats, cartesian power, permutations. +- `mir.ndslice` [Multidimensional Random Access Ranges and Arrays](http://dlang.org/phobos-prerelease/std_experimental_ndslice.html) +- `mir.sparse` Sparse Tensors + - `Sparse` - DOK format + - Different ranges for COO format + - `CompressedTensor` - CSR/CSC formats +- `mir.sparse.blas` - Sparse BLAS for `CompressedTensor` +- `mir.model.lda.hoffman` - Online variational Bayes for latent Dirichlet allocation (Online VB LDA) for sparse documents. LDA is used for topic modeling. +- `mir.combinatorics` Combinations, combinations with repeats, cartesian power, permutations. +- `mir.las.sum` Functions and Output Ranges for Summation Algorithms. Works with user-defined types. + - Precise algorithm: improved analog of Python's `fsum` + - Pairwise algorithm: fast version for Input Ranges + - Kahan, KBN, and KB2 algorithms +- `mir.blas` - this is slow snail, it is for experiments with BLAS API. Don't use for now. + ### In progress - - `mir.sparse` Sparse Tensors (see sparse branch and `v0.15.1-beta2`+) - - `mir.sparse.blas` Spars BLAS + - `mir.random` - non-uniform RNGs. + - `mir.blas` - BLAS in D. Documentation ------------- diff --git a/index.d b/index.d index 10bb05e2..7d731dca 100644 --- a/index.d +++ b/index.d @@ -1,23 +1,4 @@ /** Numerical library and mirror for upcoming numeric packages for the Dlang standard library. - -$(DL - $(DT $(LINK2 http://dlang.org/phobos-prerelease/std_experimental_ndslice.html, ndslice package) - $(DD Multidimensional Random Access Ranges and Arrays) - ) - $(DT $(DPMODULE2 las, sum) - $(DD Functions and Output Ranges for Summation Algorithms. Works with user-defined types.) - $(DD Precise algorithm: improved analog of Python's `fsum`) - $(DD Pairwise algorithm: fast version for Input Ranges) - $(DD Kahan, KBN, and KB2 algorithms) - ) - $(DT $(DPMODULE2 combinatorics, package) - $(DD $(DPREF2 combinatorics, package, permutations)) - $(DD $(DPREF2 combinatorics, package, cartesianPower)) - $(DD $(DPREF2 combinatorics, package, combinations)) - $(DD $(DPREF2 combinatorics, package, combinationsRepeat)) - ) -) - */ module mir; diff --git a/modules.ddoc b/modules.ddoc index 2099e9d8..feb61cf9 100644 --- a/modules.ddoc +++ b/modules.ddoc @@ -6,3 +6,4 @@ MODULES = $(MODULE mir.sparse.blas.gemv) $(MODULE mir.sparse.blas.gemm) $(MODULE mir.combinatorics.package) + $(MODULE mir.model.lda.hoffman) diff --git a/source/mir/sparse/package.d b/source/mir/sparse/package.d index 06368361..fd74bd5e 100644 --- a/source/mir/sparse/package.d +++ b/source/mir/sparse/package.d @@ -1,9 +1,6 @@ /++ $(H2 Sparse Tensors) -This is a submodule of $(LINK2 mir_ndslice.html, mir.ndslice). - - License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Ilya Yaroshenko @@ -84,7 +81,7 @@ Sparse Slice in Dictionary of Keys (DOK) format. alias Sparse(size_t N, T) = Slice!(N, SparseMap!T); /++ -SparseMap is a range, which is used internally by $(LREF Sparse). +`SparseMap` is used internally by `Slice` type to represent $(LREF Sparse). +/ struct SparseMap(T) { @@ -197,7 +194,7 @@ private sizediff_t cmpCoo(size_t N)(const auto ref size_t[N] a, const auto ref s } /++ -Returns unsorted range of (coordinate, values) pairs. +Returns unsorted forward range of (coordinate, value) pairs. Params: slice = sparse slice with pure structure. Any operations on structure of a slice are not allowed. +/ @@ -256,7 +253,7 @@ pure unittest } /++ -Returns unsorted range of coordinates. +Returns unsorted forward range of coordinates. Params: slice = sparse slice with pure structure. Any operations on structure of a slice are not allowed. +/ @@ -312,7 +309,7 @@ pure unittest } /++ -Returns unsorted range of values. +Returns unsorted forward range of values. Params: slice = sparse slice with pure structure. Any operations on structure of a slice are not allowed. +/ @@ -459,7 +456,7 @@ unittest } /++ -Returns compressed tensor with changed element type. +Returns compressed tensor with different element type. +/ CompressedTensor!(N, V, I, J) compressWithType @@ -553,7 +550,7 @@ CompressedTensor!(N, V, I, J) /++ -Re-compress already compressed tensor. Makes it consequent in memory. +Re-compresses a compressed tensor. Makes all values, indexes and pointers consequent in memory. +/ CompressedTensor!(N + 1, V, I, J) recompress @@ -590,7 +587,7 @@ CompressedTensor!(N + 1, V, I, J) return m.sliced(slice.shape); } -/// Compresstion of compressed tensor +/// unittest { auto slice = slice!double(5, 8); @@ -618,10 +615,16 @@ unittest } /++ +`CompressedTensor!(N, T, I, J)` is `Slice!(N - 1, CompressedMap!(T, I, J))`. + +See_also: $(LREF CompressedMap) +/ alias CompressedTensor(size_t N, T, I = uint, J = size_t) = Slice!(N - 1, CompressedMap!(T, I, J)); /++ +Compressed array is just a structure of values array and indexes array. + +See_also: $(LREF CompressedTensor), $(LREF CompressedMap) +/ struct CompressedArray(T, I = uint) if (is(I : size_t) && isUnsigned!I) @@ -636,6 +639,7 @@ struct CompressedArray(T, I = uint) } /++ +`CompressedMap` is used internally by `Slice` type to represent $(LREF CompressedTensor). +/ struct CompressedMap(T, I = uint, J = size_t) if (is(I : size_t) && isUnsigned!I && is(J : size_t) && isUnsigned!J && I.sizeof <= J.sizeof)