ndd_create_equation, ndd_create_equation_lsdf, ndd_create_equation_msdf


[ Synopsis | Description | Return values | Diagnostics | See also | Back to the NDD package documentation ]

Synopsis

#include "lash-ndd.h"

ndd *ndd_create_equation_lsdf(uint1 r, uint4 n, sint4 *c, sint4 b);
ndd *ndd_create_equation_msdf(uint1 r, uint4 n, sint4 *c, sint4 b);
ndd *ndd_create_equation(uint1 r, uint4 n, sint4 *c, sint4 b);

Description

The functions ndd_create_equation_lsdf and ndd_create_equation_msdf create a new NDD representing the set of all the integer vectors (x1, x2, ..., xn) of dimension n satisfying the equation
c[0] x1 + c[1] x2 + ... + c[n-1] xn = b

The numeration base is r. The NDDs created by ndd_create_equation_msdf operate most significant digit first, and those created by ndd_create_equation_lsdf least significant digit first.

The macro ndd_create_equation can be used for creating an NDD operating in the default direction.

If the dimension n is zero, then the functions return a universal NDD if b = 0, and an empty NDD otherwise.

Return values

In the case of success, these functions and macro return a pointer to a newly allocated NDD. In the case of an error, they return a NULL pointer and set lash_errno.

Diagnostics

LASH_ERR_NOT_INIT
The package has not been initialized.
LASH_ERR_NO_MEM
Insufficient memory.
LASH_ERR_BAD_VALUE
Invalid base (which must be at least equal to 2).

See also

ndd_create_inequation, ndd_create_eq2, ndd_free

[ Synopsis | Description | Return values | Diagnostics | See also | Back to the NDD package documentation ]