Skip to content

Commit

Permalink
update pygments
Browse files Browse the repository at this point in the history
  • Loading branch information
bodono committed Jan 9, 2022
1 parent ea27ba2 commit 7724c85
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions docs/src/_static/css/scs_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ body {

/* Link Styling */
a,a:visited, a:focus {
color: rgb(46, 118, 176); /* Light blue*/
color: rgb(46, 118, 176); /* Light blue */
text-decoration: none;
}
a:hover, a:active {
color: rgb(0, 32, 72); /* blue*/
color: rgb(0, 32, 72); /* blue */
text-decoration: none;
}

Expand Down
23 changes: 13 additions & 10 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
pygments_style = 'sphinx'

#pygments_style = 'sphinx'
pygments_style = 'default'

#html_sidebars = {
# '**': [
Expand All @@ -56,22 +58,23 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'alabaster'
# html_theme = 'sphinx_rtd_theme'
# html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

def setup(app):
app.add_css_file('css/scs_theme.css')

#html_logo = '_static/scs_logo_transparent.png'
html_logo = '_static/scs_logo_transparent.png'
html_favicon = '_static/favicon.ico'
html_theme_options = {
'github_banner': True,
'github_user': 'cvxgrp',
'github_repo': 'scs',
'logo': 'scs_logo_transparent.png',
'logo_name': False,
'github_button': False,
'logo_only': True,
#'github_banner': True,
#'github_user': 'cvxgrp',
#'github_repo': 'scs',
#'logo': 'scs_logo_transparent.png',
#'logo_name': False,
#'github_button': False,
#'github_type': 'star',
'analytics_id': 'UA-203326834-1',
}
Expand Down
2 changes: 2 additions & 0 deletions docs/src/examples/c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ compile the code using:
Then run the code yielding output

.. literalinclude:: qp.c.out
:language: none

1 change: 1 addition & 0 deletions docs/src/examples/matlab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ run the code yielding output
.. matlab -r "run ~/git/scs/docs/src/examples/qp.m;exit"
.. literalinclude:: qp.m.out
:language: none

2 changes: 2 additions & 0 deletions docs/src/examples/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ run the code yielding output
.. python qp.py > qp.py.out
.. literalinclude:: qp.py.out
:language: none

13 changes: 6 additions & 7 deletions docs/src/examples/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* Set up and solve basic qp */
int main(int argc, char **argv) {

/* Set up the problem data */
/* A and P must be in compressed sparse column format */
double P_x[3] = {3., -1., 2.}; /* Upper triangular of P only */
Expand All @@ -11,7 +10,7 @@ int main(int argc, char **argv) {
double A_x[4] = {-1., 1., 1., 1.};
int A_i[4] = {0, 1, 0, 2};
int A_p[3] = {0, 2, 4};
double b[3] = {-1., 0.3, -0.5,};
double b[3] = {-1., 0.3, -0.5};
double c[2] = {-1., -1.};
/* data shape */
int n = 2;
Expand All @@ -29,8 +28,8 @@ int main(int argc, char **argv) {
d->n = n;
d->b = b;
d->c = c;
d->A = &(ScsMatrix) {A_x, A_i, A_p, m, n};
d->P = &(ScsMatrix) {P_x, P_i, P_p, n, n};
d->A = &(ScsMatrix){A_x, A_i, A_p, m, n};
d->P = &(ScsMatrix){P_x, P_i, P_p, n, n};

/* Cone */
k->l = m;
Expand All @@ -39,8 +38,8 @@ int main(int argc, char **argv) {
scs_set_default_settings(stgs);

/* Modify tolerances */
stgs->eps_abs=1e-9;
stgs->eps_rel=1e-9;
stgs->eps_abs = 1e-9;
stgs->eps_rel = 1e-9;

/* Solve! */
int exitflag = scs(d, k, stgs, sol, info);
Expand All @@ -56,7 +55,7 @@ int main(int argc, char **argv) {
for (int i = 0; i < n; ++i) {
printf("x[%i] = %4f\n", i, sol->x[i]);
}

/* Print dual solution y */
printf("Optimal dual vector y*:\n");
for (int i = 0; i < m; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions docs/src/examples/qp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import scipy
import scs
import numpy as np
from scipy import sparse

# Set up the problem data
P = sparse.csc_matrix([[3., -1.], [-1., 2.]])
A = sparse.csc_matrix([[-1., 1.], [1., 0.], [0., 1.]])
P = scipy.sparse.csc_matrix([[3., -1.], [-1., 2.]])
A = scipy.sparse.csc_matrix([[-1., 1.], [1., 0.], [0., 1.]])
b = np.array([-1, 0.3, -0.5])
c = np.array([-1., -1.])

Expand Down

0 comments on commit 7724c85

Please sign in to comment.