NcmDTuple

NcmDTuple — Fixed sized array of double values.

Functions

Types and Values

struct NcmDTuple2
struct NcmDTuple3
#define NCM_DTUPLE2_TYPE
#define NCM_DTUPLE3_TYPE

Object Hierarchy

    GBoxed
    ├── NcmDTuple2
    ╰── NcmDTuple3

Description

In this module we define the NcmDTuple2, NcmDTuple3, which are fixed sized arrays of double values.

Functions

ncm_dtuple2_new ()

NcmDTuple2 *
ncm_dtuple2_new (const gdouble x,
                 const gdouble y);

Creates a new NcmDTuple2.

Parameters

x

first value.

[in]

y

second value.

[in]

Returns

a new NcmDTuple2.

[transfer full]


ncm_dtuple2_new_from_variant ()

NcmDTuple2 *
ncm_dtuple2_new_from_variant (GVariant *var);

Creates a new NcmDTuple2 from a GVariant. The GVariant must be of type NCM_DTUPLE2_TYPE.

Parameters

var

a GVariant

 

ncm_dtuple3_new ()

NcmDTuple3 *
ncm_dtuple3_new (const gdouble x,
                 const gdouble y,
                 const gdouble z);

Creates a new NcmDTuple3.

Parameters

x

first value.

[in]

y

second value.

[in]

z

third value.

[in]

Returns

a new NcmDTuple3.

[transfer full]


ncm_dtuple3_new_from_variant ()

NcmDTuple3 *
ncm_dtuple3_new_from_variant (GVariant *var);

Creates a new NcmDTuple3 from a GVariant.

The GVariant must be of type NCM_DTUPLE3_TYPE.

Parameters

var

a GVariant

 

Returns

a new NcmDTuple3.

[transfer full]


ncm_dtuple2_copy ()

NcmDTuple2 *
ncm_dtuple2_copy (const NcmDTuple2 *dt2);

Creates a new NcmDTuple2 with the same values of dt2 .

Parameters

dt2

a NcmDTuple2.

[in]

Returns

a new NcmDTuple2.

[transfer full]


ncm_dtuple3_copy ()

NcmDTuple3 *
ncm_dtuple3_copy (const NcmDTuple3 *dt3);

Creates a new NcmDTuple3 with the same values of dt3 .

Parameters

dt3

a NcmDTuple3.

[in]

Returns

a new NcmDTuple3.

[transfer full]


ncm_dtuple2_serialize ()

GVariant *
ncm_dtuple2_serialize (const NcmDTuple2 *dt2);

Serializes a NcmDTuple2.

Parameters

dt2

a NcmDTuple2

 

Returns

a GVariant.

[transfer full]


ncm_dtuple3_serialize ()

GVariant *
ncm_dtuple3_serialize (const NcmDTuple3 *dt3);

Serializes a NcmDTuple3.

Parameters

dt3

a NcmDTuple3

 

Returns

a GVariant.

[transfer full]


ncm_dtuple2_free ()

void
ncm_dtuple2_free (NcmDTuple2 *dt2);

Frees a NcmDTuple2.

Parameters

dt2

a NcmDTuple2.

[in]

ncm_dtuple3_free ()

void
ncm_dtuple3_free (NcmDTuple3 *dt3);

Frees a NcmDTuple3.

Parameters

dt3

a NcmDTuple3.

[in]

ncm_dtuple2_clear ()

void
ncm_dtuple2_clear (NcmDTuple2 **dt2);

If *dt2 is not NULL, frees it and sets it to NULL.

Parameters

dt2

a NcmDTuple2

 

ncm_dtuple3_clear ()

void
ncm_dtuple3_clear (NcmDTuple3 **dt3);

If *dt3 is not NULL, frees it and sets it to NULL.

Parameters

dt3

a NcmDTuple3

 

NCM_DTUPLE2_STATIC_INIT()

#define             NCM_DTUPLE2_STATIC_INIT(x, y)

Initializes a NcmDTuple2 with the given elements.

For example:

1
NcmDTuple2 tuple = NCM_DTUPLE2_STATIC_INIT (1.0, 2.0);

Parameters

x

The first element of the tuple

 

y

The second element of the tuple

 

NCM_DTUPLE3_STATIC_INIT()

#define             NCM_DTUPLE3_STATIC_INIT(x, y, z)

Initializes a NcmDTuple3 with the given elements.

For example:

1
NcmDTuple3 tuple = NCM_DTUPLE3_STATIC_INIT (1.0, 2.0, 3.0);

Parameters

x

The first element of the tuple

 

y

The second element of the tuple

 

z

The third element of the tuple

 

Types and Values

struct NcmDTuple2

struct NcmDTuple2 {
  gdouble elements[2];
};

A 2-dimensional tuple of double precision floating point numbers.

Members

gdouble elements[2];

The elements of the tuple.

[array fixed-size=2]

struct NcmDTuple3

struct NcmDTuple3 {
  gdouble elements[3];
};

A 3-dimensional tuple of double precision floating point numbers.

Members

gdouble elements[3];

The elements of the tuple.

[array fixed-size=3]

NCM_DTUPLE2_TYPE

#define NCM_DTUPLE2_TYPE "(dd)"

GVariant type string for NcmDTuple2.


NCM_DTUPLE3_TYPE

#define NCM_DTUPLE3_TYPE "(ddd)"

GVariant type string for NcmDTuple3.