OscatsPoint

OscatsPoint — Point in Latent Space

Synopsis

#define             OSCATS_EPS
struct              OscatsPoint;
OscatsPoint *       oscats_point_new_from_space         (OscatsSpace *space);
gboolean            oscats_point_same_space             (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);
gboolean            oscats_point_space_compatible       (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);
gboolean            oscats_point_equal                  (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs,
                                                         gdouble tol);
void                oscats_point_copy                   (OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);
gdouble             oscats_point_get_double             (const OscatsPoint *point,
                                                         OscatsDim dim);
gdouble             oscats_point_get_cont               (const OscatsPoint *point,
                                                         OscatsDim dim);
gboolean            oscats_point_get_bin                (const OscatsPoint *point,
                                                         OscatsDim dim);
OscatsNatural       oscats_point_get_nat                (const OscatsPoint *point,
                                                         OscatsDim dim);
void                oscats_point_set_cont               (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         gdouble value);
void                oscats_point_set_bin                (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         gboolean value);
void                oscats_point_set_nat                (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         OscatsNatural value);
GGslVector *        oscats_point_cont_as_vector         (OscatsPoint *point);

Object Hierarchy

  GObject
   +----OscatsPoint

Properties

  "space"                    OscatsSpace*          : Read / Write / Construct Only

Description

A point in a multidimensional latent space as defined by OscatsSpace.

Details

OSCATS_EPS

#define OSCATS_EPS 2.220446e-16


struct OscatsPoint

struct OscatsPoint;


oscats_point_new_from_space ()

OscatsPoint *       oscats_point_new_from_space         (OscatsSpace *space);

This is simply a convenience function for g_object_new() with the space construction property.

space :

an OscatsSpace defining the latent space for the new point

Returns :

a new OscatsPoint in space. [transfer full]

oscats_point_same_space ()

gboolean            oscats_point_same_space             (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);

lhs :

an OscatsPoint

rhs :

another OscatsPoint

Returns :

TRUE if lhs and rhs are in the same OscatsSpace

oscats_point_space_compatible ()

gboolean            oscats_point_space_compatible       (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);

This ignores dimension names.

lhs :

an OscatsPoint

rhs :

another OscatsPoint

Returns :

TRUE if lhs and rhs come from geometrically compatible spaces

oscats_point_equal ()

gboolean            oscats_point_equal                  (const OscatsPoint *lhs,
                                                         const OscatsPoint *rhs,
                                                         gdouble tol);

Compares two points in latent space withing the tolerance tol. That is, returns all(abs(rhs-lhs) <= tol). If tol == 0, the points must be exactly the same. For continuos latent spaces, to avoid problems with floating point round-off errors, it's recommended to use a small positive tol, such as OSCATS_EPS.

The points must come from geometrically compatible spaces.

lhs :

an OscatsPoint

rhs :

another OscatsPoint

tol :

comparison tolerance (must be non-negative, may be 0)

Returns :

TRUE if lhs and rhs have the same coordinates

oscats_point_copy ()

void                oscats_point_copy                   (OscatsPoint *lhs,
                                                         const OscatsPoint *rhs);

Copies replaces lhs with rhs. Points must be from compatible spaces.

lhs :

an OscatsPoint to be replaced

rhs :

the OscatsPoint to copy

oscats_point_get_double ()

gdouble             oscats_point_get_double             (const OscatsPoint *point,
                                                         OscatsDim dim);

The dim must be valid for point.

point :

an OscatsPoint

dim :

the coordinate to fetch

Returns :

the coordinate dim of point as a gdouble.

oscats_point_get_cont ()

gdouble             oscats_point_get_cont               (const OscatsPoint *point,
                                                         OscatsDim dim);

The dim must be OSCATS_DIM_CONT.

point :

an OscatsPoint

dim :

the coordinate to fetch

Returns :

the value of the continuous coordinate dim for point

oscats_point_get_bin ()

gboolean            oscats_point_get_bin                (const OscatsPoint *point,
                                                         OscatsDim dim);

The dim must be OSCATS_DIM_BIN.

point :

an OscatsPoint

dim :

the coordinate to fetch

Returns :

the value of the binary coordinate dim for point

oscats_point_get_nat ()

OscatsNatural       oscats_point_get_nat                (const OscatsPoint *point,
                                                         OscatsDim dim);

The dim must be OSCATS_DIM_NAT.

point :

an OscatsPoint

dim :

the coordinate to fetch

Returns :

the value of the natural coordinate dim for point

oscats_point_set_cont ()

void                oscats_point_set_cont               (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         gdouble value);

The dim must be OSCATS_DIM_NAT and value must be valid for point.

point :

an OscatsPoint

dim :

the coordinate to set

value :

the value to set

oscats_point_set_bin ()

void                oscats_point_set_bin                (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         gboolean value);


oscats_point_set_nat ()

void                oscats_point_set_nat                (OscatsPoint *point,
                                                         OscatsDim dim,
                                                         OscatsNatural value);


oscats_point_cont_as_vector ()

GGslVector *        oscats_point_cont_as_vector         (OscatsPoint *point);

Create a link between the continuous dimensions of point and a GGslVector so that when either is changed, the other is updated (they share the same memory segment).

point :

an OscatsPoint with at least one continuous dimension

Returns :

a GGslVector linked with the continuous dimensions of point. [transfer none]

Property Details

The "space" property

  "space"                    OscatsSpace*          : Read / Write / Construct Only

The OscatsSpace in which this OscatsPoint resides. The "space" must be specified at construction, otherwise the OscatsPoint will not be usable.