openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Classes | Macros | Enumerations | Functions | Variables
IGBops.cc File Reference
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include "IGBheader.h"
#include <assert.h>
#include "ops_cmdline.h"
#include <vector>
#include "muParser.h"
Include dependency graph for IGBops.cc:

Go to the source code of this file.

Classes

class  Interp
 Interpolate class. More...
 

Macros

#define data_t   float
 

Enumerations

enum  Data_file_t {
  NONE =0, SPACE_TIME =5, SPACE =4, PT_TIME =3,
  PT =2, TIME =1
}
 

Functions

void output_scratch (data_t *s, FILE *out, int n, bool bin)
 
void output_scratch (vector< data_t > &s, FILE *out, bool bin)
 
bool overlap (IGBheader *first, IGBheader *second)
 
void joinXY (IGBheader *h1, IGBheader *h2, IGBheader *hout)
 
void join_space (data_t *x, int nx, data_t *y, int ny, FILE *out)
 
void eval_expr (data_t *x, int n, char *expr, FILE *out, data_t *result)
 
template<class T >
void eval_expr (data_t *x0, T *x1, int n, char *expr, FILE *out, int nc=0)
 
void center_diff (data_t *x, int slsz, vector< data_t > &odat, int t, float dt, FILE *out)
 
void forward_diff (data_t *x, int slsz, vector< data_t > &old, int t, float dt, FILE *out)
 
void aXPLUS_bY (data_t *x, data_t *y, data_t a, data_t b, int slsz, int nc, FILE *out)
 
template<class T >
void aXPLUS_bY (data_t *x, T *y, data_t a, data_t b, int slsz, FILE *out)
 
void avgXt (data_t *x, int slsz, int nc, float t, FILE *out)
 
void avgXi (data_t *x, vector< data_t > &sum, const data_t fac)
 
void varXi (data_t *x, data_t *mean, vector< data_t > &sum, const data_t fac)
 
void aXPLUS_b (data_t *x, data_t a, data_t b, int slsz, FILE *out)
 
void XdivY (data_t *x, data_t *y, int slsz, FILE *out)
 
void XdivY (data_t *x, data_t *y, int slsz, int nc, FILE *out)
 
void XmulY (data_t *x, data_t *y, int slsz, FILE *out)
 
void XmulY (data_t *x, data_t *y, int slsz, int nc, FILE *out)
 
void minXt (data_t *x, int slsz, int nc, float t, FILE *out)
 
void t_maxX (data_t *x, data_t *mx, data_t *tm, size_t n, float t)
 
void maxXi (data_t *x, data_t *mx, size_t n)
 
void minXi (data_t *x, data_t *mn, size_t n)
 
void maxXt (data_t *x, int slsz, int nc, float t, FILE *out)
 
void XPLUS_a (data_t *x, data_t a, int slsz, FILE *out)
 
void Xbox (data_t *dat, int x, int y, FILE *out, int d, int nc)
 
void sclip_ab (data_t *dat, int sz, data_t upper, data_t lower, vector< data_t > &scr, int t, int tfinal, FILE *out)
 
void magnitude (data_t *x, int n, int nc, FILE *out)
 determine magnitude at each point More...
 
void dot (data_t *x, data_t *y, int n, int nc, FILE *out, bool pt)
 perform dot product More...
 
template<class T >
void simp38 (T *x, int n, int t, data_t *runInt, float dt)
 Simpson's 3/8 rule. More...
 
template<class T >
void midpt (T *x, int n, bool end, data_t *reduce, float dt)
 
void interpolate (data_t *dat, vector< int *> &idx, vector< float *> &w, int n, FILE *out)
 interpolate within points More...
 
template<class T >
void normalize (IGBheader *h, FILE *out, T *min, T *max)
 normalize pixels over all time More...
 
void maxP2P (data_t *dat, data_t *big, data_t *maxpp, int sz, int t)
 find the maximum peak-to-peak value at each point More...
 
void ravgX_ta (data_t *dat1, int sz, int t, int a, vector< data_t > &tmp, FILE *out)
 
void read_vector (vector< data_t > &y, gzFile in, int nc)
 
std::string cmdline_str (int n, char *w[])
 
int main (int argc, char *argv[])
 

Variables

const int MAX_NC =4
 
int Tbit =1
 
int IGB_DATA_T [5] = { 0, IGB_FLOAT, IGB_COMPLEX, IGB_VEC3_f, IGB_VEC4_f }
 

Macro Definition Documentation

◆ data_t

#define data_t   float

Definition at line 121 of file IGBops.cc.

Enumeration Type Documentation

◆ Data_file_t

Enumerator
NONE 
SPACE_TIME 
SPACE 
PT_TIME 
PT 
TIME 

Definition at line 70 of file IGBops.cc.

Function Documentation

◆ avgXi()

void avgXi ( data_t x,
vector< data_t > &  sum,
const data_t  fac 
)

Definition at line 308 of file IGBops.cc.

Here is the caller graph for this function:

◆ avgXt()

void avgXt ( data_t x,
int  slsz,
int  nc,
float  t,
FILE *  out 
)

Definition at line 293 of file IGBops.cc.

Here is the caller graph for this function:

◆ aXPLUS_b()

void aXPLUS_b ( data_t x,
data_t  a,
data_t  b,
int  slsz,
FILE *  out 
)

Definition at line 325 of file IGBops.cc.

Here is the caller graph for this function:

◆ aXPLUS_bY() [1/2]

void aXPLUS_bY ( data_t x,
data_t y,
data_t  a,
data_t  b,
int  slsz,
int  nc,
FILE *  out 
)

Definition at line 274 of file IGBops.cc.

Here is the caller graph for this function:

◆ aXPLUS_bY() [2/2]

template<class T >
void aXPLUS_bY ( data_t x,
T *  y,
data_t  a,
data_t  b,
int  slsz,
FILE *  out 
)

Definition at line 284 of file IGBops.cc.

◆ center_diff()

void center_diff ( data_t x,
int  slsz,
vector< data_t > &  odat,
int  t,
float  dt,
FILE *  out 
)

Definition at line 239 of file IGBops.cc.

Here is the caller graph for this function:

◆ cmdline_str()

std::string cmdline_str ( int  n,
char *  w[] 
)

return the command line

Parameters
nargc
wargv

Definition at line 759 of file IGBops.cc.

Here is the caller graph for this function:

◆ dot()

void dot ( data_t x,
data_t y,
int  n,
int  nc,
FILE *  out,
bool  pt 
)

perform dot product

Parameters
xdata
ydata
ntotal number of data
ncnumber of components at each point
pttrue if Y is a single point

Definition at line 550 of file IGBops.cc.

Here is the caller graph for this function:

◆ eval_expr() [1/2]

void eval_expr ( data_t x,
int  n,
char *  expr,
FILE *  out,
data_t result 
)

Definition at line 172 of file IGBops.cc.

Here is the caller graph for this function:

◆ eval_expr() [2/2]

template<class T >
void eval_expr ( data_t x0,
T *  x1,
int  n,
char *  expr,
FILE *  out,
int  nc = 0 
)
Parameters
x0data 0
x1data 1
nnumber of data points (slice size*num_comp)
exprexpression to evaluate
outoutput file
ncnumber of components

Definition at line 209 of file IGBops.cc.

◆ forward_diff()

void forward_diff ( data_t x,
int  slsz,
vector< data_t > &  old,
int  t,
float  dt,
FILE *  out 
)

Definition at line 261 of file IGBops.cc.

Here is the caller graph for this function:

◆ interpolate()

void interpolate ( data_t dat,
vector< int *> &  idx,
vector< float *> &  w,
int  n,
FILE *  out 
)

interpolate within points

Parameters
datdata to interpolate
idxlist of lists of nodes
wweights for the above nodes
nnumber of indices/weights
outoutput file

Definition at line 616 of file IGBops.cc.

Here is the caller graph for this function:

◆ join_space()

void join_space ( data_t x,
int  nx,
data_t y,
int  ny,
FILE *  out 
)

Definition at line 164 of file IGBops.cc.

Here is the caller graph for this function:

◆ joinXY()

void joinXY ( IGBheader h1,
IGBheader h2,
IGBheader hout 
)

Definition at line 135 of file IGBops.cc.

Here is the caller graph for this function:

◆ magnitude()

void magnitude ( data_t x,
int  n,
int  nc,
FILE *  out 
)

determine magnitude at each point

Parameters
xdata
ntotal number of data
ncnumber of components at each point

Definition at line 529 of file IGBops.cc.

Here is the caller graph for this function:

◆ main()

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

Definition at line 771 of file IGBops.cc.

◆ maxP2P()

void maxP2P ( data_t dat,
data_t big,
data_t maxpp,
int  sz,
int  t 
)

find the maximum peak-to-peak value at each point

The peak-to-peak amplitude of each montonically increasing or decreasing segment is compared. The big scratch array is divided into 3 sections: the value at the previous time, whether the value was increasing or decreasing, and the value of the last extremum. Extremum are detected when the direction of change reverses. Repeated values are ignored.

Parameters
datcurrent data frame
bigscratch data [previous val;direction;extremum]
maxppcurrent maximum peak-to-peak
szslice size

Definition at line 668 of file IGBops.cc.

Here is the caller graph for this function:

◆ maxXi()

void maxXi ( data_t x,
data_t mx,
size_t  n 
)

Definition at line 423 of file IGBops.cc.

Here is the caller graph for this function:

◆ maxXt()

void maxXt ( data_t x,
int  slsz,
int  nc,
float  t,
FILE *  out 
)

Definition at line 445 of file IGBops.cc.

Here is the caller graph for this function:

◆ midpt()

template<class T >
void midpt ( T *  x,
int  n,
bool  end,
data_t reduce,
float  dt 
)

Midpoint rule

Definition at line 594 of file IGBops.cc.

Here is the caller graph for this function:

◆ minXi()

void minXi ( data_t x,
data_t mn,
size_t  n 
)

Definition at line 434 of file IGBops.cc.

Here is the caller graph for this function:

◆ minXt()

void minXt ( data_t x,
int  slsz,
int  nc,
float  t,
FILE *  out 
)

Definition at line 397 of file IGBops.cc.

Here is the caller graph for this function:

◆ normalize()

template<class T >
void normalize ( IGBheader h,
FILE *  out,
T *  min,
T *  max 
)

normalize pixels over all time

Parameters
hinput IGB file
outoutput FILE
mincomputed pixel minimum
maxcomputed pixel maximum

Definition at line 637 of file IGBops.cc.

Here is the caller graph for this function:

◆ output_scratch() [1/2]

void output_scratch ( data_t s,
FILE *  out,
int  n,
bool  bin 
)

Definition at line 694 of file IGBops.cc.

Here is the caller graph for this function:

◆ output_scratch() [2/2]

void output_scratch ( vector< data_t > &  s,
FILE *  out,
bool  bin = false 
)

Definition at line 705 of file IGBops.cc.

◆ overlap()

bool overlap ( IGBheader first,
IGBheader second 
)

Definition at line 128 of file IGBops.cc.

Here is the caller graph for this function:

◆ ravgX_ta()

void ravgX_ta ( data_t dat1,
int  sz,
int  t,
int  a,
vector< data_t > &  tmp,
FILE *  out 
)

Definition at line 718 of file IGBops.cc.

Here is the caller graph for this function:

◆ read_vector()

void read_vector ( vector< data_t > &  y,
gzFile  in,
int  nc 
)

Definition at line 742 of file IGBops.cc.

Here is the caller graph for this function:

◆ sclip_ab()

void sclip_ab ( data_t dat,
int  sz,
data_t  upper,
data_t  lower,
vector< data_t > &  scr,
int  t,
int  tfinal,
FILE *  out 
)

Definition at line 493 of file IGBops.cc.

Here is the caller graph for this function:

◆ simp38()

template<class T >
void simp38 ( T *  x,
int  n,
int  t,
data_t runInt,
float  dt 
)

Simpson's 3/8 rule.

Parameters
xdata
nsize of data
ttime step (<0 = boundary of interval)
runIntrunning integral
dtsize of time step

Definition at line 572 of file IGBops.cc.

Here is the caller graph for this function:

◆ t_maxX()

void t_maxX ( data_t x,
data_t mx,
data_t tm,
size_t  n,
float  t 
)

Definition at line 411 of file IGBops.cc.

Here is the caller graph for this function:

◆ varXi()

void varXi ( data_t x,
data_t mean,
vector< data_t > &  sum,
const data_t  fac 
)

Definition at line 316 of file IGBops.cc.

Here is the caller graph for this function:

◆ Xbox()

void Xbox ( data_t dat,
int  x,
int  y,
FILE *  out,
int  d,
int  nc 
)

Definition at line 469 of file IGBops.cc.

Here is the caller graph for this function:

◆ XdivY() [1/2]

void XdivY ( data_t x,
data_t y,
int  slsz,
FILE *  out 
)

Definition at line 334 of file IGBops.cc.

Here is the caller graph for this function:

◆ XdivY() [2/2]

void XdivY ( data_t x,
data_t y,
int  slsz,
int  nc,
FILE *  out 
)

Definition at line 357 of file IGBops.cc.

◆ XmulY() [1/2]

void XmulY ( data_t x,
data_t y,
int  slsz,
FILE *  out 
)

Definition at line 379 of file IGBops.cc.

Here is the caller graph for this function:

◆ XmulY() [2/2]

void XmulY ( data_t x,
data_t y,
int  slsz,
int  nc,
FILE *  out 
)

Definition at line 388 of file IGBops.cc.

◆ XPLUS_a()

void XPLUS_a ( data_t x,
data_t  a,
int  slsz,
FILE *  out 
)

Definition at line 458 of file IGBops.cc.

Variable Documentation

◆ IGB_DATA_T

int IGB_DATA_T[5] = { 0, IGB_FLOAT, IGB_COMPLEX, IGB_VEC3_f, IGB_VEC4_f }

Definition at line 122 of file IGBops.cc.

◆ MAX_NC

const int MAX_NC =4

Definition at line 66 of file IGBops.cc.

◆ Tbit

int Tbit =1

Definition at line 71 of file IGBops.cc.