SuperSCS  1.3.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
scs_parser.h File Reference
#include "glbopts.h"
#include <string.h>
#include "cones.h"
#include "linAlg.h"
#include "linSys.h"
#include "util.h"
#include "ctrlc.h"
#include "constants.h"
#include <math.h>
#include <stdio.h>
#include <time.h>
#include "scs.h"
#include "linsys/amatrix.h"

Go to the source code of this file.

Data Structures

struct  scs_conic_probem_metadata
 Metadata for conic optimization problems. More...
 

Macros

#define _POSIX_C_SOURCE   199309L
 
#define SCS_METADATA_TEXT_SIZE   1024
 

Typedefs

typedef struct
scs_conic_probem_metadata 
ScsConicProblemMetadata
 

Functions

ScsConicProblemMetadatascs_init_conic_problem_metadata (const char *problemName)
 Initializes a ScsConicProblemMetadata structure. More...
 
scs_int scs_from_YAML (const char *filepath, ScsData **data, ScsCone **cone)
 
scs_int scs_to_YAML (const char *RESTRICT filepath, ScsConicProblemMetadata *metadata, const ScsData *RESTRICT data, const ScsCone *RESTRICT cone)
 

Macro Definition Documentation

#define _POSIX_C_SOURCE   199309L
#define SCS_METADATA_TEXT_SIZE   1024

Length of character arrays in ScsConicProblemMetadata.

Typedef Documentation

Function Documentation

scs_int scs_from_YAML ( const char *  filepath,
ScsData **  data,
ScsCone **  cone 
)

Parses a YAML file and constructs/initialises the corresponding ScsData and ScsCone objects.

Example of use:

ScsData * data;
ScsCone * cone;
const char * filepath = "matlab/scs-yaml/example.yml";
int status = scs_from_YAML(filepath, &data, &cone);
if (status != 0) {
// handle failure
}
// use `data` and `cone` ...
// at the end don't forget to call `scs_free_data_cone`
scs_free_data_cone(data, cone);
Parameters
filepathAbsolute or relative path to YAML file
datapointer-to-pointer to a ScsData object. This function will initialise data using the YAML file.
conepointer-to-pointer to a ScsCone object. This function will initialise cone using the YAML file.
Returns
status code; returns 0 if parsing has succeeded; a positive error code otherwise.
See Also
scs_to_YAML
Saving and loading problems (detailed documentation)
ScsConicProblemMetadata* scs_init_conic_problem_metadata ( const char *  problemName)

Initializes a ScsConicProblemMetadata structure.

This function creates and initializes a ScsConicProblemMetadata structure. It sets the problem name to a given value and initializes all other fields with their default values as follows:

Parameters
problemNameproblem name
Returns
New instance of ScsConicProblemMetadata
See Also
scs_to_YAML
scs_int scs_to_YAML ( const char *RESTRICT  filepath,
ScsConicProblemMetadata metadata,
const ScsData *RESTRICT  data,
const ScsCone *RESTRICT  cone 
)
Parameters
filepathrelative or absolute path to a file which this function will create.

The caller must have the necessary permissions to create the file, otherwise the method returns the error code 101.

Parameters
metadataproblem metadata which can be created using scs_init_conic_problem_metadata
datapointer to exisint non-null ScsData object
conepointer to exisint non-null ScsCone object
Returns
this function returns 0 on success and a positive status code otherwise.
See Also
scs_from_YAML
ScsConicProblemMetadata
Saving and loading problems (detailed documentation)