OscatsSpace

OscatsSpace — Latent Space Definition

Synopsis

enum                OscatsDimType;
typedef             OscatsDim;
typedef             OscatsNatural;
struct              OscatsSpace;
GType               oscats_space_get_type               ();
guint16             oscats_space_size                   (const OscatsSpace *space);
void                oscats_space_set_dim_name           (OscatsSpace *space,
                                                         OscatsDim dim,
                                                         const gchar *name);
gboolean            oscats_space_has_dim                (const OscatsSpace *space,
                                                         GQuark name);
gboolean            oscats_space_has_dim_name           (const OscatsSpace *space,
                                                         const gchar *name);
OscatsDim           oscats_space_get_dim                (const OscatsSpace *space,
                                                         GQuark name);
OscatsDim           oscats_space_get_dim_by_name        (const OscatsSpace *space,
                                                         const gchar *name);
const gchar *       oscats_space_dim_get_name           (const OscatsSpace *space,
                                                         OscatsDim dim);
OscatsNatural       oscats_space_dim_get_max            (const OscatsSpace *space,
                                                         OscatsDim dim);
gboolean            oscats_space_validate               (const OscatsSpace *space,
                                                         OscatsDim dim,
                                                         OscatsNatural x);
gboolean            oscats_space_compatible             (const OscatsSpace *lhs,
                                                         const OscatsSpace *rhs);

Object Hierarchy

  GFlags
   +----OscatsDimType
  GObject
   +----OscatsSpace

Properties

  "id"                       gchar*                : Read / Write / Construct Only
  "max"                      GValueArray*          : Read / Write
  "names"                    GValueArray*          : Read / Write
  "numBin"                   guint                 : Read / Write / Construct Only
  "numCont"                  guint                 : Read / Write / Construct Only
  "numNat"                   guint                 : Read / Write / Construct Only

Description

A multidimensional latent space consisting of continuos-, binary- (0, 1), and natural- (0, 1, 2, ...) valued dimensions.

Details

enum OscatsDimType

typedef enum
{
  OSCATS_DIM_CONT = (1 << 14),
  OSCATS_DIM_BIN = (2 << 14),
  OSCATS_DIM_NAT = (3 << 14),
  OSCATS_DIM_TYPE_MASK = (3 << 14),
  OSCATS_DIM_MASK = 0x3fff,
  OSCATS_DIM_MAX = 0x3fff		// == 16383
} OscatsDimType;

A latent space is composed of three types of dimensions: continuous-valued dimensions, binary-valued (0, 1) dimensions, and natural-valued (0, 1, 2, ...) dimensions. An OscatsDim encodes both the type and the dimension number.

OSCATS_DIM_CONT

a continuous dimension

OSCATS_DIM_BIN

a binary dimension

OSCATS_DIM_NAT

a natural (0, 1, 2, ...) dimension

OSCATS_DIM_TYPE_MASK

mask to retrieve dimension type from OscatsDim

OSCATS_DIM_MASK

mask to retrieve dimension number within type from OscatsDim

OSCATS_DIM_MAX

maximum number of dimensions of any given type (16,383)

OscatsDim

typedef guint16 OscatsDim;

Index for a dimension in a latent space. Encodes both the type and dimension number.


OscatsNatural

typedef guint16 OscatsNatural;

A natural value (0, 1, 2, ...). This is simply an alias for guint16.


struct OscatsSpace

struct OscatsSpace;


oscats_space_get_type ()

GType               oscats_space_get_type               ();


oscats_space_size ()

guint16             oscats_space_size                   (const OscatsSpace *space);

space :

an OscatsSpace

Returns :

the total number of dimensions

oscats_space_set_dim_name ()

void                oscats_space_set_dim_name           (OscatsSpace *space,
                                                         OscatsDim dim,
                                                         const gchar *name);

Sets the name of dim to name. The dim must be valid.

space :

an OscatsSpace

dim :

the dimension to set

name :

the new name for the dimension. [transfer none]

oscats_space_has_dim ()

gboolean            oscats_space_has_dim                (const OscatsSpace *space,
                                                         GQuark name);

space :

an OscatsSpace

name :

the GQuark for a potential dimension name

Returns :

TRUE if space has a dimension named name

oscats_space_has_dim_name ()

gboolean            oscats_space_has_dim_name           (const OscatsSpace *space,
                                                         const gchar *name);

space :

an OscatsSpace

name :

a potential dimension name

Returns :

TRUE if space has a dimension named name

oscats_space_get_dim ()

OscatsDim           oscats_space_get_dim                (const OscatsSpace *space,
                                                         GQuark name);

The space must have a dimension named name.

space :

an OscatsSpace

name :

the GQuark for a potential dimension name

Returns :

the OscatsDim for the dimension named name

oscats_space_get_dim_by_name ()

OscatsDim           oscats_space_get_dim_by_name        (const OscatsSpace *space,
                                                         const gchar *name);

The space must have a dimension named name.

space :

an OscatsSpace

name :

a potential dimension name

Returns :

the OscatsDim for the dimension named name

oscats_space_dim_get_name ()

const gchar *       oscats_space_dim_get_name           (const OscatsSpace *space,
                                                         OscatsDim dim);

The dim must be a valid dimension for space.

space :

an OscatsSpace

dim :

an OscatsDim indicating the dimension

Returns :

the name for dim in space. [transfer none]

oscats_space_dim_get_max ()

OscatsNatural       oscats_space_dim_get_max            (const OscatsSpace *space,
                                                         OscatsDim dim);

The dim must be a valid natural dimension for space.

space :

an OscatsSpace

dim :

an OscatsDim indicating the dimension

Returns :

the maximum value for natural dimension dim in space

oscats_space_validate ()

gboolean            oscats_space_validate               (const OscatsSpace *space,
                                                         OscatsDim dim,
                                                         OscatsNatural x);


oscats_space_compatible ()

gboolean            oscats_space_compatible             (const OscatsSpace *lhs,
                                                         const OscatsSpace *rhs);

Tests whether two spaces have the same geometry---that is, the same number of each type of dimension. For natural-valued dimensions, both spaces must also have the same range for each dimension. Note: This does not compare dimension names.

lhs :

an OscatsSpace

rhs :

an OscatsSpace

Returns :

TRUE if lhs and rhs have the same geometry

Property Details

The "id" property

  "id"                       gchar*                : Read / Write / Construct Only

A string identifier for the space.

Default value: NULL


The "max" property

  "max"                      GValueArray*          : Read / Write

The maximum for each natural dimension. May be 1, though binary dimensions should probably use OSCATS_DIM_BIN instead.


The "names" property

  "names"                    GValueArray*          : Read / Write

Dimension names. Names are ordered continuous dimensions first, followed by binary dimensions, followed by natural dimensions. Default names are Cont.1, Cont.2, ..., Bin.1, Bin.2, ..., Nat.1, Nat.2, ....


The "numBin" property

  "numBin"                   guint                 : Read / Write / Construct Only

The number of binary dimensions in the space.

Allowed values: <= 16383

Default value: 0


The "numCont" property

  "numCont"                  guint                 : Read / Write / Construct Only

The number of continuous dimensions in the space.

Allowed values: <= 16383

Default value: 0


The "numNat" property

  "numNat"                   guint                 : Read / Write / Construct Only

The number of natural (0, 1, 2, ...) dimensions in the space.

Allowed values: <= 16383

Default value: 0