MPSolve 3.2.1
Loading...
Searching...
No Matches
monomial-matrix-poly.h File Reference

Implementation of the monomial version of the matrix polynomial. More...

#include <mps/polynomial.h>

Go to the source code of this file.

Classes

struct  mps_monomial_matrix_poly
 This is the struct that holds all the data of the matrix polynomial. More...
 

Macros

#define MPS_MONOMIAL_MATRIX_POLY(t)   (MPS_POLYNOMIAL_CAST (mps_monomial_matrix_poly, t))
 
#define MPS_IS_MONOMIAL_MATRIX_POLY(t)    (mps_polynomial_check_type (t, "mps_monomial_matrix_poly"))
 
#define MPS_MONOMIAL_MATRIX_POLY_HESSENBERG   0x0001
 

Functions

mps_monomial_matrix_polymps_monomial_matrix_poly_new (mps_context *ctx, int degree, int m, mps_boolean monic)
 Create a new matrix polynomial of the given degree. More...
 
void mps_monomial_matrix_poly_free (mps_context *ctx, mps_polynomial *poly)
 Free a matrix polynomial. More...
 
void mps_monomial_matrix_poly_add_flags (mps_context *ctx, mps_monomial_matrix_poly *mpoly, int flag)
 Add some flags (some properties) to this matrix polynomial. More...
 
void mps_monomial_matrix_poly_clear_flags (mps_context *ctx, mps_monomial_matrix_poly *mpoly, int flag)
 Clear some flags (properties) of this matrix polynomial. More...
 
void mps_monomial_matrix_poly_set_coefficient_d (mps_context *ctx, mps_monomial_matrix_poly *mpoly, int i, cplx_t *matrix)
 Set the coefficient of degree i of the matrix polynomial. More...
 
void mps_monomial_matrix_poly_set_coefficient_q (mps_context *ctx, mps_monomial_matrix_poly *mpoly, int i, mpq_t *matrix_r, mpq_t *matrix_i)
 Set the coefficient of degree i of the matrix polynomial. More...
 
mps_boolean mps_monomial_matrix_poly_meval (mps_context *ctx, mps_polynomial *poly, mpc_t x, mpc_t value, rdpe_t error)
 Evaluate a matrix polynomial at a point, in the sense of evaluating $det(P(x))$. More...
 
long int mps_monomial_matrix_poly_raise_data (mps_context *ctx, mps_polynomial *p, long int wp)
 Raise the working precision of this monomial matrix polynomal to the required numnber of bits. More...
 

Detailed Description

Implementation of the monomial version of the matrix polynomial.

Function Documentation

◆ mps_monomial_matrix_poly_add_flags()

void mps_monomial_matrix_poly_add_flags ( mps_context ctx,
mps_monomial_matrix_poly mpoly,
int  flag 
)

Add some flags (some properties) to this matrix polynomial.

Parameters
ctxThe current mps_context
mpolyThe matrix polynomial.
flagThe flags to add.

◆ mps_monomial_matrix_poly_clear_flags()

void mps_monomial_matrix_poly_clear_flags ( mps_context ctx,
mps_monomial_matrix_poly mpoly,
int  flag 
)

Clear some flags (properties) of this matrix polynomial.

Parameters
ctxThe current mps_context
mpolyThe matrix polynomial.
flagThe flags to clear.

◆ mps_monomial_matrix_poly_free()

void mps_monomial_matrix_poly_free ( mps_context ctx,
mps_polynomial poly 
)

Free a matrix polynomial.

Parameters
ctxThe current mps_context.
polyThe mps_monomial_matrix_poly that should be freed, casted to a mps_polynomial* pointer.

◆ mps_monomial_matrix_poly_meval()

mps_boolean mps_monomial_matrix_poly_meval ( mps_context ctx,
mps_polynomial poly,
mpc_t  x,
mpc_t  value,
rdpe_t  error 
)

Evaluate a matrix polynomial at a point, in the sense of evaluating $det(P(x))$.

Parameters
ctxThe current mps_context
polyThe matrix polynomial to evaluate
xThe point in which the evaluation is requested
valueThe value of $det(P(x))$
errorAn upper bound to the absolute error that affects the result.
Returns
true if the evaluation was successful.

◆ mps_monomial_matrix_poly_new()

mps_monomial_matrix_poly * mps_monomial_matrix_poly_new ( mps_context ctx,
int  degree,
int  m,
mps_boolean  monic 
)

Create a new matrix polynomial of the given degree.

Parameters
ctxThe current mps_context.
degreeThe degree of the matrix polynomial.
mThe size of the matrices that compose the matrix polynomial.
monicA boolean value that, if set to true, specify that the leading coefficient of the polynomial is the identity matrix, and so should not specified explicitely.
Returns
A pointer to a newly allocated mps_monomial_matrix_poly that should be subsequently free with a call to mps_monomial_matrix_poly_free().

◆ mps_monomial_matrix_poly_raise_data()

long int mps_monomial_matrix_poly_raise_data ( mps_context ctx,
mps_polynomial p,
long int  wp 
)

Raise the working precision of this monomial matrix polynomal to the required numnber of bits.

Parameters
ctxThe current mps_context.
pThe polynomial whose working precision should be set.
wpThe bits of desired working precision.
Returns
The precision set in the polynomial. Note that this value may be higher than wp due to the fact that, in general, not all the precisions are available on the system and the first higher precision of the value required will be used.

◆ mps_monomial_matrix_poly_set_coefficient_d()

void mps_monomial_matrix_poly_set_coefficient_d ( mps_context ctx,
mps_monomial_matrix_poly mpoly,
int  i,
cplx_t *  matrix 
)

Set the coefficient of degree i of the matrix polynomial.

Parameters
ctxThe current mps_context
mpolyThe mps_monomial_matrix_poly where the coefficients should be set.
iThe degree of the coeffient to set.
matrixA pointer to the first element of the matrix stored in row-major order.

◆ mps_monomial_matrix_poly_set_coefficient_q()

void mps_monomial_matrix_poly_set_coefficient_q ( mps_context ctx,
mps_monomial_matrix_poly mpoly,
int  i,
mpq_t *  matrix_r,
mpq_t *  matrix_i 
)

Set the coefficient of degree i of the matrix polynomial.

Parameters
ctxThe current mps_context
mpolyThe mps_monomial_matrix_poly where the coefficients should be set.
iThe degree of the coeffient to set.
matrix_rA pointer to the first element of the matrix of the real parts of the coefficients, stored in row-major order
matrix_iA pointer to the first element of the matrix of the imaginary parts of the coefficients, stored in row-major order