From 75247b3521d5808fbe5b1ef7aa67712639eda8b1 Mon Sep 17 00:00:00 2001 From: Transurgeon Date: Sun, 25 Feb 2024 23:57:24 -0500 Subject: [PATCH 01/16] reimplementing datatables for all functions --- doc/source/_static/main.js | 170 +++ doc/source/conf.py | 10 +- doc/source/functions/functions_table.rst | 1265 ++++++++++++++++++++++ doc/source/functions/index.rst | 12 + doc/source/index.rst | 5 + 5 files changed, 1460 insertions(+), 2 deletions(-) create mode 100644 doc/source/_static/main.js create mode 100644 doc/source/functions/functions_table.rst create mode 100644 doc/source/functions/index.rst diff --git a/doc/source/_static/main.js b/doc/source/_static/main.js new file mode 100644 index 0000000000..bf6f37ffe4 --- /dev/null +++ b/doc/source/_static/main.js @@ -0,0 +1,170 @@ +$(document).ready(function() { + function createRadioButtons() { + var radioButtons = ` +
Curvature
+
+
+ + + + + +
+ + + +
+
+
Operation Type
+
+
+ + + + + +
+ + + `; + var dropdown = document.querySelector('.functions-filter .sd-card-text'); + if (dropdown) { + dropdown.innerHTML = radioButtons; + } + } + + function initializeMainTable() { + var table = $('table.atomic-functions').DataTable(); + var originalData = table.data().toArray(); + $('#applyFilters').click(function() { + var curvatureValue = $('input[name="curvature"]:checked').val(); + var operationTypeValue = $('input[name="operationType"]:checked').val(); + var filteredData = originalData; + + if (curvatureValue !== "all") { + filteredData = filteredData.filter(row => { + const curv = $(row[4]).text().trim(); + return curv === curvatureValue; + }); + } + if (operationTypeValue !== "all") { + filteredData = filteredData.filter(row => { + const type = $(row[6]).text().trim(); + return type === operationTypeValue; + }); + } + table.clear().rows.add(filteredData).draw(); + }); + + $('#resetFilters').click(function() { + $('input[name="curvature"][value="all"]').prop('checked', true); + $('input[name="operationType"][value="all"]').prop('checked', true); + table.clear().rows.add(originalData).draw(); + }); + } + + +function createDCPTable(tableClass, typeValue) { + var newTable = $(`table.${tableClass}`); + const curvatures = ['convex', 'concave', 'affine']; + if (typeValue === "elementwise") { + curvatures.push('constant'); + } + + const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { + const curvatureValue = $(row[4]).text().trim(); + const rowTypeValue = $(row[6]).text().trim(); + return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; + }); + + newTable.DataTable({ + data: dcpData, + columns: [ + { title: "Function" }, + { title: "Meaning" }, + { title: "Domain" }, + { title: "Sign" }, + { title: "Curvature" }, + { title: "Monotonicity" }, + ] + }); +} + +function createMatrixDCPTable(tableClass, typeValue) { + var newTable = $(`table.${tableClass}`); + const curvatures = ['affine']; + + const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { + const curvatureValue = $(row[4]).text().trim(); + const rowTypeValue = $(row[6]).text().trim(); + return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; + }); + + newTable.DataTable({ + data: dcpData, + columns: [ + { title: "Function" }, + { title: "Meaning" }, + { title: "Domain" }, + { title: "Sign", visible: false }, + { title: "Curvature" }, + { title: "Monotonicity" }, + ] + }); +} + +function createDGPTable(tableClass, typeValue) { + var newTable = $(`table.${tableClass}`); + const curvatures = ['log-log affine', 'log-log convex', 'log-log concave', 'constant']; + + const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { + const curvatureValue = $(row[4]).text().trim(); + const rowTypeValue = $(row[6]).text().trim(); + return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; + }); + + newTable.DataTable({ + data: dcpData, + columns: [ + { title: "Function" }, + { title: "Meaning" }, + { title: "Domain" }, + { title: "Sign", visible: false }, + { title: "Curvature" }, + { title: "Monotonicity" }, + ] + }); +} + + createRadioButtons(); + initializeMainTable(); + createDCPTable("scalar-dcp", "scalar"); + createDCPTable("element-dcp", "elementwise"); + createMatrixDCPTable("matrix-dcp", "matrix"); + createDGPTable("scalar-dgp", "scalar"); + createDGPTable("element-dgp", "elementwise"); + createDGPTable("matrix-dgp", "matrix"); + +}); diff --git a/doc/source/conf.py b/doc/source/conf.py index 00caecc73b..e35990acb2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -261,8 +261,14 @@ def __getattr__(self, name): # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -html_css_files = ['css/styling.css'] - +html_css_files = [ + 'css/styling.css', + 'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css', +] +html_js_files = [ + 'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js', + 'main.js', +] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' diff --git a/doc/source/functions/functions_table.rst b/doc/source/functions/functions_table.rst new file mode 100644 index 0000000000..19c55895cd --- /dev/null +++ b/doc/source/functions/functions_table.rst @@ -0,0 +1,1265 @@ +.. |_| unicode:: 0xA0 + :trim: + +.. list-table:: + :class: atomic-functions + :header-rows: 1 + + * - Function + - Meaning + - Domain + - Sign + - Curvature |_| + - Monotonicity + - Type + + * - :ref:`dotsort(X,W) ` + + constant :math:`W \in \mathbf{R}^{o \times p}` + - :math:`\langle sort\left(vec(X)\right), sort\left(vec(W)\right) \rangle` + - :math:`X \in \mathbf{R}^{m \times n}` + - depends on :math:`X`, :math:`W` + - |convex| convex + - |incr| for :math:`\min(W) \geq 0` + - scalar + + * - :ref:`geo_mean(x) ` + + :ref:`geo_mean(x, p) ` + + :math:`p \in \mathbf{R}^n_{+}` + + :math:`p \neq 0` + - :math:`x_1^{1/n} \cdots x_n^{1/n}` + - :math:`x \in \mathbf{R}^n_{+}` + - |positive| positive + - |concave| concave + - |incr| incr. + - scalar + + * - :ref:`harmonic_mean(x) ` + - :math:`\frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}}` + - :math:`x \in \mathbf{R}^n_{+}` + - |positive| positive + - |concave| concave + - |incr| incr. + - scalar + + * - :ref:`inv_prod(x) ` + - :math:`(x_1\cdots x_n)^{-1}` + - :math:`x \in \mathbf{R}^n_+` + - |positive| positive + - |convex| convex + - |decr| decr. + - scalar + + * - :ref:`lambda_max(X) ` + - :math:`\lambda_{\max}(X)` + - :math:`X \in \mathbf{S}^n` + - |unknown| unknown + - |convex| convex + - None + - scalar + + * - :ref:`lambda_min(X) ` + - :math:`\lambda_{\min}(X)` + - :math:`X \in \mathbf{S}^n` + - |unknown| unknown + - |concave| concave + - None + - scalar + + * - :ref:`lambda_sum_largest(X,k) ` + + :math:`k = 1,\ldots, n` + - :math:`\text{sum of $k$ largest}\\ \text{eigenvalues of $X$}` + - :math:`X \in\mathbf{S}^{n}` + - |unknown| unknown + - |convex| convex + - None + - scalar + + * - :ref:`lambda_sum_smallest(X,k) ` + + :math:`k = 1,\ldots, n` + - :math:`\text{sum of $k$ smallest}\\ \text{eigenvalues of $X$}` + - :math:`X \in\mathbf{S}^{n}` + - |unknown| unknown + - |concave| concave + - None + - scalar + + * - :ref:`log_det(X) ` + + - :math:`\log \left(\det (X)\right)` + - :math:`X \in \mathbf{S}^n_+` + - |unknown| unknown + - |concave| concave + - None + - scalar + + * - :ref:`log_sum_exp(X) ` + + - :math:`\log \left(\sum_{ij}e^{X_{ij}}\right)` + - :math:`X \in\mathbf{R}^{m \times n}` + - |unknown| unknown + - |convex| convex + - |incr| incr. + - scalar + + * - :ref:`matrix_frac(x, P) ` + + - :math:`x^T P^{-1} x` + - :math:`x \in \mathbf{R}^n` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`max(X) ` + + - :math:`\max_{ij}\left\{ X_{ij}\right\}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |convex| convex + - |incr| incr. + - scalar + + * - :ref:`mean(X) ` + + - :math:`\frac{1}{m n}\sum_{ij}\left\{ X_{ij}\right\}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |affine| affine + - |incr| incr. + - scalar + + * - :ref:`min(X) ` + + - :math:`\min_{ij}\left\{ X_{ij}\right\}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |concave| concave + - |incr| incr. + - scalar + + * - :ref:`mixed_norm(X, p, q) ` + + - :math:`\left(\sum_k\left(\sum_l\lvert x_{k,l}\rvert^p\right)^{q/p}\right)^{1/q}` + - :math:`X \in\mathbf{R}^{n \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`norm(x) ` + + norm(x, 2) + - :math:`\sqrt{\sum_{i} \lvert x_{i} \rvert^2 }` + - :math:`X \in\mathbf{R}^{n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x_{i} \geq 0` + - scalar + + * - :ref:`norm(x, 1) ` + - :math:`\sum_{i}\lvert x_{i} \rvert` + - :math:`x \in\mathbf{R}^{n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x_{i} \geq 0` + - scalar + + * - :ref:`norm(x, "inf") ` + - :math:`\max_{i} \{\lvert x_{i} \rvert\}` + - :math:`x \in\mathbf{R}^{n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x_{i} \geq 0` + - scalar + + * - :ref:`norm(X, "fro") ` + - :math:`\sqrt{\sum_{ij}X_{ij}^2 }` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + - scalar + + * - :ref:`norm(X, 1) ` + - :math:`\max_{j} \|X_{:,j}\|_1` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + - scalar + + * - :ref:`norm(X, "inf") ` + - :math:`\max_{i} \|X_{i,:}\|_1` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + - scalar + + * - :ref:`norm(X, "nuc") ` + - :math:`\mathrm{tr}\left(\left(X^T X\right)^{1/2}\right)` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`norm(X) ` + norm(X, 2) + - :math:`\sqrt{\lambda_{\max}\left(X^T X\right)}` + - :math:`X in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`perspective(f(x),s) ` + + - :math:`sf(x/s)` + - :math:`x \in \mathop{\bf dom} f` + :math:`s \geq 0` + - same as f + - |convex| / |concave| + same as :math:`f` + - None + - scalar + + * - :ref:`pnorm(X, p) ` + + :math:`p \geq 1` + or ``p = 'inf'`` + - :math:`\|X\|_p = \left(\sum_{ij} |X_{ij}|^p \right)^{1/p}` + - :math:`X \in \mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + - scalar + + * - :ref:`pnorm(X, p) ` + + :math:`p < 1`, :math:`p \neq 0` + - :math:`\|X\|_p = \left(\sum_{ij} X_{ij}^p \right)^{1/p}` + - :math:`X \in \mathbf{R}^{m \times n}_+` + - |positive| positive + - |concave| concave + - |incr| incr. + - scalar + + * - :ref:`ptp(X) ` + + - :math:`\max_{ij} X_{ij} - \min_{ij} X_{ij}` + - :math:`X \in \mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`quad_form(x, P) ` + + constant :math:`P \in \mathbf{S}^n_+` + - :math:`x^T P x` + - :math:`x \in \mathbf{R}^n` + - |positive| positive + - |convex| convex + - |incr| for :math:`x_i \geq 0` + - scalar + + * - :ref:`quad_form(x, P) ` + + constant :math:`P \in \mathbf{S}^n_-` + - :math:`x^T P x` + - :math:`x \in \mathbf{R}^n` + - |negative| negative + - |concave| concave + - |decr| for :math:`x_i \geq 0` + - scalar + + * - :ref:`quad_form(c, X) ` + + constant :math:`c \in \mathbf{R}^n` + - :math:`c^T X c` + - :math:`X \in\mathbf{R}^{n \times n}` + - depends |_| on |_| c, |_| X + - |affine| affine + - depends |_| on |_| c + - scalar + + * - :ref:`quad_over_lin(X, y) ` + + - :math:`\left(\sum_{ij}X_{ij}^2\right)/y` + - :math:`x \in \mathbf{R}^n` + :math:`y > 0` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + |decr| for :math:`X_{ij} \leq 0` + |decr| decr. in :math:`y` + - scalar + + * - :ref:`std(X) ` + + - :math:`\sqrt{\frac{1}{mn} \sum_{ij}\left(X_{ij} - \frac{1}{mn}\sum_{k\ell} X_{k\ell}\right)^2}` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`sum(X) ` + + - :math:`\sum_{ij}X_{ij}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |affine| affine + - |incr| incr. + - scalar + + * - :ref:`sum_largest(X, k) ` + + :math:`k = 1,2,\ldots` + - :math:`\text{sum of } k\text{ largest }X_{ij}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |convex| convex + - |incr| incr. + - scalar + + * - :ref:`sum_smallest(X, k) ` + + :math:`k = 1,2,\ldots` + - :math:`\text{sum of } k\text{ smallest }X_{ij}` + - :math:`X \in\mathbf{R}^{m \times n}` + - same as X + - |concave| concave + - |incr| incr. + - scalar + + * - :ref:`sum_squares(X) ` + + - :math:`\sum_{ij}X_{ij}^2` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - |incr| for :math:`X_{ij} \geq 0` + |decr| for :math:`X_{ij} \leq 0` + - scalar + + * - :ref:`trace(X) ` + + - :math:`\mathrm{tr}\left(X \right)` + - :math:`X \in\mathbf{R}^{n \times n}` + - same as X + - |affine| affine + - |incr| incr. + - scalar + + * - :ref:`tr_inv(X) ` + + - :math:`\mathrm{tr}\left(X^{-1} \right)` + - :math:`X \in\mathbf{S}^n_{++}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`tv(x) ` + + - :math:`\sum_{i}|x_{i+1} - x_i|` + - :math:`x \in \mathbf{R}^n` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`tv(X) ` + - :math:`\sum_{ij}\left\| \left[\begin{matrix} X_{i+1,j} - X_{ij} \\ X_{i,j+1} -X_{ij} \end{matrix}\right] \right\|_2` + - :math:`X \in \mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`tv([X1,...,Xk]) ` + - :math:`\sum_{ij}\left\| \left[\begin{matrix} X_{i+1,j}^{(1)} - X_{ij}^{(1)} \\ X_{i,j+1}^{(1)} -X_{ij}^{(1)} \\ \vdots \\ X_{i+1,j}^{(k)} - X_{ij}^{(k)} \\ X_{i,j+1}^{(k)} -X_{ij}^{(k)} \end{matrix}\right] \right\|_2` + - :math:`X^{(i)} \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`var(X) ` + + - :math:`{\frac{1}{mn} \sum_{ij}\left(X_{ij} - \frac{1}{mn}\sum_{k\ell} X_{k\ell}\right)^2}` + - :math:`X \in\mathbf{R}^{m \times n}` + - |positive| positive + - |convex| convex + - None + - scalar + + * - :ref:`abs(x) ` + + - :math:`\lvert x \rvert` + - :math:`x \in \mathbf{C}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x \geq 0` + - elementwise + + * - :ref:`conj(x) ` + + - complex conjugate + - :math:`x \in \mathbf{C}` + - |unknown| unknown + - |affine| affine + - None + - elementwise + + * - :ref:`entr(x) ` + + - :math:`-x \log (x)` + - :math:`x > 0` + - |unknown| unknown + - |concave| concave + - None + - elementwise + + * - :ref:`exp(x) ` + + - :math:`e^x` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`huber(x, M=1) ` + + :math:`M \geq 0` + - :math:`\begin{cases}x^2 &|x| \leq M \\2M|x| - M^2&|x| >M\end{cases}` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x \geq 0` + |decr| for :math:`x \leq 0` + - elementwise + + * - :ref:`imag(x) ` + + - imaginary part of a complex number + - :math:`x \in \mathbf{C}` + - |unknown| unknown + - |affine| affine + - none + - elementwise + + * - :ref:`inv_pos(x) ` + + - :math:`1/x` + - :math:`x > 0` + - |positive| positive + - |convex| convex + - |decr| decr. + - elementwise + + * - :ref:`kl_div(x, y) ` + + - :math:`x \log(x/y) - x + y` + - :math:`x > 0` + :math:`y > 0` + - |positive| positive + - |convex| convex + - None + - elementwise + + * - :ref:`log(x) ` + + - :math:`\log(x)` + - :math:`x > 0` + - |unknown| unknown + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`log_normcdf(x) ` + + - :ref:`approximate ` log of the standard normal CDF + - :math:`x \in \mathbf{R}` + - |negative| negative + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`log1p(x) ` + + - :math:`\log(x+1)` + - :math:`x > -1` + - same as x + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`loggamma(x) ` + + - :ref:`approximate ` `log of the Gamma function `_ + - :math:`x > 0` + - |unknown| unknown + - |convex| convex + - None + - elementwise + + * - :ref:`logistic(x) ` + + - :math:`\log(1 + e^{x})` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`maximum(x, y) ` + + - :math:`\max \left\{x, y\right\}` + - :math:`x,y \in \mathbf{R}` + - depends on x,y + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`minimum(x, y) ` + - :math:`\min \left\{x, y\right\}` + - :math:`x, y \in \mathbf{R}` + - depends |_| on |_| x,y + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`multiply(c, x) ` + + :math:`c \in \mathbf{R}` + - c*x + - :math:`x \in\mathbf{R}` + - :math:`\mathrm{sign}(cx)` + - |affine| affine + - depends |_| on |_| c + - elementwise + + * - :ref:`neg(x) ` + - :math:`\max \left\{-x, 0 \right\}` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |decr| decr. + - elementwise + + * - :ref:`pos(x) ` + - :math:`\max \left\{x, 0 \right\}` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`power(x, 0) ` + - :math:`1` + - :math:`x \in \mathbf{R}` + - |positive| positive + - constant + - |_| + - elementwise + + * - :ref:`power(x, 1) ` + - :math:`x` + - :math:`x \in \mathbf{R}` + - same as x + - |affine| affine + - |incr| incr. + - elementwise + + * - :ref:`power(x, p) ` + + :math:`p = 2, 4, 8, \ldots` + - :math:`x^p` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x \geq 0` + |decr| for :math:`x \leq 0` + - elementwise + + * - :ref:`power(x, p) ` + + :math:`p < 0` + - :math:`x^p` + - :math:`x > 0` + - |positive| positive + - |convex| convex + - |decr| decr. + - elementwise + + * - :ref:`power(x, p) ` + + :math:`0 < p < 1` + - :math:`x^p` + - :math:`x \geq 0` + - |positive| positive + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`power(x, p) ` + + :math:`p > 1,\ p \neq 2, 4, 8, \ldots` + + - :math:`x^p` + - :math:`x \geq 0` + - |positive| positive + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`real(x) ` + + - real part of a complex number + - :math:`x \in \mathbf{C}` + - |unknown| unknown + - |affine| affine + - |incr| incr. + - elementwise + + * - :ref:`rel_entr(x, y) ` + + - :math:`x \log(x/y)` + - :math:`x > 0` + + :math:`y > 0` + - |unknown| unknown + - |convex| convex + - None in :math:`x` + + |decr| in :math:`y` + - elementwise + + * - :ref:`scalene(x, alpha, beta) ` + + :math:`\text{alpha} \geq 0` + + :math:`\text{beta} \geq 0` + - :math:`\alpha\mathrm{pos}(x)+ \beta\mathrm{neg}(x)` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x \geq 0` + + |decr| for :math:`x \leq 0` + - elementwise + + * - :ref:`sqrt(x) ` + + - :math:`\sqrt x` + - :math:`x \geq 0` + - |positive| positive + - |concave| concave + - |incr| incr. + - elementwise + + * - :ref:`square(x) ` + + - :math:`x^2` + - :math:`x \in \mathbf{R}` + - |positive| positive + - |convex| convex + - |incr| for :math:`x \geq 0` + + |decr| for :math:`x \leq 0` + - elementwise + + * - :ref:`xexp(x) ` + + - :math:`x e^x` + - :math:`x \geq 0` + - |positive| positive + - |convex| convex + - |incr| incr. + - elementwise + + * - :ref:`bmat([[X11,...,X1q], + ..., + [Xp1,...,Xpq]]) ` + + - :math:`\left[\begin{matrix} X^{(1,1)} & \cdots & X^{(1,q)} \\ \vdots & & \vdots \\ X^{(p,1)} & \cdots & X^{(p,q)} \end{matrix}\right]` + - :math:`X^{(i,j)} \in\mathbf{R}^{m_i \times n_j}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`convolve(c, x) ` + + :math:`c\in\mathbf{R}^m` + - :math:`c*x` + - :math:`x\in \mathbf{R}^n` + - none + - |affine| affine + - depends |_| on |_| c + - matrix + + * - :ref:`cumsum(X, axis=0) ` + + - cumulative sum along given axis. + - :math:`X \in \mathbf{R}^{m \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`diag(x) ` + + - :math:`\left[\begin{matrix}x_1 & & \\& \ddots & \\& & x_n\end{matrix}\right]` + - :math:`x \in\mathbf{R}^{n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`diag(X) ` + - :math:`\left[\begin{matrix}X_{11} \\\vdots \\X_{nn}\end{matrix}\right]` + - :math:`X \in\mathbf{R}^{n \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`diff(X, k=1, axis=0) ` + + :math:`k \in 0,1,2,\ldots` + - kth order differences along given axis + - :math:`X \in\mathbf{R}^{m \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`hstack([X1, ..., Xk]) ` + + - :math:`\left[\begin{matrix}X^{(1)} \cdots X^{(k)}\end{matrix}\right]` + - :math:`X^{(i)} \in\mathbf{R}^{m \times n_i}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`kron(X, Y) ` + + constant :math:`X\in\mathbf{R}^{p \times q}` + - :math:`\left[\begin{matrix}X_{11}Y & \cdots & X_{1q}Y \\ \vdots & & \vdots \\ X_{p1}Y & \cdots & X_{pq}Y \end{matrix}\right]` + - :math:`Y \in \mathbf{R}^{m \times n}` + - none + - |affine| affine + - depends on :math:`X` + - matrix + + * - :ref:`kron(X, Y) ` + + constant :math:`Y\in\mathbf{R}^{m \times n}` + - :math:`\left[\begin{matrix}X_{11}Y & \cdots & X_{1q}Y \\ \vdots & & \vdots \\ X_{p1}Y & \cdots & X_{pq}Y \end{matrix}\right]` + - :math:`X \in \mathbf{R}^{p \times q}` + - none + - |affine| affine + - depends on :math:`Y` + - matrix + + * - :ref:`outer(x, y) ` + + constant :math:`y \in \mathbf{R}^m` + - :math:`x y^T` + - :math:`x \in \mathbf{R}^n` + - none + - |affine| affine + - depends on :math:`y` + - matrix + + * - :ref:`partial_trace(X, dims, axis=0) ` + + - partial trace + - :math:`X \in\mathbf{R}^{n \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`partial_transpose(X, dims, axis=0) ` + + - partial transpose + - :math:`X \in\mathbf{R}^{n \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`reshape(X, (m', n'), order='F') ` + + - :math:`X' \in\mathbf{R}^{m' \times n'}` + - :math:`X \in\mathbf{R}^{m \times n}` + + :math:`m'n' = mn` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`upper_tri(X) ` + + - flatten the strictly upper-triangular part of :math:`X` + - :math:`X \in \mathbf{R}^{n \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`vec(X) ` + + - :math:`x' \in\mathbf{R}^{mn}` + - :math:`X \in\mathbf{R}^{m \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`vec_to_upper_tri(X, strict=False) ` + + - :math:`x' \in\mathbf{R}^{n(n-1)/2}` for ``strict=True`` + + :math:`x' \in\mathbf{R}^{n(n+1)/2}` for ``strict=False`` + - :math:`X \in\mathbf{R}^{n \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`vstack([X1, ..., Xk]) ` + + - :math:`\left[\begin{matrix}X^{(1)} \\ \vdots \\X^{(k)}\end{matrix}\right]` + - :math:`X^{(i)} \in\mathbf{R}^{m_i \times n}` + - none + - |affine| affine + - |incr| incr. + - matrix + + * - :ref:`geo_mean(x) ` + + :ref:`geo_mean(x, p) ` + + :math:`p \in \mathbf{R}^n_{+}` + + :math:`p \neq 0` + - :math:`x_1^{1/n} \cdots x_n^{1/n}` + + :math:`\left(x_1^{p_1} \cdots x_n^{p_n}\right)^{\frac{1}{\mathbf{1}^T p}}` + - :math:`x \in \mathbf{R}^n_{+}` + - none + - |affine| log-log affine + - |incr| incr. + - scalar + + * - :ref:`harmonic_mean(x) ` + - :math:`\frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}}` + - :math:`x \in \mathbf{R}^n_{+}` + - none + - |concave| log-log concave + - |incr| incr. + - scalar + + * - :ref:`max(X) ` + + - :math:`\max_{ij}\left\{ X_{ij}\right\}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`min(X) ` + + - :math:`\min_{ij}\left\{ X_{ij}\right\}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |concave| log-log concave + - |incr| incr. + - scalar + + * - :ref:`norm(x) ` + + norm(x, 2) + + - :math:`\sqrt{\sum_{i} \lvert x_{i} \rvert^2 }` + - :math:`X \in\mathbf{R}^{n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`norm(X, "fro") ` + - :math:`\sqrt{\sum_{ij}X_{ij}^2 }` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`norm(X, 1) ` + - :math:`\sum_{ij}\lvert X_{ij} \rvert` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`norm(X, "inf") ` + - :math:`\max_{ij} \{\lvert X_{ij} \rvert\}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`pnorm(X, p) ` + + :math:`p \geq 1` + + or ``p = 'inf'`` + - :math:`\|X\|_p = \left(\sum_{ij} |X_{ij}|^p \right)^{1/p}` + - :math:`X \in \mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`pnorm(X, p) ` + + :math:`0 < p < 1` + - :math:`\|X\|_p = \left(\sum_{ij} X_{ij}^p \right)^{1/p}` + - :math:`X \in \mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`prod(X) ` + + - :math:`\prod_{ij}X_{ij}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - scalar + + * - :ref:`quad_form(x, P) ` + - :math:`x^T P x` + - :math:`x \in \mathbf{R}^n`, :math:`P \in \mathbf{R}^{n \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`quad_over_lin(X, y) ` + - :math:`\left(\sum_{ij}X_{ij}^2\right)/y` + - :math:`x \in \mathbf{R}^n_{++}` + + :math:`y > 0` + - none + - |convex| log-log convex + - |incr| in :math:`X_{ij}` + + |decr| decr. in :math:`y` + - scalar + + * - :ref:`sum(X) ` + + - :math:`\sum_{ij}X_{ij}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`sum_squares(X) ` + + - :math:`\sum_{ij}X_{ij}^2` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`trace(X) ` + + - :math:`\mathrm{tr}\left(X \right)` + - :math:`X \in\mathbf{R}^{n \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`pf_eigenvalue(X) ` + + - spectral radius of :math:`X` + - :math:`X \in\mathbf{R}^{n \times n}_{++}` + - none + - |convex| log-log convex + - |incr| incr. + - scalar + + * - :ref:`diff_pos(x, y) ` + - :math:`x - y` + - :math:`0 < y < x` + - none + - |concave| log-log concave + - |incr| incr. in :math:`x` + + |decr| decr. in :math:`y` + - elementwise + + * - :ref:`entr(x) ` + + - :math:`-x \log (x)` + - :math:`0 < x < 1` + - none + - |concave| log-log concave + - None + - elementwise + + * - :ref:`exp(x) ` + + - :math:`e^x` + - :math:`x > 0` + - none + - |convex| log-log convex + - |incr| incr. + - elementwise + + * - :ref:`log(x) ` + + - :math:`\log(x)` + - :math:`x > 1` + - none + - |concave| log-log concave + - |incr| incr. + - elementwise + + * - :ref:`maximum(x, y) ` + + - :math:`\max \left\{x, y\right\}` + - :math:`x,y > 0` + - none + - |convex| log-log convex + - |incr| incr. + - elementwise + + * - :ref:`minimum(x, y) ` + - :math:`\min \left\{x, y\right\}` + - :math:`x, y > 0` + - none + - |concave| log-log concave + - |incr| incr. + - elementwise + + * - :ref:`multiply(x, y) ` + - :math:`x*y` + - :math:`x, y > 0` + - none + - |affine| log-log affine + - |incr| incr. + - elementwise + + * - :ref:`one_minus_pos(x) ` + - :math:`1 - x` + - :math:`0 < x < 1` + - none + - |concave| log-log concave + - |decr| decr. + - elementwise + + * - :ref:`power(x, 0) ` + - :math:`1` + - :math:`x > 0` + - none + - constant + - constant + - elementwise + + * - :ref:`power(x, p) ` + - :math:`x` + - :math:`x > 0` + - none + - |affine| log-log affine + - |incr| for :math:`p > 0` + + |decr| for :math:`p < 0` + - elementwise + + * - :ref:`sqrt(x) ` + + + - :math:`\sqrt x` + - :math:`x > 0` + - none + - |affine| log-log affine + - |incr| incr. + - elementwise + + * - :ref:`square(x) ` + + - :math:`x^2` + - :math:`x > 0` + - none + - |affine| log-log affine + - |incr| incr. + - elementwise + + * - :ref:`xexp(x) ` + + - :math:`x e^x` + - :math:`x > 0` + - none + - |convex| log-log convex + - |incr| incr. + - elementwise + + * - :ref:`bmat([[X11,...,X1q], + ..., + [Xp1,...,Xpq]]) ` + + - :math:`\left[\begin{matrix} X^{(1,1)} & \cdots & X^{(1,q)} \\ \vdots & & \vdots \\ X^{(p,1)} & \cdots & X^{(p,q)} \end{matrix}\right]` + - :math:`X^{(i,j)} \in\mathbf{R}^{m_i \times n_j}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`diag(x) ` + + - :math:`\left[\begin{matrix}x_1 & & \\& \ddots & \\& & x_n\end{matrix}\right]` + - :math:`x \in\mathbf{R}^{n}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`diag(X) ` + - :math:`\left[\begin{matrix}X_{11} \\\vdots \\X_{nn}\end{matrix}\right]` + - :math:`X \in\mathbf{R}^{n \times n}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`eye_minus_inv(X) ` + - :math:`(I - X)^{-1}` + - :math:`X \in\mathbf{R}^{n \times n}_{++}, \lambda_{\text{pf}}(X) < 1` + - none + - |convex| log-log convex + - |incr| incr. + - matrix + + * - :ref:`gmatmul(A, x) ` + + :math:`A \in \mathbf{R}^{m \times n}` + - :math:`\left[\begin{matrix}\prod_{j=1}^n x_j^{A_{1j}} \\\vdots \\\prod_{j=1}^n x_j^{A_{mj}}\end{matrix}\right]` + - :math:`x \in \mathbf{R}^n_{++}` + - none + - |affine| log-log affine + - |incr| for :math:`A_{ij} \geq 0` + + |decr| for :math:`A_{ij} \leq 0` + - matrix + + * - :ref:`hstack([X1, ..., Xk]) ` + - :math:`\left[\begin{matrix}X^{(1)} \cdots X^{(k)}\end{matrix}\right]` + - :math:`X^{(i)} \in\mathbf{R}^{m \times n_i}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`matmul(X, Y) ` + - :math:`XY` + - :math:`X \in\mathbf{R}^{m \times n}_{++}, Y \in\mathbf{R}^{n \times p}_{++}`` + - none + - |convex| log-log convex + - |incr| incr. + - matrix + + * - :ref:`resolvent(X) ` + - :math:`(sI - X)^{-1}` + - :math:`X \in\mathbf{R}^{n \times n}_{++}, \lambda_{\text{pf}}(X) < s` + - none + - |convex| log-log convex + - |incr| incr. + - matrix + + * - :ref:`reshape(X, (m', n')) ` + + - :math:`X' \in\mathbf{R}^{m' \times n'}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + + :math:`m'n' = mn` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`vec(X) ` + + - :math:`x' \in\mathbf{R}^{mn}` + - :math:`X \in\mathbf{R}^{m \times n}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + + * - :ref:`vstack([X1, ..., Xk]) ` + + - :math:`\left[\begin{matrix}X^{(1)} \\ \vdots \\X^{(k)}\end{matrix}\right]` + - :math:`X^{(i)} \in\mathbf{R}^{m_i \times n}_{++}` + - none + - |affine| log-log affine + - |incr| incr. + - matrix + +.. |positive| image:: /tutorial/functions/functions_files/positive.svg + :width: 15px + :height: 15px + +.. |negative| image:: /tutorial/functions/functions_files/negative.svg + :width: 15px + :height: 15px + +.. |unknown| image:: /tutorial/functions/functions_files/unknown.svg + :width: 15px + :height: 15px + +.. |convex| image:: /tutorial/functions/functions_files/convex.svg + :width: 15px + :height: 15px + +.. |concave| image:: /tutorial/functions/functions_files/concave.svg + :width: 15px + :height: 15px + +.. |affine| image:: /tutorial/functions/functions_files/affine.svg + :width: 15px + :height: 15px + +.. |incr| image:: /tutorial/functions/functions_files/increasing.svg + :width: 15px + :height: 15px + +.. |decr| image:: /tutorial/functions/functions_files/decreasing.svg + :width: 15px + :height: 15px \ No newline at end of file diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst new file mode 100644 index 0000000000..522389f2e9 --- /dev/null +++ b/doc/source/functions/index.rst @@ -0,0 +1,12 @@ +.. _functions: + +Functions +========= +The table below lists all the atomic functions available in CVXPY. + +.. card:: Filters + :class-card: functions-filter + + card content + +.. include:: functions_table.rst \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index dafe663844..ac432de63d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -127,6 +127,11 @@ considered to be part of the public API. User Guide +.. toctree:: + :hidden: + + functions/index + .. toctree:: :hidden: From 379fb4258ff73de20c50ccca3b3d3dfe58bd216b Mon Sep 17 00:00:00 2001 From: Transurgeon Date: Sun, 25 Feb 2024 23:58:41 -0500 Subject: [PATCH 02/16] adding rtd yaml setup file --- .readthedocs.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000000..b421e8ee44 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,35 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + # You can also specify other tool versions: + # nodejs: "19" + # rust: "1.64" + # golang: "1.19" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: doc/source/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - method: pip + path: . + - requirements: doc/requirements.txt + - requirements: requirements.txt \ No newline at end of file From 6d370496b933c700ce58ebf5c266342df085b0e7 Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Wed, 18 Dec 2024 00:01:29 -0500 Subject: [PATCH 03/16] completing push --- .gitignore | 6 +++++- doc/source/_static/main.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7a4db1cf15..23b9177f4a 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,10 @@ tags # Things specific to this project cvxpy/version.py +<<<<<<< HEAD # Hypothesis testing -.hypothesis/ \ No newline at end of file +.hypothesis/ +======= +.hypothesis +>>>>>>> 07dba15da (adding some changes for styling and making tables look nicer) diff --git a/doc/source/_static/main.js b/doc/source/_static/main.js index bf6f37ffe4..1aa301ec14 100644 --- a/doc/source/_static/main.js +++ b/doc/source/_static/main.js @@ -58,6 +58,9 @@ $(document).ready(function() { function initializeMainTable() { var table = $('table.atomic-functions').DataTable(); var originalData = table.data().toArray(); + $('#operationTypeFilter input').change(function(e) { + console.log(e) + }); $('#applyFilters').click(function() { var curvatureValue = $('input[name="curvature"]:checked').val(); var operationTypeValue = $('input[name="operationType"]:checked').val(); From 66eba7ea8a90d20556bcaed0c07cb525b22dc90a Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Wed, 18 Dec 2024 22:01:49 -0500 Subject: [PATCH 04/16] some updates to the table and removing javascript file --- .gitignore | 4 - doc/source/_static/main.js | 173 --------------------------------- doc/source/conf.py | 6 +- doc/source/functions/index.rst | 100 ++++++++++++++++++- 4 files changed, 99 insertions(+), 184 deletions(-) delete mode 100644 doc/source/_static/main.js diff --git a/.gitignore b/.gitignore index 23b9177f4a..0faca17d6e 100644 --- a/.gitignore +++ b/.gitignore @@ -59,10 +59,6 @@ tags # Things specific to this project cvxpy/version.py -<<<<<<< HEAD # Hypothesis testing .hypothesis/ -======= -.hypothesis ->>>>>>> 07dba15da (adding some changes for styling and making tables look nicer) diff --git a/doc/source/_static/main.js b/doc/source/_static/main.js deleted file mode 100644 index 1aa301ec14..0000000000 --- a/doc/source/_static/main.js +++ /dev/null @@ -1,173 +0,0 @@ -$(document).ready(function() { - function createRadioButtons() { - var radioButtons = ` -
Curvature
-
-
- - - - - -
- - - -
-
-
Operation Type
-
-
- - - - - -
- - - `; - var dropdown = document.querySelector('.functions-filter .sd-card-text'); - if (dropdown) { - dropdown.innerHTML = radioButtons; - } - } - - function initializeMainTable() { - var table = $('table.atomic-functions').DataTable(); - var originalData = table.data().toArray(); - $('#operationTypeFilter input').change(function(e) { - console.log(e) - }); - $('#applyFilters').click(function() { - var curvatureValue = $('input[name="curvature"]:checked').val(); - var operationTypeValue = $('input[name="operationType"]:checked').val(); - var filteredData = originalData; - - if (curvatureValue !== "all") { - filteredData = filteredData.filter(row => { - const curv = $(row[4]).text().trim(); - return curv === curvatureValue; - }); - } - if (operationTypeValue !== "all") { - filteredData = filteredData.filter(row => { - const type = $(row[6]).text().trim(); - return type === operationTypeValue; - }); - } - table.clear().rows.add(filteredData).draw(); - }); - - $('#resetFilters').click(function() { - $('input[name="curvature"][value="all"]').prop('checked', true); - $('input[name="operationType"][value="all"]').prop('checked', true); - table.clear().rows.add(originalData).draw(); - }); - } - - -function createDCPTable(tableClass, typeValue) { - var newTable = $(`table.${tableClass}`); - const curvatures = ['convex', 'concave', 'affine']; - if (typeValue === "elementwise") { - curvatures.push('constant'); - } - - const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { - const curvatureValue = $(row[4]).text().trim(); - const rowTypeValue = $(row[6]).text().trim(); - return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; - }); - - newTable.DataTable({ - data: dcpData, - columns: [ - { title: "Function" }, - { title: "Meaning" }, - { title: "Domain" }, - { title: "Sign" }, - { title: "Curvature" }, - { title: "Monotonicity" }, - ] - }); -} - -function createMatrixDCPTable(tableClass, typeValue) { - var newTable = $(`table.${tableClass}`); - const curvatures = ['affine']; - - const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { - const curvatureValue = $(row[4]).text().trim(); - const rowTypeValue = $(row[6]).text().trim(); - return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; - }); - - newTable.DataTable({ - data: dcpData, - columns: [ - { title: "Function" }, - { title: "Meaning" }, - { title: "Domain" }, - { title: "Sign", visible: false }, - { title: "Curvature" }, - { title: "Monotonicity" }, - ] - }); -} - -function createDGPTable(tableClass, typeValue) { - var newTable = $(`table.${tableClass}`); - const curvatures = ['log-log affine', 'log-log convex', 'log-log concave', 'constant']; - - const dcpData = $('table.atomic-functions').DataTable().data().toArray().filter(row => { - const curvatureValue = $(row[4]).text().trim(); - const rowTypeValue = $(row[6]).text().trim(); - return curvatures.includes(curvatureValue) && rowTypeValue === typeValue; - }); - - newTable.DataTable({ - data: dcpData, - columns: [ - { title: "Function" }, - { title: "Meaning" }, - { title: "Domain" }, - { title: "Sign", visible: false }, - { title: "Curvature" }, - { title: "Monotonicity" }, - ] - }); -} - - createRadioButtons(); - initializeMainTable(); - createDCPTable("scalar-dcp", "scalar"); - createDCPTable("element-dcp", "elementwise"); - createMatrixDCPTable("matrix-dcp", "matrix"); - createDGPTable("scalar-dgp", "scalar"); - createDGPTable("element-dgp", "elementwise"); - createDGPTable("matrix-dgp", "matrix"); - -}); diff --git a/doc/source/conf.py b/doc/source/conf.py index 3b7b7c52dc..74e6833a3b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -258,11 +258,11 @@ def __getattr__(self, name): html_static_path = ['_static'] html_css_files = [ 'css/styling.css', - 'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css', + 'https://cdn.datatables.net/2.1.8/css/dataTables.dataTables.css', ] html_js_files = [ - 'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js', - 'main.js', + 'https://cdn.datatables.net/2.1.8/js/dataTables.js', + 'js/functions-table.js', ] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst index 522389f2e9..5e30e9c114 100644 --- a/doc/source/functions/index.rst +++ b/doc/source/functions/index.rst @@ -4,9 +4,101 @@ Functions ========= The table below lists all the atomic functions available in CVXPY. -.. card:: Filters - :class-card: functions-filter +Filters +------- - card content +.. raw:: html -.. include:: functions_table.rst \ No newline at end of file +
+
+
Curvature
+
+
+ + + + +
+ + + +
+
+
Operation Type
+
+
+ + + + +
+ + +
+
+ +Atoms table +----------- +.. include:: functions_table.rst + + +.. raw:: html + + + \ No newline at end of file From a74773c5addfb07b4e0e40171ea3792d2af4561f Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Thu, 19 Dec 2024 13:36:58 -0500 Subject: [PATCH 05/16] major progress in table, no more submit button --- doc/source/functions/index.rst | 90 ++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst index 5e30e9c114..62673dc1d8 100644 --- a/doc/source/functions/index.rst +++ b/doc/source/functions/index.rst @@ -6,7 +6,6 @@ The table below lists all the atomic functions available in CVXPY. Filters ------- - .. raw:: html
@@ -38,8 +37,8 @@ Filters
-
Operation Type
-
+
Type
+
- - +
Sign
+
+
+ + + + +
@@ -63,42 +76,43 @@ Atoms table ----------- .. include:: functions_table.rst - .. raw:: html - \ No newline at end of file + $('#curvatureFilter input, #typeFilter input, #signFilter input').change(applyFilters); + } + initializeMainTable(); + }); + \ No newline at end of file From 7f68022d720cfa341c613f47b417351ce0999980 Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Thu, 19 Dec 2024 13:43:27 -0500 Subject: [PATCH 06/16] some minor fixes to file changes --- .gitignore | 2 +- doc/source/conf.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0faca17d6e..7a4db1cf15 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,4 @@ tags cvxpy/version.py # Hypothesis testing -.hypothesis/ +.hypothesis/ \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 74e6833a3b..717ce4477e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -262,7 +262,6 @@ def __getattr__(self, name): ] html_js_files = [ 'https://cdn.datatables.net/2.1.8/js/dataTables.js', - 'js/functions-table.js', ] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. From fd815772e6d1bf235b6c83896c46e3068a38a11c Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Fri, 20 Dec 2024 11:43:50 -0500 Subject: [PATCH 07/16] fixing issue with table not loading when refreshing --- doc/source/functions/functions_table.rst | 24 +++++++++++++++--------- doc/source/functions/index.rst | 3 +++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/doc/source/functions/functions_table.rst b/doc/source/functions/functions_table.rst index 19c55895cd..457f42cc05 100644 --- a/doc/source/functions/functions_table.rst +++ b/doc/source/functions/functions_table.rst @@ -16,7 +16,9 @@ * - :ref:`dotsort(X,W) ` constant :math:`W \in \mathbf{R}^{o \times p}` - - :math:`\langle sort\left(vec(X)\right), sort\left(vec(W)\right) \rangle` + - :math:`\text{dot product of}` + :math:`\operatorname{sort}\operatorname{vec}(X) \text{ and}` + :math:`\operatorname{sort}\operatorname{vec}(W)` - :math:`X \in \mathbf{R}^{m \times n}` - depends on :math:`X`, :math:`W` - |convex| convex @@ -72,7 +74,8 @@ * - :ref:`lambda_sum_largest(X,k) ` :math:`k = 1,\ldots, n` - - :math:`\text{sum of $k$ largest}\\ \text{eigenvalues of $X$}` + - :math:`\text{sum of $k$ largest}` + :math:`\text{eigenvalues of $X$}` - :math:`X \in\mathbf{S}^{n}` - |unknown| unknown - |convex| convex @@ -82,7 +85,8 @@ * - :ref:`lambda_sum_smallest(X,k) ` :math:`k = 1,\ldots, n` - - :math:`\text{sum of $k$ smallest}\\ \text{eigenvalues of $X$}` + - :math:`\text{sum of $k$ smallest}` + :math:`\text{eigenvalues of $X$}` - :math:`X \in\mathbf{S}^{n}` - |unknown| unknown - |concave| concave @@ -234,7 +238,7 @@ :math:`p \geq 1` or ``p = 'inf'`` - - :math:`\|X\|_p = \left(\sum_{ij} |X_{ij}|^p \right)^{1/p}` + - :math:`\left(\sum_{ij} |X_{ij}|^p \right)^{1/p}` - :math:`X \in \mathbf{R}^{m \times n}` - |positive| positive - |convex| convex @@ -244,7 +248,7 @@ * - :ref:`pnorm(X, p) ` :math:`p < 1`, :math:`p \neq 0` - - :math:`\|X\|_p = \left(\sum_{ij} X_{ij}^p \right)^{1/p}` + - :math:`\left(\sum_{ij} X_{ij}^p \right)^{1/p}` - :math:`X \in \mathbf{R}^{m \times n}_+` - |positive| positive - |concave| concave @@ -304,7 +308,7 @@ * - :ref:`std(X) ` - - :math:`\sqrt{\frac{1}{mn} \sum_{ij}\left(X_{ij} - \frac{1}{mn}\sum_{k\ell} X_{k\ell}\right)^2}` + - analog to `numpy.std `_ - :math:`X \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex @@ -378,7 +382,8 @@ - scalar * - :ref:`tv(X) ` - - :math:`\sum_{ij}\left\| \left[\begin{matrix} X_{i+1,j} - X_{ij} \\ X_{i,j+1} -X_{ij} \end{matrix}\right] \right\|_2` + :math:`Y = \left[\begin{matrix} X_{i+1,j} - X_{ij} \\ X_{i,j+1} -X_{ij} \end{matrix}\right]` + - :math:`\sum_{ij}\left\| Y \right\|_2` - :math:`X \in \mathbf{R}^{m \times n}` - |positive| positive - |convex| convex @@ -386,7 +391,8 @@ - scalar * - :ref:`tv([X1,...,Xk]) ` - - :math:`\sum_{ij}\left\| \left[\begin{matrix} X_{i+1,j}^{(1)} - X_{ij}^{(1)} \\ X_{i,j+1}^{(1)} -X_{ij}^{(1)} \\ \vdots \\ X_{i+1,j}^{(k)} - X_{ij}^{(k)} \\ X_{i,j+1}^{(k)} -X_{ij}^{(k)} \end{matrix}\right] \right\|_2` + :math:`Y = \left[\begin{matrix} X_{i+1,j}^{(1)} - X_{ij}^{(1)} \\ X_{i,j+1}^{(1)} -X_{ij}^{(1)} \\ \vdots \\ X_{i+1,j}^{(k)} - X_{ij}^{(k)} \\ X_{i,j+1}^{(k)} -X_{ij}^{(k)} \end{matrix}\right]` + - :math:`\sum_{ij}\left\| Y \right\|_2` - :math:`X^{(i)} \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex @@ -395,7 +401,7 @@ * - :ref:`var(X) ` - - :math:`{\frac{1}{mn} \sum_{ij}\left(X_{ij} - \frac{1}{mn}\sum_{k\ell} X_{k\ell}\right)^2}` + - analog to `numpy.var `_ - :math:`X \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst index 62673dc1d8..809b54c18f 100644 --- a/doc/source/functions/index.rst +++ b/doc/source/functions/index.rst @@ -78,6 +78,9 @@ Atoms table .. raw:: html + + + \ No newline at end of file + From 909c36ee7157cfafacddd717e7e81c0a7b51db90 Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Fri, 3 Jan 2025 17:35:28 -0500 Subject: [PATCH 12/16] removing column for operation type --- doc/source/functions/functions_table.rst | 156 +---------------------- doc/source/functions/index.rst | 25 +--- 2 files changed, 3 insertions(+), 178 deletions(-) diff --git a/doc/source/functions/functions_table.rst b/doc/source/functions/functions_table.rst index d502d6cbbf..b4d0303278 100644 --- a/doc/source/functions/functions_table.rst +++ b/doc/source/functions/functions_table.rst @@ -10,7 +10,6 @@ - Domain - DCP Properties - Curvature |_| - - Type * - :ref:`dotsort(X,W) ` @@ -23,7 +22,6 @@ |incr| for :math:`\min(W) \geq 0` - |convex| convex - - scalar * - :ref:`geo_mean(x) ` @@ -38,7 +36,6 @@ |incr| incr. - |concave| concave - - scalar * - :ref:`harmonic_mean(x) ` - :math:`\frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}}` @@ -47,7 +44,6 @@ |incr| incr. - |concave| concave - - scalar * - :ref:`inv_prod(x) ` - :math:`(x_1\cdots x_n)^{-1}` @@ -56,21 +52,18 @@ |decr| decr. - |convex| convex - - scalar * - :ref:`lambda_max(X) ` - :math:`\lambda_{\max}(X)` - :math:`X \in \mathbf{S}^n` - |unknown| unknown sign - |convex| convex - - scalar * - :ref:`lambda_min(X) ` - :math:`\lambda_{\min}(X)` - :math:`X \in \mathbf{S}^n` - |unknown| unknown sign - |concave| concave - - scalar * - :ref:`lambda_sum_largest(X,k) ` @@ -80,7 +73,6 @@ - :math:`X \in\mathbf{S}^{n}` - |unknown| unknown sign - |convex| convex - - scalar * - :ref:`lambda_sum_smallest(X,k) ` @@ -90,7 +82,6 @@ - :math:`X \in\mathbf{S}^{n}` - |unknown| unknown sign - |concave| concave - - scalar * - :ref:`log_det(X) ` @@ -98,7 +89,6 @@ - :math:`X \in \mathbf{S}^n_+` - |unknown| unknown sign - |concave| concave - - scalar * - :ref:`log_sum_exp(X) ` @@ -108,7 +98,6 @@ |incr| incr. - |convex| convex - - scalar * - :ref:`matrix_frac(x, P) ` @@ -116,7 +105,6 @@ - :math:`x \in \mathbf{R}^n` - |positive| positive - |convex| convex - - scalar * - :ref:`max(X) ` @@ -126,7 +114,6 @@ |incr| incr. - |convex| convex - - scalar * - :ref:`mean(X) ` @@ -136,7 +123,6 @@ |incr| incr. - |affine| affine - - scalar * - :ref:`min(X) ` @@ -146,7 +132,6 @@ |incr| incr. - |concave| concave - - scalar * - :ref:`mixed_norm(X, p, q) ` @@ -154,7 +139,6 @@ - :math:`X \in\mathbf{R}^{n \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`norm(x) ` @@ -165,7 +149,6 @@ |incr| for :math:`x_{i} \geq 0` - |convex| convex - - scalar * - :ref:`norm(x, 1) ` - :math:`\sum_{i}\lvert x_{i} \rvert` @@ -174,7 +157,6 @@ |incr| for :math:`x_{i} \geq 0` - |convex| convex - - scalar * - :ref:`norm(x, "inf") ` - :math:`\max_{i} \{\lvert x_{i} \rvert\}` @@ -183,7 +165,6 @@ |incr| for :math:`x_{i} \geq 0` - |convex| convex - - scalar * - :ref:`norm(X, "fro") ` - :math:`\sqrt{\sum_{ij}X_{ij}^2 }` @@ -192,7 +173,6 @@ |incr| for :math:`X_{ij} \geq 0` - |convex| convex - - scalar * - :ref:`norm(X, 1) ` - :math:`\max_{j} \|X_{:,j}\|_1` @@ -201,7 +181,6 @@ |incr| for :math:`X_{ij} \geq 0` - |convex| convex - - scalar * - :ref:`norm(X, "inf") ` - :math:`\max_{i} \|X_{i,:}\|_1` @@ -210,14 +189,12 @@ |incr| for :math:`X_{ij} \geq 0` - |convex| convex - - scalar * - :ref:`norm(X, "nuc") ` - :math:`\mathrm{tr}\left(\left(X^T X\right)^{1/2}\right)` - :math:`X \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`norm(X) ` norm(X, 2) @@ -225,7 +202,6 @@ - :math:`X in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`perspective(f(x),s) ` @@ -235,7 +211,6 @@ - same sign as f - |convex| / |concave| same as :math:`f` - - scalar * - :ref:`pnorm(X, p) ` @@ -247,7 +222,6 @@ |incr| for :math:`X_{ij} \geq 0` - |convex| convex - - scalar * - :ref:`pnorm(X, p) ` @@ -258,7 +232,6 @@ |incr| incr. - |concave| concave - - scalar * - :ref:`ptp(X) ` @@ -266,7 +239,6 @@ - :math:`X \in \mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`quad_form(x, P) ` @@ -277,7 +249,6 @@ |incr| for :math:`x_i \geq 0` - |convex| convex - - scalar * - :ref:`quad_form(x, P) ` @@ -288,7 +259,6 @@ |decr| for :math:`x_i \geq 0` - |concave| concave - - scalar * - :ref:`quad_form(c, X) ` @@ -299,7 +269,6 @@ monotonicity depends |_| on |_| c - |affine| affine - - scalar * - :ref:`quad_over_lin(X, y) ` @@ -312,7 +281,6 @@ |decr| for :math:`X_{ij} \leq 0` |decr| decr. in :math:`y` - |convex| convex - - scalar * - :ref:`std(X) ` @@ -320,7 +288,6 @@ - :math:`X \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`sum(X) ` @@ -330,7 +297,6 @@ |incr| incr. - |affine| affine - - scalar * - :ref:`sum_largest(X, k) ` @@ -343,7 +309,6 @@ |incr| incr. - |convex| convex - - scalar * - :ref:`sum_smallest(X, k) ` @@ -356,7 +321,6 @@ |incr| incr. - |concave| concave - - scalar * - :ref:`sum_squares(X) ` @@ -367,7 +331,6 @@ |incr| for :math:`X_{ij} \geq 0` |decr| for :math:`X_{ij} \leq 0` - |convex| convex - - scalar * - :ref:`trace(X) ` @@ -377,7 +340,6 @@ |incr| incr. - |affine| affine - - scalar * - :ref:`tr_inv(X) ` @@ -385,7 +347,6 @@ - :math:`X \in\mathbf{S}^n_{++}` - |positive| positive - |convex| convex - - scalar * - :ref:`tv(x) ` @@ -393,7 +354,6 @@ - :math:`x \in \mathbf{R}^n` - |positive| positive - |convex| convex - - scalar * - :ref:`tv(X) ` :math:`Y = \left[\begin{matrix} X_{i+1,j} - X_{ij} \\ X_{i,j+1} -X_{ij} \end{matrix}\right]` @@ -401,7 +361,6 @@ - :math:`X \in \mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`tv([X1,...,Xk]) ` :math:`Y = \left[\begin{matrix} X_{i+1,j}^{(1)} - X_{ij}^{(1)} \\ X_{i,j+1}^{(1)} -X_{ij}^{(1)} \\ \vdots \\ X_{i+1,j}^{(k)} - X_{ij}^{(k)} \\ X_{i,j+1}^{(k)} -X_{ij}^{(k)} \end{matrix}\right]` @@ -409,7 +368,6 @@ - :math:`X^{(i)} \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`var(X) ` @@ -417,7 +375,6 @@ - :math:`X \in\mathbf{R}^{m \times n}` - |positive| positive - |convex| convex - - scalar * - :ref:`abs(x) ` @@ -427,7 +384,6 @@ |incr| for :math:`x \geq 0` - |convex| convex - - elementwise * - :ref:`conj(x) ` @@ -435,7 +391,6 @@ - :math:`x \in \mathbf{C}` - |unknown| unknown sign - |affine| affine - - elementwise * - :ref:`entr(x) ` @@ -443,7 +398,6 @@ - :math:`x > 0` - |unknown| unknown sign - |concave| concave - - elementwise * - :ref:`exp(x) ` @@ -453,7 +407,6 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`huber(x, M=1) ` @@ -468,7 +421,6 @@ |decr| for :math:`x \leq 0` - |convex| convex - - elementwise * - :ref:`imag(x) ` @@ -478,7 +430,6 @@ - :math:`x \in \mathbf{C}` - |unknown| unknown sign - |affine| affine - - elementwise * - :ref:`inv_pos(x) ` @@ -488,7 +439,6 @@ |decr| decr. - |convex| convex - - elementwise * - :ref:`kl_div(x, y) ` @@ -498,7 +448,6 @@ :math:`y > 0` - |positive| positive - |convex| convex - - elementwise * - :ref:`log(x) ` @@ -508,7 +457,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`log_normcdf(x) ` @@ -518,7 +466,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`log1p(x) ` @@ -528,7 +475,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`loggamma(x) ` @@ -536,7 +482,6 @@ - :math:`x > 0` - |unknown| unknown sign - |convex| convex - - elementwise * - :ref:`logistic(x) ` @@ -546,7 +491,6 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`maximum(x, y) ` @@ -556,7 +500,6 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`minimum(x, y) ` - :math:`\min \left\{x, y\right\}` @@ -565,7 +508,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`multiply(c, x) ` @@ -576,7 +518,6 @@ monotonicity depends |_| on |_| c - |affine| affine - - elementwise * - :ref:`neg(x) ` - :math:`\max \left\{-x, 0 \right\}` @@ -585,7 +526,6 @@ |decr| decr. - |convex| convex - - elementwise * - :ref:`pos(x) ` - :math:`\max \left\{x, 0 \right\}` @@ -594,14 +534,12 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`power(x, 0) ` - :math:`1` - :math:`x \in \mathbf{R}` - |positive| positive - constant - - elementwise * - :ref:`power(x, 1) ` - :math:`x` @@ -610,7 +548,6 @@ |incr| incr. - |affine| affine - - elementwise * - :ref:`power(x, p) ` @@ -622,7 +559,6 @@ |incr| for :math:`x \geq 0` |decr| for :math:`x \leq 0` - |convex| convex - - elementwise * - :ref:`power(x, p) ` @@ -633,7 +569,6 @@ |decr| decr. - |convex| convex - - elementwise * - :ref:`power(x, p) ` @@ -644,7 +579,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`power(x, p) ` @@ -656,7 +590,6 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`real(x) ` @@ -666,7 +599,6 @@ |incr| incr. - |affine| affine - - elementwise * - :ref:`rel_entr(x, y) ` @@ -678,7 +610,6 @@ |decr| in :math:`y` - |convex| convex - - elementwise * - :ref:`scalene(x, alpha, beta) ` @@ -693,7 +624,6 @@ |decr| for :math:`x \leq 0` - |convex| convex - - elementwise * - :ref:`sqrt(x) ` @@ -703,7 +633,6 @@ |incr| incr. - |concave| concave - - elementwise * - :ref:`square(x) ` @@ -715,7 +644,6 @@ |decr| for :math:`x \leq 0` - |convex| convex - - elementwise * - :ref:`xexp(x) ` @@ -725,7 +653,6 @@ |incr| incr. - |convex| convex - - elementwise * - :ref:`bmat() ` @@ -733,7 +660,6 @@ - :math:`X^{(i,j)} \in\mathbf{R}^{m_i \times n_j}` - |incr| incr. - |affine| affine - - matrix * - :ref:`convolve(c, x) ` @@ -742,7 +668,6 @@ - :math:`x\in \mathbf{R}^n` - monotonicity depends |_| on |_| c - |affine| affine - - matrix * - :ref:`cumsum(X, axis=0) ` @@ -750,7 +675,6 @@ - :math:`X \in \mathbf{R}^{m \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`diag(x) ` @@ -758,14 +682,12 @@ - :math:`x \in\mathbf{R}^{n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`diag(X) ` - :math:`\left[\begin{matrix}X_{11} \\\vdots \\X_{nn}\end{matrix}\right]` - :math:`X \in\mathbf{R}^{n \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`diff(X, k=1, axis=0) ` @@ -774,7 +696,6 @@ - :math:`X \in\mathbf{R}^{m \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`hstack([X1, ..., Xk]) ` @@ -782,7 +703,6 @@ - :math:`X^{(i)} \in\mathbf{R}^{m \times n_i}` - |incr| incr. - |affine| affine - - matrix * - :ref:`kron(X, Y) ` @@ -791,7 +711,6 @@ - :math:`Y \in \mathbf{R}^{m \times n}` - monotonicity depends on :math:`X` - |affine| affine - - matrix * - :ref:`kron(X, Y) ` @@ -800,7 +719,6 @@ - :math:`X \in \mathbf{R}^{p \times q}` - monotonicity depends on :math:`Y` - |affine| affine - - matrix * - :ref:`outer(x, y) ` @@ -809,7 +727,6 @@ - :math:`x \in \mathbf{R}^n` - monotonicity depends on :math:`Y` - |affine| affine - - matrix * - :ref:`partial_trace(X, dims, axis=0) ` @@ -817,7 +734,6 @@ - :math:`X \in\mathbf{R}^{n \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`partial_transpose(X, dims, axis=0) ` @@ -825,7 +741,6 @@ - :math:`X \in\mathbf{R}^{n \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`reshape(X, (m', n'), order='F') ` @@ -835,7 +750,6 @@ :math:`m'n' = mn` - |incr| incr. - |affine| affine - - matrix * - :ref:`upper_tri(X) ` @@ -843,7 +757,6 @@ - :math:`X \in \mathbf{R}^{n \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`vec(X) ` @@ -851,7 +764,6 @@ - :math:`X \in\mathbf{R}^{m \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`vec_to_upper_tri(X, strict=False) ` @@ -861,15 +773,12 @@ - :math:`X \in\mathbf{R}^{n \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`vstack([X1, ..., Xk]) ` - - :math:`\left[\begin{matrix}X^{(1)} \\ \vdots \\X^{(k)}\end{matrix}\right]` - :math:`X^{(i)} \in\mathbf{R}^{m_i \times n}` - |incr| incr. - |affine| affine - - matrix * - :ref:`geo_mean(x) ` @@ -884,61 +793,51 @@ - :math:`x \in \mathbf{R}^n_{+}` - |incr| incr. - |affine| log-log affine - - scalar * - :ref:`harmonic_mean(x) ` - :math:`\frac{n}{\frac{1}{x_1} + \cdots + \frac{1}{x_n}}` - :math:`x \in \mathbf{R}^n_{+}` - |incr| incr. - |concave| log-log concave - - scalar * - :ref:`max(X) ` - - :math:`\max_{ij}\left\{ X_{ij}\right\}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`min(X) ` - - :math:`\min_{ij}\left\{ X_{ij}\right\}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |concave| log-log concave - - scalar * - :ref:`norm(x) ` - norm(x, 2) + :ref:`norm(x, 2) ` - :math:`\sqrt{\sum_{i} \lvert x_{i} \rvert^2 }` - :math:`X \in\mathbf{R}^{n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`norm(X, "fro") ` - :math:`\sqrt{\sum_{ij}X_{ij}^2 }` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`norm(X, 1) ` - :math:`\sum_{ij}\lvert X_{ij} \rvert` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`norm(X, "inf") ` - :math:`\max_{ij} \{\lvert X_{ij} \rvert\}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`pnorm(X, p) ` @@ -949,31 +848,25 @@ - :math:`X \in \mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`pnorm(X, p) ` - :math:`0 < p < 1` - :math:`\left(\sum_{ij} X_{ij}^p \right)^{1/p}` - :math:`X \in \mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`prod(X) ` - - :math:`\prod_{ij}X_{ij}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |affine| log-log affine - - scalar * - :ref:`quad_form(x, P) ` - :math:`x^T P x` - :math:`x \in \mathbf{R}^n`, :math:`P \in \mathbf{R}^{n \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`quad_over_lin(X, y) ` - :math:`\left(\sum_{ij}X_{ij}^2\right)/y` @@ -984,39 +877,30 @@ |decr| decr. in :math:`y` - |convex| log-log convex - - scalar * - :ref:`sum(X) ` - - :math:`\sum_{ij}X_{ij}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`sum_squares(X) ` - - :math:`\sum_{ij}X_{ij}^2` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`trace(X) ` - - :math:`\mathrm{tr}\left(X \right)` - :math:`X \in\mathbf{R}^{n \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`pf_eigenvalue(X) ` - - spectral radius of :math:`X` - :math:`X \in\mathbf{R}^{n \times n}_{++}` - |incr| incr. - |convex| log-log convex - - scalar * - :ref:`diff_pos(x, y) ` - :math:`x - y` @@ -1025,67 +909,54 @@ |decr| decr. in :math:`y` - |concave| log-log concave - - elementwise * - :ref:`entr(x) ` - - :math:`-x \log (x)` - :math:`0 < x < 1` - None - |concave| log-log concave - - elementwise * - :ref:`exp(x) ` - - :math:`e^x` - :math:`x > 0` - |incr| incr. - |convex| log-log convex - - elementwise * - :ref:`log(x) ` - - :math:`\log(x)` - :math:`x > 1` - |incr| incr. - |concave| log-log concave - - elementwise * - :ref:`maximum(x, y) ` - - :math:`\max \left\{x, y\right\}` - :math:`x,y > 0` - |incr| incr. - |convex| log-log convex - - elementwise * - :ref:`minimum(x, y) ` - :math:`\min \left\{x, y\right\}` - :math:`x, y > 0` - |incr| incr. - |concave| log-log concave - - elementwise * - :ref:`multiply(x, y) ` - :math:`x*y` - :math:`x, y > 0` - |incr| incr. - |affine| log-log affine - - elementwise * - :ref:`one_minus_pos(x) ` - :math:`1 - x` - :math:`0 < x < 1` - |decr| decr. - |concave| log-log concave - - elementwise * - :ref:`power(x, 0) ` - :math:`1` - :math:`x > 0` - constant - constant - - elementwise * - :ref:`power(x, p) ` - :math:`x` @@ -1094,55 +965,42 @@ |decr| for :math:`p < 0` - |affine| log-log affine - - elementwise * - :ref:`sqrt(x) ` - - - :math:`\sqrt x` - :math:`x > 0` - |incr| incr. - |affine| log-log affine - - elementwise * - :ref:`square(x) ` - - :math:`x^2` - :math:`x > 0` - |incr| incr. - |affine| log-log affine - - elementwise * - :ref:`xexp(x) ` - - :math:`x e^x` - :math:`x > 0` - |incr| incr. - |convex| log-log convex - - elementwise * - :ref:`bmat() ` - - :math:`\left[\begin{matrix} X^{(1,1)} & .. & X^{(1,q)} \\ \vdots & & \vdots \\ X^{(p,1)} & .. & X^{(p,q)} \end{matrix}\right]` - :math:`X^{(i,j)} \in\mathbf{R}^{m_i \times n_j}_{++}` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`diag(x) ` - - :math:`\left[\begin{matrix}x_1 & & \\& \ddots & \\& & x_n\end{matrix}\right]` - :math:`x \in\mathbf{R}^{n}_{++}` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`diag(X) ` - :math:`\left[\begin{matrix}X_{11} \\\vdots \\X_{nn}\end{matrix}\right]` - :math:`X \in\mathbf{R}^{n \times n}_{++}` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`eye_minus_inv(X) ` - :math:`(I - X)^{-1}` @@ -1151,7 +1009,6 @@ :math:`\lambda_{\text{pf}}(X) < 1` - |incr| incr. - |convex| log-log convex - - matrix * - :ref:`gmatmul(A, x) ` @@ -1162,22 +1019,20 @@ |decr| for :math:`A_{ij} \leq 0` - |affine| log-log affine - - matrix * - :ref:`hstack([X1, ..., Xk]) ` - :math:`\left[\begin{matrix}X^{(1)} \cdots X^{(k)}\end{matrix}\right]` - :math:`X^{(i)} \in\mathbf{R}^{m \times n_i}_{++}` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`matmul(X, Y) ` - :math:`XY` - :math:`X \in\mathbf{R}^{m \times n}_{++}` + :math:`Y \in\mathbf{R}^{n \times p}_{++}` - |incr| incr. - |convex| log-log convex - - matrix * - :ref:`resolvent(X) ` - :math:`(sI - X)^{-1}` @@ -1186,33 +1041,26 @@ :math:`\lambda_{\text{pf}}(X) < s` - |incr| incr. - |convex| log-log convex - - matrix * - :ref:`reshape(X, (m', n')) ` - - :math:`X' \in\mathbf{R}^{m' \times n'}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` :math:`m'n' = mn` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`vec(X) ` - - :math:`x' \in\mathbf{R}^{mn}` - :math:`X \in\mathbf{R}^{m \times n}_{++}` - |incr| incr. - |affine| log-log affine - - matrix * - :ref:`vstack([X1, ..., Xk]) ` - - :math:`\left[\begin{matrix}X^{(1)} \\ \vdots \\X^{(k)}\end{matrix}\right]` - :math:`X^{(i)} \in\mathbf{R}^{m_i \times n}_{++}` - |incr| incr. - |affine| log-log affine - - matrix .. |positive| image:: /tutorial/functions/functions_files/positive.svg :width: 15px diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst index cf71f9f13b..054779cc0c 100644 --- a/doc/source/functions/index.rst +++ b/doc/source/functions/index.rst @@ -35,22 +35,6 @@ The table below lists all the atomic functions available in CVXPY. -
Type
-
-
- - - - -
DCP Property
@@ -98,7 +82,6 @@ Atoms table function applyFilters() { var curvatureValue = $('input[name="curvature"]:checked').val(); - var operationTypeValue = $('input[name="operationType"]:checked').val(); var dcpFilterValue = $('input[name="dcpProperties"]:checked').val(); var filteredData = originalData; @@ -108,12 +91,6 @@ Atoms table return curv === curvatureValue; }); } - if (operationTypeValue !== "all") { - filteredData = filteredData.filter(row => { - const type = $(row[6]).text().trim(); - return type === operationTypeValue; - }); - } if (dcpFilterValue !== "all") { filteredData = filteredData.filter(row => { const dcp = $(row[3]).text().trim(); @@ -123,7 +100,7 @@ Atoms table table.clear().rows.add(filteredData).draw(); } - $('#curvatureFilter input, #typeFilter input, #dcpFilter input').change(applyFilters); + $('#curvatureFilter input, #dcpFilter input').change(applyFilters); } initializeMainTable(); }); From 41f2d4b6717f552f3242e970f52de736d420cc93 Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Fri, 3 Jan 2025 17:51:18 -0500 Subject: [PATCH 13/16] changing python version in rtd --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b421e8ee44..cbc40916bd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.13" # You can also specify other tool versions: # nodejs: "19" # rust: "1.64" From ef8a0079cf5fd0dfa0ece5e7d86726b047d3054b Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Fri, 3 Jan 2025 17:54:17 -0500 Subject: [PATCH 14/16] changing os in rtd setup --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index cbc40916bd..af6538fd8c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 # Set the OS, Python version and other tools you might need build: - os: ubuntu-22.04 + os: mac-os tools: - python: "3.13" + python: "3.12" # You can also specify other tool versions: # nodejs: "19" # rust: "1.64" From 16db43ffed99fa844d4da91d774cea9c1d90393a Mon Sep 17 00:00:00 2001 From: William Zijie Zhang Date: Fri, 3 Jan 2025 17:55:18 -0500 Subject: [PATCH 15/16] changing back to ubuntu --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index af6538fd8c..b1c27fc3d6 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,7 +7,7 @@ version: 2 # Set the OS, Python version and other tools you might need build: - os: mac-os + os: ubuntu-22.04 tools: python: "3.12" # You can also specify other tool versions: From 2b65854e6a51f533288d39a6ee0b9fe3e4b532ea Mon Sep 17 00:00:00 2001 From: William Zijie Zhang <89562186+Transurgeon@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:36:45 +0000 Subject: [PATCH 16/16] changing atoms per page to 15 --- doc/source/functions/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/functions/index.rst b/doc/source/functions/index.rst index 054779cc0c..e21358c2b2 100644 --- a/doc/source/functions/index.rst +++ b/doc/source/functions/index.rst @@ -76,7 +76,8 @@ Atoms table bottomStart: null, bottomEnd: null, bottom: 'paging' - } + }, + pageLength: 15 } ); var originalData = table.data().toArray();