EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
cs_utsolve.c
Go to the documentation of this file.
1 #include "cs.h"
2 /* solve U'x=b where x and b are dense. x=b on input, solution on output. */
3 CS_INT cs_utsolve (const cs *U, CS_ENTRY *x)
4 {
5  CS_INT p, j, n, *Up, *Ui ;
6  CS_ENTRY *Ux ;
7  if (!CS_CSC (U) || !x) return (0) ; /* check inputs */
8  n = U->n ; Up = U->p ; Ui = U->i ; Ux = U->x ;
9  for (j = 0 ; j < n ; j++)
10  {
11  for (p = Up [j] ; p < Up [j+1]-1 ; p++)
12  {
13  x [j] -= CS_CONJ (Ux [p]) * x [Ui [p]] ;
14  }
15  x [j] /= CS_CONJ (Ux [Up [j+1]-1]) ;
16  }
17  return (1) ;
18 }
#define cs
Definition: cs.h:637
#define CS_CONJ(x)
Definition: cs.h:649
#define CS_ENTRY
Definition: cs.h:635
CS_INT cs_utsolve(const cs *U, CS_ENTRY *x)
Definition: cs_utsolve.c:3
#define CS_CSC(A)
Definition: cs.h:659
#define CS_INT
Definition: cs.h:627