BVector

BVector — Base class for one-dimensional array data objects.

Functions

unsigned int b_vector_get_len ()
const double * b_vector_get_values ()
double b_vector_get_value ()
char * b_vector_get_str ()
void b_vector_get_minmax ()
gboolean b_vector_is_varying_uniformly ()
double * b_vector_replace_cache ()

Types and Values

struct BVectorClass
  BVector

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── BData
            ╰── BVector
                ├── BRingVector
                ╰── BValVector

Description

Abstract base class for data classes representing one dimensional arrays.

Functions

b_vector_get_len ()

unsigned int
b_vector_get_len (BVector *vec);

Get the number of values in vec and caches it.

Parameters

vec

BVector

 

Returns

the length


b_vector_get_values ()

const double *
b_vector_get_values (BVector *vec);

Get the full array of values of vec and cache them.

Parameters

vec

BVector

 

Returns

an array.


b_vector_get_value ()

double
b_vector_get_value (BVector *vec,
                    unsigned int i);

Get a value in vec .

Parameters

vec

BVector

 

i

index

 

Returns

the value


b_vector_get_str ()

char *
b_vector_get_str (BVector *vec,
                  unsigned int i,
                  const gchar *format);

Get a string representation of an element in vec .

Parameters

vec

BVector

 

i

index

 

format

a format string

 

Returns

the string. The caller is responsible for freeing it.


b_vector_get_minmax ()

void
b_vector_get_minmax (BVector *vec,
                     double *min,
                     double *max);

Get the minimum and maximum values in vec and cache them.

Parameters

vec

BVector

 

min

return location for minimum value, or NULL .

[out][nullable]

max

return location for maximum value, or NULL .

[out][nullable]

b_vector_is_varying_uniformly ()

gboolean
b_vector_is_varying_uniformly (BVector *data);

Returns whether elements of data only increase or only decrease.

Parameters

data

BVector

 

Returns

TRUE if elements of data strictly increase or decrease.


b_vector_replace_cache ()

double *
b_vector_replace_cache (BVector *vec,
                        unsigned int len);

Frees old cache and replaces it with newly allocated memory, of length len . Used by subclasses of BVector.

Parameters

vec

BVector

 

len

new length of cache

 

Returns

Pointer to the new cache.

Types and Values

struct BVectorClass

struct BVectorClass {
	BDataClass base;

	unsigned int (*load_len) (BVector * vec);
	double *(*load_values) (BVector * vec);
	double (*get_value) (BVector * vec, unsigned int i);
	double *(*replace_cache) (BVector *vec, unsigned int len);
};

Class for BVector.

Members

BDataClass base;

base class.

 

load_len ()

loads the vector length and returns it.

 

load_values ()

loads the values and returns them.

 

get_value ()

gets a value.

 

replace_cache ()

replaces array cache

 

BVector

typedef struct _BVector BVector;

Object representing a one-dimensional array of numbers.