Matrix r4655
Loading...
Searching...
No Matches
Macros | Functions
factor.c File Reference
#include "Lapack-etc.h"
#include "cs-etc.h"
#include "cholmod-etc.h"
#include "Mdefines.h"
#include "factor.h"

Go to the source code of this file.

Macros

#define DO_FREE(_A_, _S_, _N_)
 
#define DO_SORT(_A_)
 

Functions

SEXP get_factor (SEXP, const char *)
 
void set_factor (SEXP, const char *, SEXP)
 
static SEXP dgeMatrix_trf_ (SEXP obj, int warn)
 
static SEXP dsyMatrix_trf_ (SEXP obj, int warn)
 
static SEXP dspMatrix_trf_ (SEXP obj, int warn)
 
static SEXP dpoMatrix_trf_ (SEXP obj, int warn, int pivot, double tol)
 
static SEXP dppMatrix_trf_ (SEXP obj, int warn)
 
SEXP dgeMatrix_trf (SEXP obj, SEXP warn)
 
SEXP dsyMatrix_trf (SEXP obj, SEXP warn)
 
SEXP dspMatrix_trf (SEXP obj, SEXP warn)
 
SEXP dpoMatrix_trf (SEXP obj, SEXP warn, SEXP pivot, SEXP tol)
 
SEXP dppMatrix_trf (SEXP obj, SEXP warn)
 
SEXP dgeMatrix_sch (SEXP x, SEXP vectors, SEXP isDGE)
 
static int dgCMatrix_trf_ (const Matrix_cs *A, Matrix_css **S, Matrix_csn **N, int order, double tol)
 
SEXP dgCMatrix_trf (SEXP obj, SEXP order, SEXP tol, SEXP doError)
 
static int dgCMatrix_orf_ (const Matrix_cs *A, Matrix_css **S, Matrix_csn **N, int order)
 
SEXP dgCMatrix_orf (SEXP obj, SEXP order, SEXP doError)
 
static int dpCMatrix_trf_ (cholmod_sparse *A, cholmod_factor **L, int perm, int ldl, int super, double mult)
 
SEXP dpCMatrix_trf (SEXP obj, SEXP perm, SEXP ldl, SEXP super, SEXP mult)
 
SEXP BunchKaufman_expand (SEXP obj, SEXP packed)
 
SEXP CHMfactor_diag_get (SEXP obj, SEXP square)
 
SEXP CHMfactor_update (SEXP obj, SEXP parent, SEXP mult)
 
SEXP CHMfactor_updown (SEXP obj, SEXP parent, SEXP update)
 

Macro Definition Documentation

◆ DO_FREE

#define DO_FREE (   _A_,
  _S_,
  _N_ 
)
Value:
do { \
if (!(_A_)) \
_A_ = Matrix_cs_spfree(_A_); \
if (!(_S_)) \
_S_ = Matrix_cs_sfree (_S_); \
if (!(_N_)) \
_N_ = Matrix_cs_nfree (_N_); \
} while (0)
Matrix_cs * Matrix_cs_spfree(Matrix_cs *A)
Definition cs-etc.c:338
Matrix_css * Matrix_cs_sfree(Matrix_css *S)
Definition cs-etc.c:271
Matrix_csn * Matrix_cs_nfree(Matrix_csn *N)
Definition cs-etc.c:186

Definition at line 357 of file factor.c.

◆ DO_SORT

#define DO_SORT (   _A_)
Value:
do { \
Matrix_cs_dropzeros(_A_); \
T = Matrix_cs_transpose(_A_, 1); \
if (!T) { \
DO_FREE(T, *S, *N); \
return 0; \
} \
_A_ = Matrix_cs_spfree(_A_); \
_A_ = Matrix_cs_transpose(T, 1); \
if (!(_A_)) { \
DO_FREE(T, *S, *N); \
return 0; \
} \
T = Matrix_cs_spfree(T); \
} while (0)
Matrix_cs * Matrix_cs_transpose(const Matrix_cs *A, int values)
Definition cs-etc.c:386

Definition at line 367 of file factor.c.

Function Documentation

◆ BunchKaufman_expand()

SEXP BunchKaufman_expand ( SEXP  obj,
SEXP  packed 
)

◆ CHMfactor_diag_get()

SEXP CHMfactor_diag_get ( SEXP  obj,
SEXP  square 
)

Definition at line 849 of file factor.c.

References M2CHF().

◆ CHMfactor_update()

SEXP CHMfactor_update ( SEXP  obj,
SEXP  parent,
SEXP  mult 
)

◆ CHMfactor_updown()

SEXP CHMfactor_updown ( SEXP  obj,
SEXP  parent,
SEXP  update 
)

Definition at line 920 of file factor.c.

References c, CHF2M(), GET_SLOT, M2CHF(), M2CHS(), Matrix_DimNamesSym, Matrix_shape(), Matrix_uploSym, and SET_SLOT.

◆ dgCMatrix_orf()

SEXP dgCMatrix_orf ( SEXP  obj,
SEXP  order,
SEXP  doError 
)

◆ dgCMatrix_orf_()

static int dgCMatrix_orf_ ( const Matrix_cs A,
Matrix_css **  S,
Matrix_csn **  N,
int  order 
)
static

Definition at line 477 of file factor.c.

References DO_FREE, DO_SORT, Matrix_cs_qr(), and Matrix_cs_sqr().

Referenced by dgCMatrix_orf().

◆ dgCMatrix_trf()

SEXP dgCMatrix_trf ( SEXP  obj,
SEXP  order,
SEXP  tol,
SEXP  doError 
)

◆ dgCMatrix_trf_()

static int dgCMatrix_trf_ ( const Matrix_cs A,
Matrix_css **  S,
Matrix_csn **  N,
int  order,
double  tol 
)
static

Definition at line 385 of file factor.c.

References DO_FREE, DO_SORT, Matrix_cs_lu(), and Matrix_cs_sqr().

Referenced by dgCMatrix_trf().

◆ dgeMatrix_sch()

SEXP dgeMatrix_sch ( SEXP  x,
SEXP  vectors,
SEXP  isDGE 
)

Definition at line 309 of file factor.c.

References _, FCONE, GET_SLOT, Matrix_Calloc, Matrix_DimSym, Matrix_Free, and Matrix_xSym.

◆ dgeMatrix_trf()

SEXP dgeMatrix_trf ( SEXP  obj,
SEXP  warn 
)

Definition at line 252 of file factor.c.

References dgeMatrix_trf_(), get_factor(), and set_factor().

◆ dgeMatrix_trf_()

static SEXP dgeMatrix_trf_ ( SEXP  obj,
int  warn 
)
static

◆ dpCMatrix_trf()

SEXP dpCMatrix_trf ( SEXP  obj,
SEXP  perm,
SEXP  ldl,
SEXP  super,
SEXP  mult 
)

◆ dpCMatrix_trf_()

static int dpCMatrix_trf_ ( cholmod_sparse *  A,
cholmod_factor **  L,
int  perm,
int  ldl,
int  super,
double  mult 
)
static

Definition at line 569 of file factor.c.

References c, R_cholmod_common_envget(), and R_cholmod_common_envset().

Referenced by CHMfactor_update(), and dpCMatrix_trf().

◆ dpoMatrix_trf()

SEXP dpoMatrix_trf ( SEXP  obj,
SEXP  warn,
SEXP  pivot,
SEXP  tol 
)

Definition at line 285 of file factor.c.

References dpoMatrix_trf_(), get_factor(), and set_factor().

◆ dpoMatrix_trf_()

static SEXP dpoMatrix_trf_ ( SEXP  obj,
int  warn,
int  pivot,
double  tol 
)
static

◆ dppMatrix_trf()

SEXP dppMatrix_trf ( SEXP  obj,
SEXP  warn 
)

Definition at line 298 of file factor.c.

References dppMatrix_trf_(), get_factor(), and set_factor().

◆ dppMatrix_trf_()

static SEXP dppMatrix_trf_ ( SEXP  obj,
int  warn 
)
static

◆ dspMatrix_trf()

SEXP dspMatrix_trf ( SEXP  obj,
SEXP  warn 
)

Definition at line 274 of file factor.c.

References dspMatrix_trf_(), get_factor(), and set_factor().

◆ dspMatrix_trf_()

static SEXP dspMatrix_trf_ ( SEXP  obj,
int  warn 
)
static

◆ dsyMatrix_trf()

SEXP dsyMatrix_trf ( SEXP  obj,
SEXP  warn 
)

Definition at line 263 of file factor.c.

References dsyMatrix_trf_(), get_factor(), and set_factor().

◆ dsyMatrix_trf_()

static SEXP dsyMatrix_trf_ ( SEXP  obj,
int  warn 
)
static

◆ get_factor()

SEXP get_factor ( SEXP  obj,
const char *  nm 
)

◆ set_factor()

void set_factor ( SEXP  obj,
const char *  nm,
SEXP  val 
)