#include "pca.h" void pca_wrapper(int *n, int *d, double *q, int *k, double *X, double *B, double *U, double *l) { struct futhark_context_config *cfg = futhark_context_config_new(); struct futhark_context *ctx = futhark_context_new(cfg); struct futhark_f64_2d *Xf = futhark_new_f64_2d(ctx, X, *n, *d); struct futhark_f64_2d *Yf; struct futhark_f64_2d *Bf; struct futhark_f64_2d *Uf; futhark_entry_pcaWithQuantile(ctx, &Bf, &Uf, &Yf, l, *q, *k, Xf); futhark_context_sync(ctx); futhark_values_f64_2d(ctx, Bf, B); futhark_values_f64_2d(ctx, Uf, U); futhark_values_f64_2d(ctx, Yf, X); futhark_free_f64_2d(ctx, Xf); futhark_free_f64_2d(ctx, Bf); futhark_free_f64_2d(ctx, Uf); futhark_free_f64_2d(ctx, Yf); futhark_context_free(ctx); futhark_context_config_free(cfg); }