ceo 0.1.0

CUDA Engined Optics
Documentation
#ifndef __LMMSE_H__
#define __LMMSE_H__

#include "utilities.h"
#include "aaStats.h"
#include "BTBT.h"
#include "GBTBT.h"
#include "shackHartmann.h"
#include "iterativeSolvers.h"

//#define MINRES_DEBUG


struct bilinearInterpolation {
float *d__phase_est_i;
int nnz, NI;
float *csrValH;
int *csrColIndH, *csrRowPtrH;
float alpha, beta, elapsed_time;
cudaError_t cudaStat;
cusparseStatus_t status;
cusparseHandle_t handle;
cusparseMatDescr_t descr;
cudaEvent_t start, stop;

void setup(int NI, int NP);
void setup(int NI, int NP, mask *pupil,
           float i0, float j0);
void cleanup(void);
};

struct LMMSE {

  int *d__idx, PS_E_N_PX, N_guide_star, N_mmse_star, offset, N_SIDE_LENSLET_, NP, NS, osf;
  float *d__ce, *d__phase_est, *d__phase_est_c, *d__phase_est_i, *d__x, *d__zp_x;
  aaStats aa;
  BTBT aaCov;
  paStats pa;
  GBTBT paCov;
  iterativeSolvers iSolve;
  stopwatch tid;

  int nnz, NI;
  float *csrValH;
  int *csrColIndH, *csrRowPtrH;
  float alpha, beta, elapsed_time;
  cudaError_t cudaStat;
  cusparseStatus_t status;
  cusparseHandle_t handle;
  cusparseMatDescr_t descr;
  cudaEvent_t start, stop;


  void setup(atmosphere *atm, source *guide_star, source *mmse_star,
             float sampling, int N, char *solver_id);
  void setup(atmosphere *atm, source *guide_star, source *mmse_star,
             float sampling, int N, 
             mask *pupil, char *solver_id);
  void setup(atmosphere *atm, source *guide_star, source *mmse_star,
             float sampling, int N, 
             mask *pupil, char *solver_id,
             int wavefront_osf);
  void setup(atmosphere *atm, source *guide_star,
             float sampling, int _N_SIDE_LENSLET_,
             mask *pupil, char *solver_id, int wavefront_osf,
             float z_radius);
  void setup(atmosphere *atm, source *guide_star, source *mmse_star,
             shackHartmann *wfs, char *solver_id);
  void setup(atmosphere *atm, source *guide_star, source *mmse_star,
             shackHartmann *wfs, char *solver_id,
             int osf_, mask *pupil_);

  void cleanup(void);

  void estimation_old(float* d__c, int nMaxIteration, float *d__x0);
  void estimation_old(float* d__c, int nMaxIteration);
  void estimation(const centroiding *cog);
  void estimation(shackHartmann *wfs);

  void reset(void);

  void set_phase_est_ptr(float *data_ptr);
  void toFile(const char *filename);
};
#endif // __LMMSE_H__