42 int n_b1 = n_bands - 1;
46 sqrt((
double)((2 * n_b1 + 1) * (2 * n_b1 + 1) - 8 * scatt_id)))
50 scatt_id - ((*b_1_id) * (2 * n_b1 + 1) - (*b_1_id) * (*b_1_id)) / 2 +
72 int n_b1 = n_bands - 1;
75 (b_1_id * (2 * n_b1 + 1) - b_1_id * b_1_id) / 2 + b_2_id - b_1_id - 1;
98 cats->
n_scatts = (n_bands - 1) * n_bands / 2;
108 for (i_cat = 0; i_cat < cats->
n_cats; i_cat++)
123 for (i_cat = 0; i_cat < cats->
n_a_cats; i_cat++) {
157 int i_scatt, i_cat_id, cat_id;
163 for (i_cat_id = 0; i_cat_id < cats->
n_cats; i_cat_id++)
188 for (i_scatt = 0; i_scatt < cats->
n_scatts; i_scatt++)
213 int band_1, band_2, cat_idx, n_a_scatts;
216 if (cat_id < 0 || cat_id >= cats->
n_cats)
223 if (scatt_id < 0 && scatt_id >= cats->
n_scatts)
262 int n_vals,
void *data)
264 scatt_data->
n_vals = n_vals;
271 (
unsigned int *)
G_malloc(n_vals *
sizeof(
unsigned int));
273 n_vals *
sizeof(
unsigned int));
282 (
unsigned char *)
G_malloc(n_vals *
sizeof(
unsigned char));
284 n_vals *
sizeof(
unsigned char));
int I_id_scatt_to_bands(const int scatt_id, const int n_bands, int *b_1_id, int *b_2_id)
Compute band ids from scatter plot id.
void G_free(void *)
Free allocated memory.
void I_sc_free_cats(struct scCats *cats)
Free data of struct scCats, the structure itself remains allocated.
void I_scd_init_scatt_data(struct scdScattData *scatt_data, int type, int n_vals, void *data)
Insert scatter plot data.
struct scdScattData ** scatts_arr
#define SC_SCATT_CONDITIONS
int I_bands_to_id_scatt(const int b_1_id, const int b_2_id, const int n_bands, int *scatt_id)
Compute scatter plot id from band ids.
unsigned int * scatt_vals_arr
void I_sc_init_cats(struct scCats *cats, int n_bands, int type)
Initialize structure for storing scatter plots data.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
struct scScatts ** cats_arr
int I_sc_insert_scatt_data(struct scCats *cats, struct scdScattData *scatt_data, int cat_id, int scatt_id)
Insert scatter plot data . Inserted scatt_data struct must have same type as cats struct (SC_SCATT_DA...
unsigned char * b_conds_arr
int I_sc_add_cat(struct scCats *cats)
Add category.