InterfaceTest.cpp File Reference

This c++ driver provides a few examples to illustrate the c++ interface to ButterflyPACK's Fortran subroutines, particularly the entry-evaluation and matvec-based APIs. This file works on the double data type. More...

#include <iostream>
#include <math.h>
#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <sstream>
#include <string>
#include <iomanip>
#include <memory>
#include <pthread.h>
#include <cmath>
#include <cassert>
#include <random>
#include <vector>
#include <atomic>
#include <mpi.h>
#include <cstring>
#include <getopt.h>
#include <unistd.h>
#include "dC_BPACK_wrapper.h"
Include dependency graph for InterfaceTest.cpp:

Classes

class  C_QuantApp
 

Functions

void Cblacs_exit (int)
 
double dist2 (double *x, double *y, int d)
 
double dot_product (double *v, double *u, int d)
 
double Gauss_kernel (double *x, double *y, int d, double h)
 
double Laplace_kernel (double *x, double *y, int d, double h)
 
double K07_kernel (double *x, double *y, int d)
 
double K08_kernel (double *x, double *y, int d, double h)
 
double K09_kernel (double *x, double *y, int d, double h)
 
double K10_kernel (double *x, double *y, int d, double h)
 
double GreenFun (int m, double w, double v0, double tau)
 
double GreenFun_kernel (double *x, double *y, int d, double w)
 
void C_FuncZmn (int *m, int *n, double *val, C2Fptr quant)
 
void C_FuncBZmn (int *m, int *n, double *val, C2Fptr quant)
 
void C_FuncDistmn (int *m, int *n, double *val, C2Fptr quant)
 
void C_FuncNearFar (int *m, int *n, int *val, C2Fptr quant)
 
void C_FuncZmnBlock (int *Ninter, int *Nallrows, int *Nallcols, int64_t *Nalldat_loc, int *allrows, int *allcols, double *alldat_loc, int *rowidx, int *colidx, int *pgidx, int *Npmap, int *pmaps, C2Fptr quant)
 
void C_FuncBZmnBlock (int *Ninter, int *Nallrows, int *Nallcols, int64_t *Nalldat_loc, int *allrows, int *allcols, double *alldat_loc, int *rowidx, int *colidx, int *pgidx, int *Npmap, int *pmaps, C2Fptr quant)
 
void C_FuncHMatVec (char const *trans, int *nin, int *nout, int *nvec, double const *xin, double *xout, C2Fptr quant)
 
void C_FuncBMatVec (char const *trans, int *nin, int *nout, int *nvec, double const *xin, double *xout, C2Fptr quant, double *a, double *b)
 
template<typename T >
vector< T > write_from_file (string filename)
 
void set_option_from_command_line (int argc, const char *const *cargv, F2Cptr option0)
 
int main (int argc, char *argv[])
 

Variables

const double pi = 4.0 * atan(1.0)
 

Detailed Description

This c++ driver provides a few examples to illustrate the c++ interface to ButterflyPACK's Fortran subroutines, particularly the entry-evaluation and matvec-based APIs. This file works on the double data type.

Function Documentation

◆ C_FuncBMatVec()

void C_FuncBMatVec ( char const *  trans,
int *  nin,
int *  nout,
int *  nvec,
double const *  xin,
double *  xout,
C2Fptr  quant,
double *  a,
double *  b 
)
inline

The matvec sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ C_FuncBZmn()

void C_FuncBZmn ( int *  m,
int *  n,
double *  val,
C2Fptr  quant 
)
inline

The sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ C_FuncBZmnBlock()

void C_FuncBZmnBlock ( int *  Ninter,
int *  Nallrows,
int *  Nallcols,
int64_t *  Nalldat_loc,
int *  allrows,
int *  allcols,
double *  alldat_loc,
int *  rowidx,
int *  colidx,
int *  pgidx,
int *  Npmap,
int *  pmaps,
C2Fptr  quant 
)
inline

The extraction sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ C_FuncDistmn()

void C_FuncDistmn ( int *  m,
int *  n,
double *  val,
C2Fptr  quant 
)
inline

The distance function wrapper required by the Fortran HODLR code

◆ C_FuncHMatVec()

void C_FuncHMatVec ( char const *  trans,
int *  nin,
int *  nout,
int *  nvec,
double const *  xin,
double *  xout,
C2Fptr  quant 
)
inline

The matvec sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ C_FuncNearFar()

void C_FuncNearFar ( int *  m,
int *  n,
int *  val,
C2Fptr  quant 
)
inline

The compressibility function wrapper required by the Fortran HODLR code

◆ C_FuncZmn()

void C_FuncZmn ( int *  m,
int *  n,
double *  val,
C2Fptr  quant 
)
inline

The sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ C_FuncZmnBlock()

void C_FuncZmnBlock ( int *  Ninter,
int *  Nallrows,
int *  Nallcols,
int64_t *  Nalldat_loc,
int *  allrows,
int *  allcols,
double *  alldat_loc,
int *  rowidx,
int *  colidx,
int *  pgidx,
int *  Npmap,
int *  pmaps,
C2Fptr  quant 
)
inline

The extraction sampling function wrapper required by the Fortran HODLR code

Here is the call graph for this function:

◆ Cblacs_exit()

void Cblacs_exit ( int  )

◆ dist2()

double dist2 ( double *  x,
double *  y,
int  d 
)
inline

2-norm distance

◆ dot_product()

double dot_product ( double *  v,
double *  u,
int  d 
)
inline

dot product of two real vectors

◆ Gauss_kernel()

double Gauss_kernel ( double *  x,
double *  y,
int  d,
double  h 
)
inline

Gauss Kernel

Here is the call graph for this function:

◆ GreenFun()

double GreenFun ( int  m,
double  w,
double  v0,
double  tau 
)
inline

◆ GreenFun_kernel()

double GreenFun_kernel ( double *  x,
double *  y,
int  d,
double  w 
)
inline
Here is the call graph for this function:

◆ K07_kernel()

double K07_kernel ( double *  x,
double *  y,
int  d 
)
inline

R^4 kernel

Here is the call graph for this function:

◆ K08_kernel()

double K08_kernel ( double *  x,
double *  y,
int  d,
double  h 
)
inline

sqrt(R^2+h) kernel

Here is the call graph for this function:

◆ K09_kernel()

double K09_kernel ( double *  x,
double *  y,
int  d,
double  h 
)
inline

1/sqrt(R^2+h) kernel

Here is the call graph for this function:

◆ K10_kernel()

double K10_kernel ( double *  x,
double *  y,
int  d,
double  h 
)
inline

Polynomial kernel (X^tY+h)^2

Here is the call graph for this function:

◆ Laplace_kernel()

double Laplace_kernel ( double *  x,
double *  y,
int  d,
double  h 
)
inline

Laplacian/Exponential Kernel

Here is the call graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

------------————— Main Code Starts Here ---------—————

tst=1: Test Kernels for Liza's data sets

tst=2: Test Kernels for Random point clouds

tst=3: Test Product of two Random matrices

tst=4: Test Full matrices

Here is the call graph for this function:

◆ set_option_from_command_line()

void set_option_from_command_line ( int  argc,
const char *const *  cargv,
F2Cptr  option0 
)

The command line parser for the example related parameters

Here is the call graph for this function:

◆ write_from_file()

template<typename T >
vector<T> write_from_file ( string  filename)

Read a data file into a vector

Variable Documentation

◆ pi

const double pi = 4.0 * atan(1.0)