1
1
/* ========================================================================== */
2
/* === klu_tsolve =========================================================== */
2
/* === KLU_tsolve =========================================================== */
3
3
/* ========================================================================== */
5
/* Solve A'x=b using the symbolic and numeric objects from klu_analyze
6
* (or klu_analyze_given) and klu_factor. Note that no iterative refinement is
5
/* Solve A'x=b using the symbolic and numeric objects from KLU_analyze
6
* (or KLU_analyze_given) and KLU_factor. Note that no iterative refinement is
7
7
* performed. Uses Numeric->Xwork as workspace (undefined on input and output),
8
8
* of size 4n Entry's (note that columns 2 to 4 of Xwork overlap with
12
12
#include "klu_internal.h"
16
16
/* inputs, not modified */
17
klu_symbolic *Symbolic,
19
int d, /* leading dimension of B */
20
int nrhs, /* number of right-hand-sides */
17
KLU_symbolic *Symbolic,
19
Int d, /* leading dimension of B */
20
Int nrhs, /* number of right-hand-sides */
22
22
/* right-hand-side on input, overwritten with solution to Ax=b on output */
23
23
double B [ ], /* size n*nrhs, in column-oriented form, with
24
24
* leading dimension d. */
26
int conj_solve, /* TRUE for conjugate transpose solve, FALSE for
26
Int conj_solve, /* TRUE for conjugate transpose solve, FALSE for
27
27
* array transpose solve. Used for the complex
30
30
/* --------------- */
34
34
Entry x [4], offik, s ;
36
Entry *Singleton, *Offx, *X, *Bz ;
37
int *Q, *R, *Pnum, *Offp, *Offi ;
38
int **Lbip, **Ubip, **Lblen, **Ublen ;
39
Unit **LUbx, **Udiag ;
40
int k1, k2, nk, k, block, pend, n, p, nblocks, chunk, nr, i ;
36
Entry *Offx, *X, *Bz, *Udiag ;
37
Int *Q, *R, *Pnum, *Offp, *Offi, *Lip, *Uip, *Llen, *Ulen ;
39
Int k1, k2, nk, k, block, pend, n, p, nblocks, chunk, nr, i ;
41
/* ---------------------------------------------------------------------- */
43
/* ---------------------------------------------------------------------- */
42
45
if (Common == NULL)
49
if (Numeric == NULL || Symbolic == NULL || d < Symbolic->n || nrhs < 0 ||
52
Common->status = KLU_INVALID ;
46
55
Common->status = KLU_OK ;
50
/* invalid Numeric object */
51
Common->status = KLU_INVALID ;
57
/* ---------------------------------------------------------------------- */
58
/* get the contents of the Symbolic object */
59
/* ---------------------------------------------------------------------- */
57
/* ---------------------------------------------------------------------- */
58
/* get the contents of the Symbolic object */
59
/* ---------------------------------------------------------------------- */
62
63
nblocks = Symbolic->nblocks ;
338
KLU_utsolve (nk, Ubip [block], Ublen [block], LUbx [block],
338
KLU_utsolve (nk, Uip + k1, Ulen + k1, LUbx [block],
344
KLU_ltsolve (nk, Lbip [block], Lblen [block], LUbx [block], nr,
344
KLU_ltsolve (nk, Lip + k1, Llen + k1, LUbx [block], nr,