Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
external_packages
csparse
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
int
cs_utsolve
(
const
cs
*
U
,
double
*x)
4
{
5
int
p, j, n, *Up, *Ui ;
6
double
*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] -= Ux [p] * x [Ui [p]] ;
14
}
15
x [j] /= Ux [Up [j+1]-1] ;
16
}
17
return
(1) ;
18
}
cs_sparse::n
int n
Definition:
cs.h:20
U
#define U
Definition:
rocket_with_templates_ocp.hpp:45
cs.h
CS_CSC
#define CS_CSC(A)
Definition:
cs.h:140
cs_sparse::p
int * p
Definition:
cs.h:21
cs_sparse
Definition:
cs.h:16
cs_sparse::i
int * i
Definition:
cs.h:22
cs_utsolve
int cs_utsolve(const cs *U, double *x)
Definition:
cs_utsolve.c:3
cs_sparse::x
double * x
Definition:
cs.h:23
acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:31