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, SPACE_TIME, SPACE, PT_TIME,
  TIME, PT
}
 

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 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)
 Simpson's 3/8 rule. More...
 
template<class T >
void midpt (T *x, int n, bool end, data_t *reduce)
 
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 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 119 of file IGBops.cc.

Enumeration Type Documentation

◆ Data_file_t

Enumerator
NONE 
SPACE_TIME 
SPACE 
PT_TIME 
TIME 
PT 

Definition at line 69 of file IGBops.cc.

Function Documentation

◆ avgXi()

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

Definition at line 306 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 291 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 323 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 272 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 282 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 237 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 744 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 536 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 170 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 207 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 259 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 601 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 162 of file IGBops.cc.

Here is the caller graph for this function:

◆ joinXY()

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

Definition at line 133 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 515 of file IGBops.cc.

Here is the caller graph for this function:

◆ main()

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

Definition at line 756 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 653 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 409 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 431 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 
)

Midpoint rule

Definition at line 579 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 420 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 395 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 622 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 679 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 690 of file IGBops.cc.

◆ overlap()

bool overlap ( IGBheader first,
IGBheader second 
)

Definition at line 126 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 703 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 727 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 479 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 
)

Simpson's 3/8 rule.

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

Definition at line 557 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 314 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 455 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 332 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 355 of file IGBops.cc.

◆ XmulY() [1/2]

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

Definition at line 377 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 386 of file IGBops.cc.

◆ XPLUS_a()

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

Definition at line 444 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 120 of file IGBops.cc.

◆ MAX_NC

const int MAX_NC =4

Definition at line 65 of file IGBops.cc.