SuperSCS  1.3.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
linSys.h
Go to the documentation of this file.
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2017 Pantelis Sopasakis (https://alphaville.github.io),
5  * Krina Menounou (https://www.linkedin.com/in/krinamenounou),
6  * Panagiotis Patrinos (http://homes.esat.kuleuven.be/~ppatrino)
7  * Copyright (c) 2012 Brendan O'Donoghue (bodonoghue85@gmail.com)
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a copy
10  * of this software and associated documentation files (the "Software"), to deal
11  * in the Software without restriction, including without limitation the rights
12  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  * copies of the Software, and to permit persons to whom the Software is
14  * furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included in all
17  * copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  *
27  */
28 #ifndef LINSYS_H_GUARD
29 #define LINSYS_H_GUARD
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35  /*
36  * YOUR LINEAR SYSTEM SOLVER MUST IMPLEMENT THESE METHODS AND scs_private_data
37  * STRUCT
38  */
39 
40  /*
41  * private data structs (that you define) containing any necessary data to solve
42  * linear system, etc.
43  */
44 
45  /*
46  * this defines the matrix A, only the linear system solver interacts with this
47  * struct
48  */
49 
55  typedef struct scs_a_data_matrix ScsAMatrix;
56 
61  typedef struct scs_private_data ScsPrivWorkspace;
62 
67  const ScsAMatrix *A,
68  const ScsSettings *stgs);
69 
85  const ScsAMatrix *A,
86  const ScsSettings *stgs,
88  scs_float *b,
89  const scs_float *s,
90  scs_int iter);
95 
100  const ScsAMatrix *A,
101  ScsPrivWorkspace *p,
102  const scs_float *x,
103  scs_float *y);
104 
108  void scs_accum_by_a(
109  const ScsAMatrix *A,
110  ScsPrivWorkspace *p,
111  const scs_float *x,
112  scs_float *y);
113 
118  const ScsAMatrix *A);
119 
124  char *scs_get_linsys_method(
125  const ScsAMatrix *A,
126  const ScsSettings *stgs);
127 
133  ScsPrivWorkspace *p,
134  const ScsInfo *info);
135 
136  /* Normalization routines, used if d->NORMALIZE is true */
145  void scs_normalize_a(
146  ScsAMatrix *A,
147  const ScsSettings *stgs,
148  const ScsCone *k,
149  ScsScaling *scal);
150 
155  void scs_unnormalize_a(
156  ScsAMatrix *A,
157  const ScsSettings *stgs,
158  const ScsScaling *scal);
159 
163  void scs_free_a_matrix(ScsAMatrix *A);
164 
172 
181 
189 
190 #ifdef COPYAMATRIX
191 
196  scs_int scs_copy_a_matrix(
197  ScsAMatrix **dstp,
198  const ScsAMatrix *src);
199 #endif
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif
void scs_normalize_a(ScsAMatrix *A, const ScsSettings *stgs, const ScsCone *k, ScsScaling *scal)
Terminating information.
Definition: scs.h:539
ScsPrivWorkspace * scs_init_priv(const ScsAMatrix *A, const ScsSettings *stgs)
struct scs_private_data ScsPrivWorkspace
Definition: linSys.h:61
void scs_free_priv(ScsPrivWorkspace *p)
scs_int scs_solve_lin_sys(const ScsAMatrix *A, const ScsSettings *stgs, ScsPrivWorkspace *p, scs_float *b, const scs_float *s, scs_int iter)
The sparse matrix A of the conic optimization problem.
Definition: amatrix.h:44
char * scs_get_linsys_method(const ScsAMatrix *A, const ScsSettings *stgs)
scs_float scs_linsys_total_solve_time_ms(ScsPrivWorkspace *priv)
void scs_free_a_matrix(ScsAMatrix *A)
scs_int scs_validate_linsys(const ScsAMatrix *A)
void scs_accum_by_a(const ScsAMatrix *A, ScsPrivWorkspace *p, const scs_float *x, scs_float *y)
int scs_int
Definition: glbopts.h:96
void scs_accum_by_a_trans(const ScsAMatrix *A, ScsPrivWorkspace *p, const scs_float *x, scs_float *y)
scs_int scs_linsys_total_cg_iters(ScsPrivWorkspace *priv)
Cone structure.
Definition: cones.h:48
void scs_unnormalize_a(ScsAMatrix *A, const ScsSettings *stgs, const ScsScaling *scal)
scs_int scs_linsys_is_indirect(void)
double scs_float
Definition: glbopts.h:100
Settings structure.
Definition: scs.h:290
Normalization variables.
Definition: scs.h:571
char * scs_get_linsys_summary(ScsPrivWorkspace *p, const ScsInfo *info)