WIP translation booster

Former-commit-id: 4ed4c1f7c7948013c4b89bf6cb4c665d541ca3d8
This commit is contained in:
Marek Nečada 2020-01-22 17:07:15 +02:00
parent af12f2301f
commit 8251eba955
2 changed files with 24 additions and 1 deletions

View File

@ -27,9 +27,29 @@ static inline uoppid_t pairarr_len(qpms_ss_pi_t pn_total) {
typedef struct qpms_scatsys_translation_booster { typedef struct qpms_scatsys_translation_booster {
double *r; // Unique distances array, indices are ppid_t double *r; // Unique distances array, indices are ppid_t
ppid_t *r_map; // FIXME size_t r_count; // Number of different interparticle distances (length of r[])
size_t *r_map; // maps pairs to the corresponding distances (index of uoppid_t type)
} qpms_scatsys_translation_booster_t; } qpms_scatsys_translation_booster_t;
struct uoppid_r_pair {
double r;
uoppid_t id;
}
size_t sort_and_eliminate(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *)) {
qsort(base, nmemb, size, compar);
_Bool eliminate;
QPMS_CRASHING_CALLOC(eliminate, nmemb, sizeof(_Bool));
size_t left = 0;
TODO zde;
free(eliminate);
return left;
}
struct qpms_scatsys_translation_booster *qpms_scatsys_translation_booster_create( struct qpms_scatsys_translation_booster *qpms_scatsys_translation_booster_create(
const qpms_scatsys_ss *ss) { const qpms_scatsys_ss *ss) {
const qpms_ss_pi_t np = ss->p_count; const qpms_ss_pi_t np = ss->p_count;

View File

@ -134,6 +134,9 @@ typedef struct qpms_ss_derived_tmatrix_t {
struct qpms_trans_calculator; struct qpms_trans_calculator;
struct qpms_scatsys_translation_booster; struct qpms_scatsys_translation_booster;
void qpms_scatsys_translation_booster_free(struct qpms_scatsys_translation_booster *);
struct qpms_scatsys_translation_booster *qpms_scatsys_translation_booster_create(
const qpms_scatsys_ss *ss);
typedef struct qpms_scatsys_t { typedef struct qpms_scatsys_t {
struct qpms_epsmu_generator_t medium; ///< Optical properties of the background medium. struct qpms_epsmu_generator_t medium; ///< Optical properties of the background medium.