From 37a4544014d73a4c118aa286b22f24aaa3f70f76 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 2 Oct 2024 18:16:31 +0000 Subject: [PATCH] build based on 2ab647c --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 2 +- dev/reference/index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index fe5254a..bcd382b 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-02T18:14:49","documenter_version":"1.1.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-02T18:16:29","documenter_version":"1.1.1"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 848bd18..6221566 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,4 +1,4 @@ Home · KrylovPreconditioners.jl

KrylovPreconditioners.jl documentation

This package provides a collection of preconditioners.

How to Cite

If you use KrylovPreconditioners.jl in your work, please cite using the format given in CITATION.cff.

How to Install

KrylovPreconditioners.jl can be installed and tested through the Julia package manager:

julia> ]
 pkg> add KrylovPreconditioners
-pkg> test KrylovPreconditioners

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

+pkg> test KrylovPreconditioners

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

diff --git a/dev/reference/index.html b/dev/reference/index.html index 5004e81..1faa609 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,7 +1,7 @@ -Reference · KrylovPreconditioners.jl

Reference

Index

Base.push!Method

For the L-factor: insert in row head column value For the U-factor: insert in column head row value

source
KrylovPreconditioners.add!Method

Sets v[idx] += a when idx is occupied, or sets v[idx] = a. Complexity is O(nnz). The prev_idx can be used to start the linear search at prev_idx, useful when multiple already sorted values are added.

source
KrylovPreconditioners.append_col!Function

Basically A[:, j] = scale * drop(y), where drop removes values less than drop. Note: sorts the nzind's of y, so that the column can be appended to a SparseMatrixCSC.

Resets the SparseVectorAccumulator.

Note: does not update A.colptr for columns > j + 1, as that is done during the steps.

source
KrylovPreconditioners.append_col!Method

Basically A[:, j] = scale * drop(y), where drop removes values less than drop.

Resets the InsertableSparseVector.

Note: does not update A.colptr for columns > j + 1, as that is done during the steps.

source
KrylovPreconditioners.backward_substitution!Method

Applies in-place backward substitution with the U factor of F, under the assumptions:

  1. U is stored transposed / row-wise
  2. U has no lower-triangular elements stored
  3. U has (nonzero) diagonal elements stored.
source
KrylovPreconditioners.overlapMethod
overlap(Graph, subset, level)

Given subset embedded within Graph, compute subset2 such that subset2 contains subset and all of its adjacent vertices.

source
KrylovPreconditioners.update!Method
function update!(p, J::SparseMatrixCSC)

Update the preconditioner p from the sparse Jacobian J in CSC format for the CPU

Note that this implements the same algorithm as for the GPU and becomes very slow on CPU with growing number of blocks.

source
LinearAlgebra.axpy!Method

Add a part of a SparseMatrixCSC column to a SparseVectorAccumulator, starting at a given index until the end.

source
SparseArrays.nnzMethod

Returns the number of nonzeros of the L and U factor combined.

Excludes the unit diagonal of the L factor, which is not stored.

source
KrylovPreconditioners.BlockJacobiPreconditionerType
BlockJacobiPreconditioner

Overlapping-Schwarz preconditioner.

Attributes

  • nblocks::Int64: Number of partitions or blocks.
  • blocksize::Int64: Size of each block.
  • partitions::Vector{Vector{Int64}}:npart` partitions stored as lists
  • cupartitions: partitions transfered to the GPU
  • lpartitions::Vector{Int64}`: Length of each partitions.
  • culpartitions::Vector{Int64}`: Length of each partitions, on the GPU.
  • blocks: Dense blocks of the block-Jacobi
  • cublocks: Js transfered to the GPU
  • map: The partitions as a mapping to construct views
  • cumap: cumap transferred to the GPU`
  • part: Partitioning as output by Metis
  • cupart: part transferred to the GPU
source
KrylovPreconditioners.InsertableSparseVectorType

InsertableSparseVector accumulates the sparse vector result from SpMV. Initialization requires O(N) work, therefore the data structure is reused. Insertion requires O(nnz) at worst, as insertion sort is used.

source
KrylovPreconditioners.LinkedListsType

The factor L is stored column-wise, but we need all nonzeros in row row. We already keep track of the first nonzero in each column (at most n indices). Take l = LinkedLists(n). Let l.head[row] be the column of some nonzero in row row. Then we can store the column of the next nonzero of row row in l.next[l.head[row]], etc. That "spot" is empty and there will never be a conflict because as long as we only store the first nonzero per column: the column is then a unique identifier.

source
KrylovPreconditioners.SortedSetType

SortedSet keeps track of a sorted set of integers ≤ N using insertion sort with a linked list structure in a pre-allocated vector. Requires O(N + 1) memory. Insertion goes via a linear scan in O(n) where n is the number of stored elements, but can be accelerated by passing along a known value in the set (which is useful when pushing in an already sorted list). The insertion itself requires O(1) operations due to the linked list structure. Provides iterators:

ints = SortedSet(10)
+Reference · KrylovPreconditioners.jl

Reference

Index

Base.push!Method

For the L-factor: insert in row head column value For the U-factor: insert in column head row value

source
KrylovPreconditioners.add!Method

Sets v[idx] += a when idx is occupied, or sets v[idx] = a. Complexity is O(nnz). The prev_idx can be used to start the linear search at prev_idx, useful when multiple already sorted values are added.

source
KrylovPreconditioners.append_col!Function

Basically A[:, j] = scale * drop(y), where drop removes values less than drop. Note: sorts the nzind's of y, so that the column can be appended to a SparseMatrixCSC.

Resets the SparseVectorAccumulator.

Note: does not update A.colptr for columns > j + 1, as that is done during the steps.

source
KrylovPreconditioners.append_col!Method

Basically A[:, j] = scale * drop(y), where drop removes values less than drop.

Resets the InsertableSparseVector.

Note: does not update A.colptr for columns > j + 1, as that is done during the steps.

source
KrylovPreconditioners.backward_substitution!Method

Applies in-place backward substitution with the U factor of F, under the assumptions:

  1. U is stored transposed / row-wise
  2. U has no lower-triangular elements stored
  3. U has (nonzero) diagonal elements stored.
source
KrylovPreconditioners.overlapMethod
overlap(Graph, subset, level)

Given subset embedded within Graph, compute subset2 such that subset2 contains subset and all of its adjacent vertices.

source
KrylovPreconditioners.update!Method
function update!(p, J::SparseMatrixCSC)

Update the preconditioner p from the sparse Jacobian J in CSC format for the CPU

Note that this implements the same algorithm as for the GPU and becomes very slow on CPU with growing number of blocks.

source
LinearAlgebra.axpy!Method

Add a part of a SparseMatrixCSC column to a SparseVectorAccumulator, starting at a given index until the end.

source
SparseArrays.nnzMethod

Returns the number of nonzeros of the L and U factor combined.

Excludes the unit diagonal of the L factor, which is not stored.

source
KrylovPreconditioners.BlockJacobiPreconditionerType
BlockJacobiPreconditioner

Overlapping-Schwarz preconditioner.

Attributes

  • nblocks::Int64: Number of partitions or blocks.
  • blocksize::Int64: Size of each block.
  • partitions::Vector{Vector{Int64}}:npart` partitions stored as lists
  • cupartitions: partitions transfered to the GPU
  • lpartitions::Vector{Int64}`: Length of each partitions.
  • culpartitions::Vector{Int64}`: Length of each partitions, on the GPU.
  • blocks: Dense blocks of the block-Jacobi
  • cublocks: Js transfered to the GPU
  • map: The partitions as a mapping to construct views
  • cumap: cumap transferred to the GPU`
  • part: Partitioning as output by Metis
  • cupart: part transferred to the GPU
source
KrylovPreconditioners.InsertableSparseVectorType

InsertableSparseVector accumulates the sparse vector result from SpMV. Initialization requires O(N) work, therefore the data structure is reused. Insertion requires O(nnz) at worst, as insertion sort is used.

source
KrylovPreconditioners.LinkedListsType

The factor L is stored column-wise, but we need all nonzeros in row row. We already keep track of the first nonzero in each column (at most n indices). Take l = LinkedLists(n). Let l.head[row] be the column of some nonzero in row row. Then we can store the column of the next nonzero of row row in l.next[l.head[row]], etc. That "spot" is empty and there will never be a conflict because as long as we only store the first nonzero per column: the column is then a unique identifier.

source
KrylovPreconditioners.SortedSetType

SortedSet keeps track of a sorted set of integers ≤ N using insertion sort with a linked list structure in a pre-allocated vector. Requires O(N + 1) memory. Insertion goes via a linear scan in O(n) where n is the number of stored elements, but can be accelerated by passing along a known value in the set (which is useful when pushing in an already sorted list). The insertion itself requires O(1) operations due to the linked list structure. Provides iterators:

ints = SortedSet(10)
 push!(ints, 5)
 push!(ints, 3)
 for value in ints
     println(value)
-end
source
+end
source