Skip to content

Commit

Permalink
deploy: 82ed008
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhamel committed Jan 7, 2025
1 parent c43de7b commit 83f4ba5
Show file tree
Hide file tree
Showing 131 changed files with 2,324 additions and 3,563 deletions.
4 changes: 2 additions & 2 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: bd59fd941387a83e9ca6b1b57e0d3ce7
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f13c020c2ae2af9bc5aaffac8229bba5
tags: 645f666f9bcd5a90fca523b33c5a78b7
4 changes: 2 additions & 2 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; optimism 0.1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />


<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=01f34227"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=f281be69"></script>
Expand Down
26 changes: 13 additions & 13 deletions _modules/optimism/AlSolver.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>optimism.AlSolver &mdash; optimism 0.1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />


<script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=01f34227"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=f281be69"></script>
Expand Down Expand Up @@ -73,11 +73,11 @@
<div itemprop="articleBody">

<h1>Source code for optimism.AlSolver</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">optimism.JaxConfig</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">import</span> <span class="nn">optimism.EquationSolver</span> <span class="k">as</span> <span class="nn">EqSolver</span>
<span class="kn">from</span> <span class="nn">optimism.NewtonSolver</span> <span class="kn">import</span> <span class="n">globalized_newton_step</span>
<span class="kn">from</span> <span class="nn">optimism.NewtonSolver</span> <span class="kn">import</span> <span class="n">newton_step</span>
<span class="kn">from</span> <span class="nn">optimism</span> <span class="kn">import</span> <span class="n">WarmStart</span>
<span></span><span class="kn">from</span><span class="w"> </span><span class="nn">optimism.JaxConfig</span><span class="w"> </span><span class="kn">import</span> <span class="o">*</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">optimism.EquationSolver</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">EqSolver</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">optimism.NewtonSolver</span><span class="w"> </span><span class="kn">import</span> <span class="n">globalized_newton_step</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">optimism.NewtonSolver</span><span class="w"> </span><span class="kn">import</span> <span class="n">newton_step</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">optimism</span><span class="w"> </span><span class="kn">import</span> <span class="n">WarmStart</span>

<span class="n">Settings</span> <span class="o">=</span> <span class="n">namedtuple</span><span class="p">(</span><span class="s1">&#39;Settings&#39;</span><span class="p">,</span>
<span class="p">[</span><span class="s1">&#39;penalty_scaling&#39;</span><span class="p">,</span>
Expand All @@ -93,7 +93,7 @@ <h1>Source code for optimism.AlSolver</h1><div class="highlight"><pre>

<div class="viewcode-block" id="get_settings">
<a class="viewcode-back" href="../../optimism.html#optimism.AlSolver.get_settings">[docs]</a>
<span class="k">def</span> <span class="nf">get_settings</span><span class="p">(</span><span class="n">penalty_scaling</span><span class="o">=</span><span class="mf">4.</span><span class="p">,</span>
<span class="k">def</span><span class="w"> </span><span class="nf">get_settings</span><span class="p">(</span><span class="n">penalty_scaling</span><span class="o">=</span><span class="mf">4.</span><span class="p">,</span>
<span class="n">target_constraint_decrease_factor</span><span class="o">=</span><span class="mf">0.75</span><span class="p">,</span>
<span class="n">relative_gmres_tol</span><span class="o">=</span><span class="mf">2e-2</span><span class="p">,</span>
<span class="n">max_gmres_iters</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
Expand Down Expand Up @@ -121,7 +121,7 @@ <h1>Source code for optimism.AlSolver</h1><div class="highlight"><pre>

<div class="viewcode-block" id="solve_sub_step">
<a class="viewcode-back" href="../../optimism.html#optimism.AlSolver.solve_sub_step">[docs]</a>
<span class="k">def</span> <span class="nf">solve_sub_step</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">ncpErrorOld</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">,</span> <span class="n">subSettings</span><span class="p">,</span> <span class="n">sub_problem_solver</span><span class="p">,</span> <span class="n">sub_problem_callback</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">solve_sub_step</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">ncpErrorOld</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">,</span> <span class="n">subSettings</span><span class="p">,</span> <span class="n">sub_problem_solver</span><span class="p">,</span> <span class="n">sub_problem_callback</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="n">x</span><span class="p">,</span> <span class="n">solverSuccess</span> <span class="o">=</span> <span class="n">sub_problem_solver</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">subSettings</span><span class="p">,</span> <span class="n">sub_problem_callback</span><span class="p">)</span>

<span class="n">c</span> <span class="o">=</span> <span class="n">alObjective</span><span class="o">.</span><span class="n">constraint</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
Expand All @@ -142,16 +142,16 @@ <h1>Source code for optimism.AlSolver</h1><div class="highlight"><pre>

<div class="viewcode-block" id="linear_update">
<a class="viewcode-back" href="../../optimism.html#optimism.AlSolver.linear_update">[docs]</a>
<span class="k">def</span> <span class="nf">linear_update</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">rhs_func</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">linear_update</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">rhs_func</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">):</span>
<span class="n">xl</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">hstack</span><span class="p">((</span><span class="n">x</span><span class="p">,</span> <span class="n">alObjective</span><span class="o">.</span><span class="n">lam</span><span class="p">))</span>
<span class="n">xsize</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">size</span>


<span class="k">def</span> <span class="nf">residual_jac_vec</span><span class="p">(</span><span class="n">vxl</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">residual_jac_vec</span><span class="p">(</span><span class="n">vxl</span><span class="p">):</span>
<span class="k">return</span> <span class="n">alObjective</span><span class="o">.</span><span class="n">constrained_jacobian_vec</span><span class="p">(</span><span class="n">xl</span><span class="p">,</span> <span class="n">vxl</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">precond</span><span class="p">(</span><span class="n">vl</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">precond</span><span class="p">(</span><span class="n">vl</span><span class="p">):</span>
<span class="n">xR</span> <span class="o">=</span> <span class="n">vl</span><span class="p">[:</span><span class="n">xsize</span><span class="p">]</span>
<span class="n">lR</span> <span class="o">=</span> <span class="n">vl</span><span class="p">[</span><span class="n">xsize</span><span class="p">:]</span>
<span class="n">D</span> <span class="o">=</span> <span class="n">alObjective</span><span class="o">.</span><span class="n">ncp_hessian</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
Expand All @@ -175,7 +175,7 @@ <h1>Source code for optimism.AlSolver</h1><div class="highlight"><pre>

<div class="viewcode-block" id="augmented_lagrange_solve">
<a class="viewcode-back" href="../../optimism.html#optimism.AlSolver.augmented_lagrange_solve">[docs]</a>
<span class="k">def</span> <span class="nf">augmented_lagrange_solve</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">,</span> <span class="n">subSettings</span><span class="p">,</span>
<span class="k">def</span><span class="w"> </span><span class="nf">augmented_lagrange_solve</span><span class="p">(</span><span class="n">alObjective</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="n">alSettings</span><span class="p">,</span> <span class="n">subSettings</span><span class="p">,</span>
<span class="n">callback</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">sub_problem_callback</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">sub_problem_solver</span><span class="o">=</span><span class="n">EqSolver</span><span class="o">.</span><span class="n">trust_region_minimize</span><span class="p">,</span>
Expand Down
Loading

0 comments on commit 83f4ba5

Please sign in to comment.