MPSolve 3.2.1
Loading...
Searching...
No Matches
input-output.h File Reference

Generic input-output functions inside MPSolve. More...

Go to the source code of this file.

Functions

MPS_BEGIN_DECLS void mps_readroots (mps_context *s)
 Read the approximations from the file opened in the rtstr member of the mps_context. More...
 
void mps_countroots (mps_context *s)
 Count the roots that are included in the search set, excluded form it, or have an undetermined inclusion state. More...
 
void mps_outroot (mps_context *s, int i, int num)
 Print an approximation to stdout (or whatever the output stream currently selected in the mps_context is). More...
 
void mps_output (mps_context *s)
 Print the approximations to stdout (or whatever the output stream currently selected in the mps_context is). More...
 
void mps_copy_roots (mps_context *s)
 Update the MP version of the roots to the latest and greatest approximations. More...
 
void mps_dump_status (mps_context *s, FILE *outstr)
 Dump status of all the root approximations.
 
void mps_dump (mps_context *s)
 Dump all the current approximation to the logstr selected in the current mps_context. More...
 
void mps_dump_cluster_structure (mps_context *s, FILE *outstr)
 Dump cluster structure to outstr. More...
 
mps_boolean mps_is_a_tty (FILE *stream)
 Check if the file descriptor associated to stream is bounded to a tty. More...
 
void mps_warn (mps_context *st, char *format,...)
 Print a warning to the user. More...
 
void mps_error (mps_context *st, const char *format,...)
 Record an error happened during the computation. This will set the internal status error to on, and the actual errors will printed with the first call to mps_print_errors(). More...
 
void mps_print_errors (mps_context *s)
 Print all the errors that have been recorded up to now. This function should be called only if mps_context_has_errors() returns true. More...
 
void mps_skip_comments (FILE *input_stream)
 
void mps_raise_parsing_error (mps_context *s, mps_input_buffer *buffer, const char *token, const char *message,...)
 
mps_input_option mps_parse_option_line (mps_context *s, char *line, size_t length)
 Parse a line of the input stream that contains the character ';', so should be considered an option line. More...
 
mps_polynomialmps_monomial_poly_read_from_stream_v2 (mps_context *s, mps_input_buffer *buffer)
 Parse the stream that has been loaded into buffer and that describe a mps_monomial_poly. This function parse polynomials described in the format of MPSolve 2.2. More...
 
mps_polynomialmps_monomial_yacc_parser (mps_context *ctx, mps_abstract_input_stream *stream)
 

Detailed Description

Generic input-output functions inside MPSolve.

Function Documentation

◆ mps_copy_roots()

void mps_copy_roots ( mps_context s)

Update the MP version of the roots to the latest and greatest approximations.

Parameters
sA pointer to the current mps_context.

◆ mps_countroots()

void mps_countroots ( mps_context s)

Count the roots that are included in the search set, excluded form it, or have an undetermined inclusion state.

Parameters
sA pointer to the current mps_context.

◆ mps_dump()

void mps_dump ( mps_context s)

Dump all the current approximation to the logstr selected in the current mps_context.

Parameters
sA pointer to the current mps_context.

This function is tipically used when encountering some errors.

◆ mps_dump_cluster_structure()

void mps_dump_cluster_structure ( mps_context s,
FILE *  outstr 
)

Dump cluster structure to outstr.

Parameters
sthe mps_context struct pointer.
outstrThe output stream where the cluster structure will be dumped.

◆ mps_error()

void mps_error ( mps_context s,
const char *  format,
  ... 
)

Record an error happened during the computation. This will set the internal status error to on, and the actual errors will printed with the first call to mps_print_errors().

Parameters
sA pointer to the current mps_context.

◆ mps_is_a_tty()

mps_boolean mps_is_a_tty ( FILE *  stream)

Check if the file descriptor associated to stream is bounded to a tty.

Parameters
streamthe stream to check

◆ mps_monomial_poly_read_from_stream_v2()

mps_polynomial * mps_monomial_poly_read_from_stream_v2 ( mps_context s,
mps_input_buffer buffer 
)

Parse the stream that has been loaded into buffer and that describe a mps_monomial_poly. This function parse polynomials described in the format of MPSolve 2.2.

Parameters
sThe current mps_context
bufferThe buffer that needs to be parsed
Thestructure of the polynomial
Thedensity configuration of the polynomial.
Returns
A newly allocated mps_polynomial, or NULL if the parsing fails.

◆ mps_output()

void mps_output ( mps_context s)

Print the approximations to stdout (or whatever the output stream currently selected in the mps_context is).

Parameters
sA pointer to the current mps_context.

◆ mps_outroot()

void mps_outroot ( mps_context s,
int  i,
int  num 
)

Print an approximation to stdout (or whatever the output stream currently selected in the mps_context is).

Parameters
sA pointer to the current mps_context.
iThe index of the approxiomation that shall be printed.
numThe number of zero roots.

◆ mps_parse_option_line()

mps_input_option mps_parse_option_line ( mps_context s,
char *  line,
size_t  length 
)

Parse a line of the input stream that contains the character ';', so should be considered an option line.

Valid options, recognized at the moment being are:

◆ mps_print_errors()

void mps_print_errors ( mps_context s)

Print all the errors that have been recorded up to now. This function should be called only if mps_context_has_errors() returns true.

Parameters
sA pointer to the current mps_context.

◆ mps_readroots()

MPS_BEGIN_DECLS void mps_readroots ( mps_context s)

Read the approximations from the file opened in the rtstr member of the mps_context.

Parameters
sA pointer to the current mps_context.

NOTE: This function is not used anywhere in the code, atm.

◆ mps_warn()

void mps_warn ( mps_context st,
char *  format,
  ... 
)

Print a warning to the user.

Parameters
stThe current mps_context
formatThe printf-like format for the data to print