Overture  Version 25
Macros
TridiagonalFactor.C File Reference
#include "TridiagonalSolver.h"
#include "OvertureInit.h"
Include dependency graph for TridiagonalFactor.C:

Macros

#define FACTOR(I)
 
#define FACTOR(I)
 
#define A(i)   ap[i]
 
#define B(i)   bp[i]
 
#define C(i)   cp[i]
 
#define A(i)   ap[(i)+aDim0*(i2+aDim1*(i3))]
 
#define B(i)   bp[(i)+aDim0*(i2+aDim1*(i3))]
 
#define C(i)   cp[(i)+aDim0*(i2+aDim1*(i3))]
 
#define LI
 
#define RI   ,I2,I3
 
#define A(i)   ap[(i)*stride]
 
#define B(i)   bp[(i)*stride]
 
#define C(i)   cp[(i)*stride]
 
#define A(i1, i2, i3)   ap[i1+aDim0*(i2+aDim1*(i3))]
 
#define B(i1, i2, i3)   bp[i1+aDim0*(i2+aDim1*(i3))]
 
#define C(i1, i2, i3)   cp[i1+aDim0*(i2+aDim1*(i3))]
 
#define LI   I1,
 
#define RI   ,I3
 
#define A(i)   ap[(i)*stride]
 
#define B(i)   bp[(i)*stride]
 
#define C(i)   cp[(i)*stride]
 
#define A(i1, i2, i3)   ap[i1+aDim0*(i2+aDim1*(i3))]
 
#define B(i1, i2, i3)   bp[i1+aDim0*(i2+aDim1*(i3))]
 
#define C(i1, i2, i3)   cp[i1+aDim0*(i2+aDim1*(i3))]
 
#define LI   I1,I2,
 
#define RI
 
#define FACTOR(I)
 
#define A(i1)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i1)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i1)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define W1(i1)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i1)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI
 
#define RI   ,I2,I3
 
#define A(i2)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i2)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i2)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define W1(i2)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i2)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI   I1,
 
#define RI   ,I3
 
#define A(i3)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i3)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i3)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define W1(i3)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i3)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI   I1,I2,
 
#define RI
 
#define SOLVE(I)
 
#define SOLVE(I)
 
#define A(i1)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i1)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i1)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i1)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define LI
 
#define RI   ,I2,I3
 
#define A(i2)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i2)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i2)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i2)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define LI   I1,
 
#define RI   ,I3
 
#define A(i3)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i3)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i3)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i3)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define LI   I1,I2,
 
#define RI
 
#define SOLVE(I)
 
#define A(i1)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i1)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i1)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i1)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define W1(i1)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i1)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI
 
#define RI   ,I2,I3
 
#define A(i2)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i2)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i2)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i2)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define W1(i2)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i2)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI   I1,
 
#define RI   ,I3
 
#define A(i3)   ap[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define B(i3)   bp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define C(i3)   cp[(i1)+aDim0*(i2+aDim1*(i3))]
 
#define R(i3)   rp[(i1)+rDim0*(i2+rDim1*(i3))]
 
#define W1(i3)   w1p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define W2(i3)   w2p[(i1)+wDim0*(i2+wDim1*(i3))]
 
#define LI   I1,I2,
 
#define RI
 
#define A(m, i)   ap[m+stride*(i)]
 
#define B(m, i)   bp[m+stride*(i)]
 
#define C(m, i)   cp[m+stride*(i)]
 
#define INVERT(B, i)
 
#define A(m, i)   ap[m+stride*(i)]
 
#define B(m, i)   bp[m+stride*(i)]
 
#define C(m, i)   cp[m+stride*(i)]
 
#define INVERT(B, i)
 
#define A(m, i)   ap[m+stride*(i)]
 
#define B(m, i)   bp[m+stride*(i)]
 
#define C(m, i)   cp[m+stride*(i)]
 
#define R(m, i)   rp[m+rStride*(i)]
 
#define A(m, i)   ap[m+stride*(i)]
 
#define B(m, i)   bp[m+stride*(i)]
 
#define C(m, i)   cp[m+stride*(i)]
 
#define R(m, i)   rp[m+rStride*(i)]
 

Macro Definition Documentation

#define A (   i)    ap[i]
#define A (   i)    ap[(i)+aDim0*(i2+aDim1*(i3))]
#define A (   i)    ap[(i)*stride]
#define A (   i1,
  i2,
  i3 
)    ap[i1+aDim0*(i2+aDim1*(i3))]
#define A (   i)    ap[(i)*stride]
#define A (   i1,
  i2,
  i3 
)    ap[i1+aDim0*(i2+aDim1*(i3))]
#define A (   i1)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i2)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i3)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i1)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i2)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i3)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i1)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i2)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   i3)    ap[(i1)+aDim0*(i2+aDim1*(i3))]
#define A (   m,
 
)    ap[m+stride*(i)]
#define A (   m,
 
)    ap[m+stride*(i)]
#define A (   m,
 
)    ap[m+stride*(i)]
#define A (   m,
 
)    ap[m+stride*(i)]
#define B (   i)    bp[i]
#define B (   i)    bp[(i)+aDim0*(i2+aDim1*(i3))]
#define B (   i)    bp[(i)*stride]
#define B (   i1,
  i2,
  i3 
)    bp[i1+aDim0*(i2+aDim1*(i3))]
#define B (   i)    bp[(i)*stride]
#define B (   i1,
  i2,
  i3 
)    bp[i1+aDim0*(i2+aDim1*(i3))]
#define B (   i1)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i2)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i3)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i1)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i2)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i3)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i1)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i2)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   i3)    bp[(i1)+aDim0*(i2+aDim1*(i3))]
#define B (   m,
 
)    bp[m+stride*(i)]
#define B (   m,
 
)    bp[m+stride*(i)]
#define B (   m,
 
)    bp[m+stride*(i)]
#define B (   m,
 
)    bp[m+stride*(i)]
#define C (   i)    cp[i]
#define C (   i)    cp[(i)+aDim0*(i2+aDim1*(i3))]
#define C (   i)    cp[(i)*stride]
#define C (   i1,
  i2,
  i3 
)    cp[i1+aDim0*(i2+aDim1*(i3))]
#define C (   i)    cp[(i)*stride]
#define C (   i1,
  i2,
  i3 
)    cp[i1+aDim0*(i2+aDim1*(i3))]
#define C (   i1)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i2)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i3)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i1)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i2)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i3)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i1)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i2)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   i3)    cp[(i1)+aDim0*(i2+aDim1*(i3))]
#define C (   m,
 
)    cp[m+stride*(i)]
#define C (   m,
 
)    cp[m+stride*(i)]
#define C (   m,
 
)    cp[m+stride*(i)]
#define C (   m,
 
)    cp[m+stride*(i)]
#define FACTOR (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
if( systemType==extended ) \
{ \
/* eliminate c[n] */ \
c(LI bound RI)/=a(LI bound-1 RI); /* save the factor here */ \
a(LI bound RI)-=b(LI bound-1 RI)*c(LI bound RI); \
b(LI bound RI)-=c(LI bound-1 RI)*c(LI bound RI); \
\
} \
for( int i=base+1; i<=bound; i++ ) \
{ \
a(LI i RI)/=b(LI i-1 RI); \
b(LI i RI)-=a(LI i RI)*c(LI i-1 RI); \
if( i==base+1 && systemType==extended ) \
c(LI base+1 RI)-=a(LI base+1 RI)*a(LI base RI); /* adjust c[1] */ \
} \

Referenced by TridiagonalSolver::periodicTridiagonalFactor(), and TridiagonalSolver::tridiagonalFactor().

#define FACTOR (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
for( int i=base+1; i<=bound; i++ ) \
{ \
a(LI i RI)/=b(LI i-1 RI); \
b(LI i RI)-=a(LI i RI)*c(LI i-1 RI); \
if( systemType==extended ) \
{ \
if( i==base+1 ) \
c(LI base+1 RI)-=a(LI base+1 RI)*a(LI base RI); /* adjust c[1] */ \
if( i==bound-1 ) \
{ /* adjust row n at step n-1 */ \
c(LI bound RI)/=b(LI i-1 RI); /* save the factor here */ \
a(LI bound RI)-=c(LI bound RI)*c(LI i-1 RI); \
} \
} \
}
#define FACTOR (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
if( bound-base+1<3 ) \
{ \
cout << "periodicTridiagonalFactor:ERROR bound-base+1<3 \n"; \
Overture::abort("error"); \
} \
w2(LI base RI)=a(LI base RI); \
for( int i=base+1; i<=bound-1; i++ ) \
{ \
a(LI i RI)/=b(LI i-1 RI); \
b(LI i RI)-=a(LI i RI)*c(LI i-1 RI); \
w2(LI i RI)=-a(LI i RI)*w2(LI i-1 RI); \
w1(LI i RI)=c(LI bound RI)/b(LI i-1 RI); \
c(LI bound RI)=-w1(LI i RI)*c(LI i-1 RI); \
b(LI bound RI)-=w1(LI i RI)*w2(LI i-1 RI); \
} \
w2(LI bound-1 RI)+=c(LI bound-1 RI); \
a(LI bound RI)+=c(LI bound RI); \
a(LI bound RI)/=b(LI bound-1 RI); \
b(LI bound RI)-=a(LI bound RI)*w2(LI bound-1 RI);
#define INVERT (   B,
 
)
Value:
deti = 1./(B(0,i)*B(3,i)-B(2,i)*B(1,i)); \
temp= B(0,i)*deti; \
B(0,i)=B(3,i)*deti; \
B(1,i)*=-deti; \
B(2,i)*=-deti; \
B(3,i)=temp;

Referenced by TridiagonalSolver::scalarBlockFactor(), and TridiagonalSolver::scalarBlockPeriodicFactor().

#define INVERT (   B,
 
)
Value:
b00=B(0,i), b10=B(1,i), b20=B(2,i); \
b01=B(3,i), b11=B(4,i), b21=B(5,i); \
b02=B(6,i), b12=B(7,i), b22=B(8,i); \
deti = 1./(b00*(b11*b22-b12*b21)+ \
b10*(b21*b02-b22*b01)+ \
b20*(b01*b12-b02*b11) ); \
d00= (b11*b22-b12*b21)*deti; \
d01= (b21*b02-b22*b01)*deti; \
d02= (b01*b12-b02*b11)*deti; \
d10= (b12*b20-b10*b22)*deti; \
d11= (b22*b00-b20*b02)*deti; \
d12= (b02*b10-b00*b12)*deti; \
d20= (b10*b21-b11*b20)*deti; \
d21= (b20*b01-b21*b00)*deti; \
d22= (b00*b11-b01*b10)*deti; \
B(0,i)=d00; \
B(1,i)=d10; \
B(2,i)=d20; \
B(3,i)=d01; \
B(4,i)=d11; \
B(5,i)=d21; \
B(6,i)=d02; \
B(7,i)=d12; \
B(8,i)=d22;
#define LI
#define LI   I1,
#define LI   I1,I2,
#define LI
#define LI   I1,
#define LI   I1,I2,
#define LI
#define LI   I1,
#define LI   I1,I2,
#define LI
#define LI   I1,
#define LI   I1,I2,
#define R (   i1)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   i2)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   i3)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   i1)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   i2)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   i3)    rp[(i1)+rDim0*(i2+rDim1*(i3))]
#define R (   m,
 
)    rp[m+rStride*(i)]
#define R (   m,
 
)    rp[m+rStride*(i)]
#define RI   ,I2,I3

Referenced by Ogen::changeParameters().

#define RI   ,I3
#define RI
#define RI   ,I2,I3
#define RI   ,I3
#define RI
#define RI   ,I2,I3
#define RI   ,I3
#define RI
#define RI   ,I2,I3
#define RI   ,I3
#define RI
#define SOLVE (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
/* forward elimination */ \
if( systemType==extended ) \
r(LI bound RI)-=c(LI bound RI)*r(LI bound-1 RI); \
\
for( i=base+1; i<=bound; i++ ) \
r(LI i RI)-=a(LI i RI)*r(LI i-1 RI); \
\
/* back substitution */ \
r(LI bound RI)/=b(LI bound RI); \
for( i=bound-1; i>=base; i-- ) \
r(LI i RI)=( r(LI i RI)-c(LI i RI)*r(LI i+1 RI))/b(LI i RI); \
if( systemType==extended ) \
r(LI base RI)-=a(LI base RI)*r(LI base+2 RI)/b(LI base RI); \

Referenced by TridiagonalSolver::periodicTridiagonalSolve(), and TridiagonalSolver::tridiagonalSolve().

#define SOLVE (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
/* forward elimination */ \
for( i=base+1; i<=bound; i++ ) \
{ \
r(LI i RI)-=a(LI i RI)*r(LI i-1 RI); \
if( systemType==extended && i==bound-1 ) \
r(LI bound RI)-=c(LI bound RI)*r(LI i-1 RI); /* adjust r[n] at step n-1 */ \
} \
\
/* back substitution */ \
r(LI bound RI)/=b(LI bound RI); \
for( i=bound-1; i>=base; i-- ) \
r(LI i RI)=( r(LI i RI)-c(LI i RI)*r(LI i+1 RI))/b(LI i RI); \
if( systemType==extended ) \
r(LI base RI)-=a(LI base RI)*r(LI base+2 RI)/b(LI base RI); \
#define SOLVE (   I)
Value:
int base =I.getBase(); \
int bound=I.getBound(); \
if( bound-base+1<3 ) \
{ \
cout << "periodicTridiagonalSolve:ERROR bound-base+1<3 \n"; \
Overture::abort("error"); \
} \
for( i=base+1; i<bound; i++ ) \
{ \
r(LI i RI)-=a(LI i RI)*r(LI i-1 RI); \
r(LI bound RI)-=w1(LI i RI)*r(LI i-1 RI); \
} \
r(LI bound RI)=(r(LI bound RI)-a(LI bound RI)*r(LI bound-1 RI))/b(LI bound RI); \
i=bound-1; \
r(LI i RI)=(r(LI i RI)-w2(LI i RI)*r(LI bound RI))/b(LI i RI); \
for( i=bound-2; i>=base; i-- ) \
r(LI i RI)=(r(LI i RI)-c(LI i RI)*r(LI i+1 RI)-w2(LI i RI)*r(LI bound RI))/b(LI i RI);
#define W1 (   i1)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W1 (   i2)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W1 (   i3)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W1 (   i1)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W1 (   i2)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W1 (   i3)    w1p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i1)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i2)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i3)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i1)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i2)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]
#define W2 (   i3)    w2p[(i1)+wDim0*(i2+wDim1*(i3))]