<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Search · HYPRE.jl</title><scriptdata-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://fredrikekre.github.io/HYPRE.jl/stable/search/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">HYPRE.jl</a></span></div><formclass="docs-search"action><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Home</a></li><li><aclass="tocitem"href="../matrix-vector/">Matrix/vector representation</a></li><li><aclass="tocitem"href="../solvers-preconditioners/">Solvers and preconditioners</a></li><li><aclass="tocitem"href="../libhypre/">LibHYPRE C API</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Search</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Search</a></li></ul></nav><divclass="docs-right"><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl"title="View the repository on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">GitHub</span></a><aclass="docs-settings-button docs-navbar-link fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button docs-navbar-link fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><article><pid="documenter-search-info">Loading search...</p><ulid="documenter-search-results"></ul></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.28.0-DEV on <spanclass="colophon-date"title="Thursday 28 July 2022 15:33">Thursday 28 July 2022</span>. Using Julia version 1.7.3.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body><scriptsrc="../search_index.js"></script><scriptsrc="../assets/search.js"></script></html>
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Search · HYPRE.jl</title><scriptdata-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://fredrikekre.github.io/HYPRE.jl/stable/search/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">HYPRE.jl</a></span></div><formclass="docs-search"action><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Home</a></li><li><aclass="tocitem"href="../matrix-vector/">Matrix/vector representation</a></li><li><aclass="tocitem"href="../solvers-preconditioners/">Solvers and preconditioners</a></li><li><aclass="tocitem"href="../libhypre/">LibHYPRE C API</a></li><li><aclass="tocitem"href="../api/">API</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Search</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Search</a></li></ul></nav><divclass="docs-right"><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl"title="View the repository on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">GitHub</span></a><aclass="docs-settings-button docs-navbar-link fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button docs-navbar-link fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><article><pid="documenter-search-info">Loading search...</p><ulid="documenter-search-results"></ul></article><navclass="docs-footer"><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.28.0-DEV on <spanclass="colophon-date"title="Thursday 28 July 2022 19:11">Thursday 28 July 2022</span>. Using Julia version 1.7.3.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body><scriptsrc="../search_index.js"></script><scriptsrc="../assets/search.js"></script></html>
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Solvers and preconditioners · HYPRE.jl</title><scriptdata-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://fredrikekre.github.io/HYPRE.jl/stable/solvers-preconditioners/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">HYPRE.jl</a></span></div><formclass="docs-search"action="../search/"><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Home</a></li><li><aclass="tocitem"href="../matrix-vector/">Matrix/vector representation</a></li><liclass="is-active"><aclass="tocitem"href>Solvers and preconditioners</a></li><li><aclass="tocitem"href="../libhypre/">LibHYPRE C API</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Solvers and preconditioners</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Solvers and preconditioners</a></li></ul></nav><divclass="docs-right"><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl"title="View the repository on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">GitHub</span></a><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl/blob/master/docs/src/solvers-preconditioners.md"title="Edit source on GitHub"><spanclass="docs-icon fas"></span></a><aclass="docs-settings-button docs-navbar-link fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button docs-navbar-link fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><articleclass="content"id="documenter-page"><h1id="Solvers-and-preconditioners"><aclass="docs-heading-anchor"href="#Solvers-and-preconditioners">Solvers and preconditioners</a><aid="Solvers-and-preconditioners-1"></a><aclass="docs-heading-anchor-permalink"href="#Solvers-and-preconditioners"title="Permalink"></a></h1><p>HYPRE.jl wraps most of HYPREs <ahref="https://hypre.readthedocs.io/en/latest/api-sol-parcsr.html">ParCSR solvers and preconditioners</a>.</p><p>The synopsis for HYPRE.jl's wrappers is the same for all solvers:</p><pre><codeclass="language-julia hljs"># Setup up linear system (see previous section)
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Solvers and preconditioners · HYPRE.jl</title><scriptdata-outdated-warnersrc="../assets/warner.js"></script><linkrel="canonical"href="https://fredrikekre.github.io/HYPRE.jl/stable/solvers-preconditioners/"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">HYPRE.jl</a></span></div><formclass="docs-search"action="../search/"><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Home</a></li><li><aclass="tocitem"href="../matrix-vector/">Matrix/vector representation</a></li><liclass="is-active"><aclass="tocitem"href>Solvers and preconditioners</a></li><li><aclass="tocitem"href="../libhypre/">LibHYPRE C API</a></li><li><aclass="tocitem"href="../api/">API</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><liclass="is-active"><ahref>Solvers and preconditioners</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Solvers and preconditioners</a></li></ul></nav><divclass="docs-right"><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl"title="View the repository on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">GitHub</span></a><aclass="docs-navbar-link"href="https://github.com/fredrikekre/HYPRE.jl/blob/master/docs/src/solvers-preconditioners.md"title="Edit source on GitHub"><spanclass="docs-icon fas"></span></a><aclass="docs-settings-button docs-navbar-link fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button docs-navbar-link fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><articleclass="content"id="documenter-page"><h1id="Solvers-and-preconditioners"><aclass="docs-heading-anchor"href="#Solvers-and-preconditioners">Solvers and preconditioners</a><aid="Solvers-and-preconditioners-1"></a><aclass="docs-heading-anchor-permalink"href="#Solvers-and-preconditioners"title="Permalink"></a></h1><p>HYPRE.jl wraps most of HYPREs <ahref="https://hypre.readthedocs.io/en/latest/api-sol-parcsr.html">ParCSR solvers and preconditioners</a>.</p><p>The synopsis for creating and using HYPRE.jl's solver wrappers is the same for all solvers:</p><ol><li>Set up the linear system (see<ahref="../matrix-vector/#Matrix/vector-representation">Matrix/vector representation</a>)</li><li>(Optional) Configure a preconditioner</li><li>Configure a solver</li><li>Use <ahref="../api/#HYPRE.solve"><code>HYPRE.solve</code></a> or <ahref="../api/#HYPRE.solve!"><code>HYPRE.solve!</code></a> to solve the system</li></ol><p>Here is the corresponding pseudo-code:</p><pre><codeclass="language-julia hljs"># 1. Setup up linear system
A = HYPREMatrix(...)
A = HYPREMatrix(...)
b = HYPREVector(...)
b = HYPREVector(...)
# Create a solver
# 2. Configure a preconditioner
solver = HYPRESolver(; settings...)
precond = HYPRESolver(; settings...)
# Solve A x = b
# 3. Configure a solver
x = HYPRE.solve(solver, A, b)</code></pre><p>Settings are passed as keyword arguments, with the names matching directly to <code>HYPRE_SolverSetXXX</code> calls from the HYPRE C API (see example below). Most settings are passed directly to HYPRE, for example <code>Tol = 1e-9</code> would be passed directly to <code>HYPRE_SolverSetTol</code> for the correponding solver.</p><p>Setting a preconditioner can be done by passing a <code>HYPRESolver</code> directly with the <code>Precond</code> keyword argument, without any need to also pass the corresponding <code>HYPRE_SolverSetup</code> and <code>HYPRE_SolverSolve</code> as must be done in the C API. In addition, solvers that have required settings when used as a preconditioner will have those applied automatically.</p><p>HYPRE.jl adds finalizers to the solvers, which takes care of calling the their respective <code>HYPRE_SolverDestroy</code> function when the solver is garbage collected.</p><h4id="Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner"><aclass="docs-heading-anchor"href="#Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner">Example: Conjugate gradient with algebraic multigrid preconditioner</a><aid="Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner-1"></a><aclass="docs-heading-anchor-permalink"href="#Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner"title="Permalink"></a></h4><p>Here is an example of creating a <code>PCG</code> (conjugate gradient) solver with <code>BoomerAMG</code> (algebraic multigrid) as preconditioner:</p><pre><codeclass="language-julia hljs"># Setup up linear system
x = HYPRE.solve(solver, A, b)</code></pre><p>The following solvers/preconditioners are currently available:</p><ul><li><ahref="../api/#HYPRE.BiCGSTAB"><code>HYPRE.BiCGSTAB</code></a></li><li><ahref="../api/#HYPRE.BoomerAMG"><code>HYPRE.BoomerAMG</code></a></li><li><ahref="../api/#HYPRE.FlexGMRES"><code>HYPRE.FlexGMRES</code></a></li><li><ahref="../api/#HYPRE.GMRES"><code>HYPRE.GMRES</code></a></li><li><ahref="../api/#HYPRE.Hybrid"><code>HYPRE.Hybrid</code></a></li><li><ahref="../api/#HYPRE.ILU"><code>HYPRE.ILU</code></a></li><li><ahref="../api/#HYPRE.ParaSails"><code>HYPRE.ParaSails</code></a></li><li><ahref="../api/#HYPRE.PCG"><code>HYPRE.PCG</code></a></li></ul><h3id="Solver-configuration"><aclass="docs-heading-anchor"href="#Solver-configuration">Solver configuration</a><aid="Solver-configuration-1"></a><aclass="docs-heading-anchor-permalink"href="#Solver-configuration"title="Permalink"></a></h3><p>Settings are passed as keyword arguments, with the names matching directly to <code>HYPRE_SolverSet*</code> calls from the HYPRE C API (see example below). Most settings are passed directly to HYPRE, for example <code>Tol = 1e-9</code> would be passed directly to <code>HYPRE_SolverSetTol</code> for the correponding solver.</p><p>Setting a preconditioner can be done by passing a <code>HYPRESolver</code> directly with the <code>Precond</code> keyword argument, without any need to also pass the corresponding <code>HYPRE_SolverSetup</code> and <code>HYPRE_SolverSolve</code> as must be done in the C API. In addition, solvers that have required settings when used as a preconditioner will have those applied automatically.</p><p>HYPRE.jl adds finalizers to the solvers, which takes care of calling the their respective <code>HYPRE_SolverDestroy</code> function when the solver is garbage collected.</p><h4id="Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner"><aclass="docs-heading-anchor"href="#Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner">Example: Conjugate gradient with algebraic multigrid preconditioner</a><aid="Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner-1"></a><aclass="docs-heading-anchor-permalink"href="#Example:-Conjugate-gradient-with-algebraic-multigrid-preconditioner"title="Permalink"></a></h4><p>Here is an example of creating a <code>PCG</code> (conjugate gradient) solver with <code>BoomerAMG</code> (algebraic multigrid) as preconditioner:</p><pre><codeclass="language-julia hljs"># Setup up linear system
x = HYPRE.solve(solver, A, b)</code></pre><p>Note that <code>Tol = 0.0</code> and <code>MaxIter = 1</code> are required settings when using <code>BoomerAMG</code> as a preconditioner. These settings are added automatically since it is passed as a preconditioner to the <code>PCG</code> solver.</p><divclass="admonition is-category-not"><headerclass="admonition-header">Corresponding C code</header><divclass="admonition-body"><p>For comparison, here is the corresponding C code for setting up the solver above:</p><pre><codeclass="language-c hljs">/* Setup linear system */
x = HYPRE.solve(solver, A, b)</code></pre><p>Note that <code>Tol = 0.0</code> and <code>MaxIter = 1</code> are required settings when using <code>BoomerAMG</code> as a preconditioner. These settings are added automatically since it is passed as a preconditioner to the <code>PCG</code> solver.</p><divclass="admonition is-category-not"><headerclass="admonition-header">Corresponding C code</header><divclass="admonition-body"><p>For comparison between the APIs, here is the corresponding C code for setting up the solver above:</p><pre><codeclass="language-c hljs">/* Setup linear system */
HYPRE_ParCSRPCGSolve(solver, A, b, x);</code></pre></div></div></article><navclass="docs-footer"><aclass="docs-footer-prevpage"href="../matrix-vector/">« Matrix/vector representation</a><aclass="docs-footer-nextpage"href="../libhypre/">LibHYPRE C API »</a><divclass="flexbox-break"></div><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.28.0-DEV on <spanclass="colophon-date"title="Thursday 28 July 2022 15:33">Thursday 28 July 2022</span>. Using Julia version 1.7.3.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>
HYPRE_ParCSRPCGSolve(solver, A, b, x);</code></pre></div></div></article><navclass="docs-footer"><aclass="docs-footer-prevpage"href="../matrix-vector/">« Matrix/vector representation</a><aclass="docs-footer-nextpage"href="../libhypre/">LibHYPRE C API »</a><divclass="flexbox-break"></div><pclass="footer-message">Powered by <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <ahref="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><divclass="modal"id="documenter-settings"><divclass="modal-background"></div><divclass="modal-card"><headerclass="modal-card-head"><pclass="modal-card-title">Settings</p><buttonclass="delete"></button></header><sectionclass="modal-card-body"><p><labelclass="label">Theme</label><divclass="select"><selectid="documenter-themepicker"><optionvalue="documenter-light">documenter-light</option><optionvalue="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <ahref="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.28.0-DEV on <spanclass="colophon-date"title="Thursday 28 July 2022 19:11">Thursday 28 July 2022</span>. Using Julia version 1.7.3.</p></section><footerclass="modal-card-foot"></footer></div></div></div></body></html>