+
[](https://djukic14.github.io/BlockSparseMatrices.jl/stable/)
[](https://djukic14.github.io/BlockSparseMatrices.jl/dev/)
[](https://github.com/djukic14/BlockSparseMatrices.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://codecov.io/gh/djukic14/BlockSparseMatrices.jl)
+
+
+## Introduction
+This package provides an AbstractMatrix object that allows to construct sparse block matrices.
+
+## Installation
+The package can be installed by
+
+```@julia
+import Pkg
+Pkg.add("https://github.com/djukic14/BlockSparseMatrices.jl")
+```
\ No newline at end of file
diff --git a/docs/make.jl b/docs/make.jl
index 03e80cf..7f91a7c 100644
--- a/docs/make.jl
+++ b/docs/make.jl
@@ -14,7 +14,18 @@ makedocs(;
edit_link="main",
assets=String[],
),
- pages=["Home" => "index.md"],
+ pages=[
+ "Introduction" => "index.md",
+ "Manual" => "manual.md",
+ "Further Details" => "details.md",
+ "Contributing" => "contributing.md",
+ "API Reference" => "apiref.md",
+ ],
)
-deploydocs(; repo="github.com/djukic14/BlockSparseMatrices.jl", devbranch="main")
+deploydocs(;
+ repo="github.com/djukic14/BlockSparseMatrices.jl",
+ target="build",
+ #devbranch="dev",
+ versions=["stable" => "v^"],#=, "dev" => "dev"=#
+)
diff --git a/docs/src/apiref.md b/docs/src/apiref.md
new file mode 100644
index 0000000..e5add5b
--- /dev/null
+++ b/docs/src/apiref.md
@@ -0,0 +1,14 @@
+# API Reference
+
+## Types
+```@docs
+BlockSparseMatrices.BlockSparseMatrix
+BlockSparseMatrices.SymmetricBlockMatrix
+BlockSparseMatrices.DenseMatrixBlock
+```
+
+## Functions
+```@docs
+BlockSparseMatrices.findcolor!
+BlockSparseMatrices.islessinordering
+```
\ No newline at end of file
diff --git a/docs/src/assets/logo.svg b/docs/src/assets/logo.svg
new file mode 100644
index 0000000..4599475
--- /dev/null
+++ b/docs/src/assets/logo.svg
@@ -0,0 +1,191 @@
+
+
\ No newline at end of file
diff --git a/docs/src/assets/nocolor.svg b/docs/src/assets/nocolor.svg
new file mode 100644
index 0000000..8d9cff1
--- /dev/null
+++ b/docs/src/assets/nocolor.svg
@@ -0,0 +1,123 @@
+
+
\ No newline at end of file
diff --git a/docs/src/contributing.md b/docs/src/contributing.md
new file mode 100644
index 0000000..9189893
--- /dev/null
+++ b/docs/src/contributing.md
@@ -0,0 +1,55 @@
+# Contributing
+
+In order to contribute to this package directly create a pull request against the `main` branch. Before doing so please:
+
+- Follow the style of the surrounding code.
+- Supplement the documentation.
+- Write tests and check that no errors occur.
+
+
+---
+## Style
+
+For a consistent style the [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) package is used which enforces the style defined in the *.JuliaFormatter.toml* file. To follow this style simply run
+```julia
+using JuliaFormatter
+format(pkgdir(BlockSparseMatrices))
+```
+
+!!! note
+ That all files follow the JuliaFormatter style is tested during the unit tests. Hence, do not forget to execute the two lines above. Otherwise, the tests are likely to not pass.
+
+
+---
+## Documentation
+
+Add documentation for any changes or new features following the style of the existing documentation. For more information you can have a look at the [Documenter.jl](https://documenter.juliadocs.org/stable/) documentation.
+
+
+---
+## [Tests](@id tests)
+
+Write tests for your code changes and verify that no errors occur, e.g., by running
+```julia
+using Pkg
+Pkg.test("BlockSparseMatrices.jl")
+```
+For a detailed information on which parts are tested the coverage can be evaluated on your local machine, e.g., by
+```julia
+using Pkg
+Pkg.test("BlockSparseMatrices"; coverage=true, julia_args=["-t 4"])
+
+# determine coverage
+using Coverage
+src_folder = pkgdir(BlockSparseMatrices) * "/src"
+coverage = process_folder(src_folder)
+LCOV.writefile("path-to-folder-you-like" * "BlockSparseMatrices.lcov.info", coverage)
+
+clean_folder(src_folder) # delete .cov files
+
+# extract information about coverage
+covered_lines, total_lines = get_summary(coverage)
+@info "Current coverage:\n$covered_lines of $total_lines lines ($(round(Int, covered_lines / total_lines * 100)) %)"
+```
+
+In Visual Studio Code the [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) plugin can be used to visualize the tested lines of the code by inserting the path of the *BlockSparseMatrices.lcov.info* file in the settings.
\ No newline at end of file
diff --git a/docs/src/details.md b/docs/src/details.md
new file mode 100644
index 0000000..be64559
--- /dev/null
+++ b/docs/src/details.md
@@ -0,0 +1,36 @@
+
+# Further Details
+
+## Matrix-Vector Product
+For the multithreaded matrix-vector product
+
+$$\bm y = \bm A \bm x,$$
+
+where $\bm A$ is a `BlockSparseMatrix` or a `SymmetricBlockMatrix`, $\bm x$ a random vector, and $\bm y$ the solution vector, we use a coloring scheme to allow a multithreaded matrix-vector product without unnecessary allocations.
+Each block is assigned to one color such that all blocks of the same color do not share common row or column indices.
+This allows to evaluate all matrix-vector products within one color parallel without allocating multiple solution vectors $\bm y$.
+
+The coloring scheme works best for large numbers of dense blocks.
+
+The row and column indices of blocks should not be overlapping. Only unique sets of row and column indices are supported as well as row and column indices that are subsets of the indices of other blocks.
+
+### Example
+Example of the coloring scheme using four groups. Each color can be evaluated using multiple threads with a single solution vector
+
+```@raw html
+
+
+