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