![]() |
![]() |
![]() |
liboscats Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#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
);
OscatsPoint * oscats_point_new_from_space (OscatsSpace *space
);
This is simply a convenience function for g_object_new()
with the
space
construction property.
|
an OscatsSpace defining the latent space for the new point |
Returns : |
a new OscatsPoint in space . [transfer full]
|
gboolean oscats_point_same_space (const OscatsPoint *lhs
,const OscatsPoint *rhs
);
|
an OscatsPoint |
|
another OscatsPoint |
Returns : |
TRUE if lhs and rhs are in the same OscatsSpace
|
gboolean oscats_point_space_compatible (const OscatsPoint *lhs
,const OscatsPoint *rhs
);
This ignores dimension names.
|
an OscatsPoint |
|
another OscatsPoint |
Returns : |
TRUE if lhs and rhs come from geometrically compatible spaces |
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.
|
an OscatsPoint |
|
another OscatsPoint |
|
comparison tolerance (must be non-negative, may be 0) |
Returns : |
TRUE if lhs and rhs have the same coordinates |
void oscats_point_copy (OscatsPoint *lhs
,const OscatsPoint *rhs
);
Copies replaces lhs
with rhs
. Points must be from compatible spaces.
|
an OscatsPoint to be replaced |
|
the OscatsPoint to copy |
gdouble oscats_point_get_double (const OscatsPoint *point
,OscatsDim dim
);
The dim
must be valid for point
.
|
an OscatsPoint |
|
the coordinate to fetch |
Returns : |
the coordinate dim of point as a gdouble. |
gdouble oscats_point_get_cont (const OscatsPoint *point
,OscatsDim dim
);
The dim
must be OSCATS_DIM_CONT
.
|
an OscatsPoint |
|
the coordinate to fetch |
Returns : |
the value of the continuous coordinate dim for point
|
gboolean oscats_point_get_bin (const OscatsPoint *point
,OscatsDim dim
);
The dim
must be OSCATS_DIM_BIN
.
|
an OscatsPoint |
|
the coordinate to fetch |
Returns : |
the value of the binary coordinate dim for point
|
OscatsNatural oscats_point_get_nat (const OscatsPoint *point
,OscatsDim dim
);
The dim
must be OSCATS_DIM_NAT
.
|
an OscatsPoint |
|
the coordinate to fetch |
Returns : |
the value of the natural coordinate dim for point
|
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
.
|
an OscatsPoint |
|
the coordinate to set |
|
the value to set |
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
);
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).
|
an OscatsPoint with at least one continuous dimension |
Returns : |
a GGslVector linked with the continuous
dimensions of point . [transfer none]
|
"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.