summaryrefslogtreecommitdiff
path: root/glpk-5.0/src/simplex/spxat.h
diff options
context:
space:
mode:
authorPasha <pasha@member.fsf.org>2023-01-27 00:54:07 +0000
committerPasha <pasha@member.fsf.org>2023-01-27 00:54:07 +0000
commitef800d4ffafdbde7d7a172ad73bd984b1695c138 (patch)
tree920cc189130f1e98f252283fce94851443641a6d /glpk-5.0/src/simplex/spxat.h
parentec4ae3c2b5cb0e83fb667f14f832ea94f68ef075 (diff)
downloadoneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.gz
oneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.bz2
simplex-glpk with modified glpk for fpgaHEADmaster
Diffstat (limited to 'glpk-5.0/src/simplex/spxat.h')
-rw-r--r--glpk-5.0/src/simplex/spxat.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/glpk-5.0/src/simplex/spxat.h b/glpk-5.0/src/simplex/spxat.h
new file mode 100644
index 0000000..a432361
--- /dev/null
+++ b/glpk-5.0/src/simplex/spxat.h
@@ -0,0 +1,78 @@
+/* spxat.h */
+
+/***********************************************************************
+* This code is part of GLPK (GNU Linear Programming Kit).
+* Copyright (C) 2015 Free Software Foundation, Inc.
+* Written by Andrew Makhorin <mao@gnu.org>.
+*
+* GLPK is free software: you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* GLPK is distributed in the hope that it will be useful, but WITHOUT
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+* License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with GLPK. If not, see <http://www.gnu.org/licenses/>.
+***********************************************************************/
+
+#ifndef SPXAT_H
+#define SPXAT_H
+
+#include "spxlp.h"
+
+typedef struct SPXAT SPXAT;
+
+struct SPXAT
+{ /* mxn-matrix A of constraint coefficients in sparse row-wise
+ * format */
+ int *ptr; /* int ptr[1+m+1]; */
+ /* ptr[0] is not used;
+ * ptr[i], 1 <= i <= m, is starting position of i-th row in
+ * arrays ind and val; note that ptr[1] is always 1;
+ * ptr[m+1] indicates the position after the last element in
+ * arrays ind and val, i.e. ptr[m+1] = nnz+1, where nnz is the
+ * number of non-zero elements in matrix A;
+ * the length of i-th row (the number of non-zero elements in
+ * that row) can be calculated as ptr[i+1] - ptr[i] */
+ int *ind; /* int ind[1+nnz]; */
+ /* column indices */
+ double *val; /* double val[1+nnz]; */
+ /* non-zero element values */
+ double *work; /* double work[1+n]; */
+ /* working array */
+};
+
+#define spx_alloc_at _glp_spx_alloc_at
+void spx_alloc_at(SPXLP *lp, SPXAT *at);
+/* allocate constraint matrix in sparse row-wise format */
+
+#define spx_build_at _glp_spx_build_at
+void spx_build_at(SPXLP *lp, SPXAT *at);
+/* build constraint matrix in sparse row-wise format */
+
+#define spx_at_prod _glp_spx_at_prod
+void spx_at_prod(SPXLP *lp, SPXAT *at, double y[/*1+n*/], double s,
+ const double x[/*1+m*/]);
+/* compute product y := y + s * A'* x */
+
+#define spx_nt_prod1 _glp_spx_nt_prod1
+void spx_nt_prod1(SPXLP *lp, SPXAT *at, double y[/*1+n-m*/], int ign,
+ double s, const double x[/*1+m*/]);
+/* compute product y := y + s * N'* x */
+
+#define spx_eval_trow1 _glp_spx_eval_trow1
+void spx_eval_trow1(SPXLP *lp, SPXAT *at, const double rho[/*1+m*/],
+ double trow[/*1+n-m*/]);
+/* compute i-th row of simplex table */
+
+#define spx_free_at _glp_spx_free_at
+void spx_free_at(SPXLP *lp, SPXAT *at);
+/* deallocate constraint matrix in sparse row-wise format */
+
+#endif
+
+/* eof */