static int ATL_trtriRU_3(const enum ATLAS_DIAG Diag, TYPE *A, const int lda) { TYPE *pA0=A, *pA1=A+lda, *pA2=A+2*lda; TYPE A01=pA0[1], A02=pA0[2]; TYPE A12=pA1[2]; TYPE *B01 = pA0+1; TYPE *B02 = pA0+2; TYPE *B12 = pA1+2; TYPE tmp; if (Diag == AtlasNonUnit) { SAFE_INVERT(pA0); SAFE_INVERT(pA1+1); SAFE_INVERT(pA2+2); *B01 = -A01*pA1[1]*pA0[0]; *B12 = -A12*pA2[2]*pA1[1]; *B02 = -(A01*(*B12)+A02*pA2[2])*pA0[0]; } else { *B01 = -A01; *B12 = -A12; *B02 = -(A01*(*B12)+A02); } return(0); }
static int ATL_trtriRL_3(const enum ATLAS_DIAG Diag, TYPE *A, const int lda) { TYPE *pA0=A, *pA1=A+lda, *pA2=A+2*lda; TYPE A10=pA1[0]; TYPE A20=pA2[0], A21=pA2[1]; TYPE *B10 = pA1; TYPE *B20 = pA2; TYPE *B21 = pA2+1; TYPE tmp; if (Diag == AtlasNonUnit) { SAFE_INVERT(pA0); SAFE_INVERT(pA1+1); SAFE_INVERT(pA2+2); *B10 = -A10*pA0[0]*pA1[1]; *B21 = -A21*pA1[1]*pA2[2]; *B20 = -(A20*pA0[0]+A21*(*B10))*pA2[2]; } else { *B10 = -A10; *B21 = -A21; *B20 = -(A20+A21*(*B10)); } return(0); }
static int ATL_trtriRL_4(const enum ATLAS_DIAG Diag, TYPE *A, const int lda) { TYPE *pA0=A, *pA1=A+lda, *pA2=A+2*lda, *pA3=A+3*lda; TYPE A10=pA1[0]; TYPE A20=pA2[0], A21=pA2[1]; TYPE A30=pA3[0], A31=pA3[1], A32=pA3[2]; TYPE *B10 = pA1; TYPE *B20 = pA2; TYPE *B30 = pA3; TYPE *B21 = pA2+1; TYPE *B31 = pA3+1; TYPE *B32 = pA3+2; TYPE tmp; if (Diag == AtlasNonUnit) { SAFE_INVERT(pA0); SAFE_INVERT(pA1+1); SAFE_INVERT(pA2+2); SAFE_INVERT(pA3+3); *B10 = -A10*pA0[0]*pA1[1]; *B21 = -A21*pA1[1]*pA2[2]; *B32 = -A32*pA2[2]*pA3[3]; *B20 = -(A20*pA0[0]+A21*(*B10))*pA2[2]; *B31 = -(A31*pA1[1]+A32*(*B21))*pA3[3]; *B30 = -(A30*pA0[0]+A31*(*B10)+A32*(*B20))*pA3[3]; } else { *B10 = -A10; *B21 = -A21; *B32 = -A32; *B20 = -(A20+A21*(*B10)); *B31 = -(A31+A32*(*B21)); *B30 = -(A30+A31*(*B10)+A32*(*B20)); } return(0); }
static int ATL_trtriRU_4(const enum ATLAS_DIAG Diag, TYPE *A, const int lda) { TYPE *pA0=A, *pA1=A+lda, *pA2=A+2*lda, *pA3=A+3*lda; TYPE A01=pA0[1], A02=pA0[2], A03=pA0[3]; TYPE A12=pA1[2], A13=pA1[3]; TYPE A23=pA2[3]; TYPE tmp; if (Diag == AtlasNonUnit) { SAFE_INVERT(pA0); SAFE_INVERT(pA1+1); SAFE_INVERT(pA2+2); SAFE_INVERT(pA3+3); pA0[1] = -A01*pA1[1]*pA0[0]; pA1[2] = -A12*pA2[2]*pA1[1]; pA2[3] = -A23*pA3[3]*pA2[2]; pA0[2] = -(A01*pA1[2]+A02*pA2[2])*pA0[0]; pA1[3] = -(A12*pA2[3]+A13*pA3[3])*pA1[1]; pA0[3] = -(A01*pA1[3]+A02*pA2[3]+A03*pA3[3])*pA0[0]; } else { pA0[1] = -A01; pA1[2] = -A12; pA2[3] = -A23; pA0[2] = -(A01*pA1[2]+A02); pA1[3] = -(A12*pA2[3]+A13); pA0[3] = -(A01*pA1[3]+A02*pA2[3]+A03); } return(0); }