SuperSCS  1.3.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Typedefs | Functions
linSys.h File Reference

Go to the source code of this file.

Typedefs

typedef struct scs_a_data_matrix ScsAMatrix
 
typedef struct scs_private_data ScsPrivWorkspace
 

Functions

ScsPrivWorkspacescs_init_priv (const ScsAMatrix *A, const ScsSettings *stgs)
 
scs_int scs_solve_lin_sys (const ScsAMatrix *A, const ScsSettings *stgs, ScsPrivWorkspace *p, scs_float *b, const scs_float *s, scs_int iter)
 
void scs_free_priv (ScsPrivWorkspace *p)
 
void scs_accum_by_a_trans (const ScsAMatrix *A, ScsPrivWorkspace *p, const scs_float *x, scs_float *y)
 
void scs_accum_by_a (const ScsAMatrix *A, ScsPrivWorkspace *p, const scs_float *x, scs_float *y)
 
scs_int scs_validate_linsys (const ScsAMatrix *A)
 
char * scs_get_linsys_method (const ScsAMatrix *A, const ScsSettings *stgs)
 
char * scs_get_linsys_summary (ScsPrivWorkspace *p, const ScsInfo *info)
 
void scs_normalize_a (ScsAMatrix *A, const ScsSettings *stgs, const ScsCone *k, ScsScaling *scal)
 
void scs_unnormalize_a (ScsAMatrix *A, const ScsSettings *stgs, const ScsScaling *scal)
 
void scs_free_a_matrix (ScsAMatrix *A)
 
scs_int scs_linsys_is_indirect (void)
 
scs_int scs_linsys_total_cg_iters (ScsPrivWorkspace *priv)
 
scs_float scs_linsys_total_solve_time_ms (ScsPrivWorkspace *priv)
 

Typedef Documentation

typedef struct scs_a_data_matrix ScsAMatrix

Structure supporting sparse matrices in CSC format.

See Also
Sparse matrices documentation
typedef struct scs_private_data ScsPrivWorkspace

Stores the necessary private workspace, only the linear system solver interacts with this struct

Function Documentation

void scs_accum_by_a ( const ScsAMatrix A,
ScsPrivWorkspace p,
const scs_float x,
scs_float y 
)

Performs y += A*x

void scs_accum_by_a_trans ( const ScsAMatrix A,
ScsPrivWorkspace p,
const scs_float x,
scs_float y 
)

Performs y += A'*x

void scs_free_a_matrix ( ScsAMatrix A)

Frees the memory allocated in ScsAMatrix.

void scs_free_priv ( ScsPrivWorkspace p)

Frees scs_linsys_priv_workspace structure and allocated memory in it.

char* scs_get_linsys_method ( const ScsAMatrix A,
const ScsSettings stgs 
)

Returns string describing method, can return null, if not null free will be called on output

char* scs_get_linsys_summary ( ScsPrivWorkspace p,
const ScsInfo info 
)

Returns string containing summary information about linear system solves, can return null, if not null free will be called on output

ScsPrivWorkspace* scs_init_priv ( const ScsAMatrix A,
const ScsSettings stgs 
)

initialize scs_linsys_priv_workspace structure and perform any necessary preprocessing

scs_int scs_linsys_is_indirect ( void  )

Whether the solution of the linear system is based on an indirect method.

Returns
1 if indirect, 0 otherwise
scs_int scs_linsys_total_cg_iters ( ScsPrivWorkspace priv)

Total number of CG iterations if an indirect method is used, -1 otherwise

Parameters
privprivate workspace structure
Returns
total CG iterations
scs_float scs_linsys_total_solve_time_ms ( ScsPrivWorkspace priv)

Returns the total solve time for the linear system (in ms).

Parameters
privprivate workspace structure
Returns
solve time in ms
void scs_normalize_a ( ScsAMatrix A,
const ScsSettings stgs,
const ScsCone k,
ScsScaling scal 
)

normalizes A matrix, sets w->E and w->D diagonal scaling matrices,Anew = d->SCALE * (D^-1)*A*(E^-1) (different to paper which is D*A*E) D and E must be all positive entries, D must satisfy cone boundaries must set (w->meanNormRowA = mean of norms of rows of normalized A) THEN scale resulting A by d->SCALE.

scs_int scs_solve_lin_sys ( const ScsAMatrix A,
const ScsSettings stgs,
ScsPrivWorkspace p,
scs_float b,
const scs_float s,
scs_int  iter 
)

Solves [d->RHO_X * I A' ; A -I] x = b for x, stores result in b, s contains warm-start, iter is current scs iteration count

Parameters
Asparse matrix A
stgsuser-specified settings
pprivate structure
bright hand side
sinitial guess
iter
Returns
on success, returns 0
void scs_unnormalize_a ( ScsAMatrix A,
const ScsSettings stgs,
const ScsScaling scal 
)

unnormalizes A matrix, unnormalizes by w->D and w->E and d->SCALE.

scs_int scs_validate_linsys ( const ScsAMatrix A)

Returns negative num if input data is invalid