-result = C * tmp2</code></pre><p>i.e. inside the CG solver for solving <code>Sx = b</code> we use CG to solve another inner linear system.</p><h2 id="Philosophy"><a class="docs-heading-anchor" href="#Philosophy">Philosophy</a><a id="Philosophy-1"></a><a class="docs-heading-anchor-permalink" href="#Philosophy" title="Permalink"></a></h2><p>Several iterative linear algebra methods such as linear solvers or eigensolvers only require an efficient evaluation of the matrix-vector product, where the concept of a matrix can be formalized / generalized to a linear map (or linear operator in the special case of a square matrix).</p><p>The LinearMaps package provides the following functionality:</p><ol><li><p>A <code>LinearMap</code> type that shares with the <code>AbstractMatrix</code> type that it responds to the functions <code>size</code>, <code>eltype</code>, <code>isreal</code>, <code>issymmetric</code>, <code>ishermitian</code> and <code>isposdef</code>, <code>transpose</code> and <code>adjoint</code> and multiplication with a vector using both <code>*</code> or the in-place version <code>mul!</code>. Linear algebra functions that use duck-typing for their arguments can handle <code>LinearMap</code> objects similar to <code>AbstractMatrix</code> objects, provided that they can be written using the above methods. Unlike <code>AbstractMatrix</code> types, <code>LinearMap</code> objects cannot be indexed, neither using <code>getindex</code> or <code>setindex!</code>.</p></li><li><p>A single function <code>LinearMap</code> that acts as a general purpose constructor (though it is only an abstract type) and allows to construct linear map objects from functions, or to wrap objects of type <code>AbstractMatrix</code> or <code>LinearMap</code>. The latter functionality is useful to (re)define the properties (<code>isreal</code>, <code>issymmetric</code>, <code>ishermitian</code>, <code>isposdef</code>) of the existing matrix or linear map.</p></li><li><p>A framework for combining objects of type <code>LinearMap</code> and of type <code>AbstractMatrix</code> using linear combinations, transposition, composition, concatenation and Kronecker product/sums, where the linear map resulting from these operations is never explicitly evaluated but only its matrix-vector product is defined (i.e. lazy evaluation). The matrix-vector product is written to minimize memory allocation by using a minimal number of temporary vectors. There is full support for the in-place version <code>mul!</code>, which should be preferred for higher efficiency in critical algorithms. In addition, it tries to recognize the properties of combinations of linear maps. In particular, compositions such as <code>A'*A</code> for arbitrary <code>A</code> or even <code>A'*B*C*B'*A</code> with arbitrary <code>A</code> and <code>B</code> and positive definite <code>C</code> are recognized as being positive definite and hermitian. In case a certain property of the resulting <code>LinearMap</code> object is not correctly inferred, the <code>LinearMap</code> method can be called to redefine the properties.</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="history/">Version history »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.1 on <span class="colophon-date" title="Friday 21 February 2025 17:59">Friday 21 February 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0 commit comments