Matrix r5059
Loading...
Searching...
No Matches
diag.c File Reference
#include <math.h>
#include "cholmod-etc.h"
#include "Mdefines.h"
#include "M5.h"
#include "idz.h"

Go to the source code of this file.

Macros

#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 
#define TEMPLATE(c)
 

Functions

SEXP dense_diag_get (SEXP obj, const char *class, int names)
 
SEXP sparse_diag_get (SEXP obj, const char *class, int names)
 
SEXP R_dense_diag_get (SEXP s_obj, SEXP s_names)
 
SEXP R_sparse_diag_get (SEXP s_obj, SEXP s_names)
 
SEXP dense_diag_set (SEXP from, const char *class, SEXP value, int new)
 
SEXP sparse_diag_set (SEXP from, const char *class, SEXP value)
 
SEXP R_dense_diag_set (SEXP s_from, SEXP s_value)
 
SEXP R_sparse_diag_set (SEXP s_from, SEXP s_value)
 
SEXP sparse_diag_U2N (SEXP from, const char *class)
 
SEXP sparse_diag_N2U (SEXP from, const char *class)
 
SEXP R_sparse_diag_U2N (SEXP s_from)
 
SEXP R_sparse_diag_N2U (SEXP s_from)
 
SEXP denseCholesky_diag_get (SEXP s_trf, SEXP s_root)
 
SEXP sparseCholesky_diag_get (SEXP s_trf, SEXP s_root)
 

Macro Definition Documentation

◆ TEMPLATE [1/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *pa = c##PTR(ans), *px = c##PTR(x); \
if (!packed) \
c##NAME(copy2)(r_, pa, 1, px, m_ + 1); \
else if (ul == 'U') \
c##NAME(copy1)(n_, pa, 1, 0, 0, px, 2 , 1, 0); \
else \
c##NAME(copy1)(n_, pa, 1, 0, 0, px, n_, 1, 1); \
} while (0)
cholmod_common c
Definition cholmod-etc.c:5

Referenced by dense_diag_get(), dense_diag_set(), sparse_diag_get(), and sparse_diag_set().

◆ TEMPLATE [2/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *pa = c##PTR(ans); \
c##IF_NPATTERN( \
SEXP x = GET_SLOT(obj, Matrix_xSym); \
c##TYPE *px = c##PTR(x); \
); \
if (class[1] == 'g') \
for (j = 0, k = 0; j < r; ++j) { \
pa[j] = c##ZERO; \
kend = pp[j]; \
while (k < kend) { \
if (pi[k] != j) \
++k; \
else { \
pa[j] = c##IFELSE_NPATTERN(px[k], c##UNIT); \
k = kend; \
} \
} \
} \
else \
for (j = 0, k = 0; j < r; ++j) { \
kend = pp[j]; \
pa[j] = (k < kend && pi[(up) ? kend - 1 : k] == j) \
? c##IFELSE_NPATTERN(px[(up) ? kend - 1 : k], c##UNIT) \
: c##ZERO; \
k = kend; \
} \
} while (0)
#define GET_SLOT(x, name)
Definition Mdefines.h:72
SEXP Matrix_xSym
Definition init.c:635

◆ TEMPLATE [3/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *pa = c##PTR(ans); \
memset(pa, 0, sizeof(c##TYPE) * (size_t) r); \
c##IF_NPATTERN( \
SEXP x = GET_SLOT(obj, Matrix_xSym); \
c##TYPE *px = c##PTR(x); \
); \
for (k = 0; k < kend; ++k) \
if (pi[k] == pj[k]) \
c##INCREMENT_IDEN(pa[pi[k]], px[k]); \
} while (0)

◆ TEMPLATE [4/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *px = c##PTR(x), *pv = c##PTR(value); \
if (!packed) \
c##NAME(copy2)(r_, px, m_ + 1, pv, d_); \
else if (ul == 'U') \
c##NAME(copy1)(n_, px, 2 , 1, 0, pv, d_, 0, 0); \
else \
c##NAME(copy1)(n_, px, n_, 1, 1, pv, d_, 0, 0); \
} while (0)

◆ TEMPLATE [5/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *pv = c##PTR(value); \
if (LENGTH(value) == r) { \
mode = 1; \
for (j = 0; j < r; ++j) { \
if (c##NOT_ZERO(pv[j])) \
++nd1; \
pp1[j] += nd1; \
} \
for (j = r; j < n; ++j) \
pp1[j] += nd1; \
} else if (c##NOT_ZERO(pv[0])) { \
mode = 2; \
for (j = 0; j < r; ++j) \
pp1[j] += ++nd1; \
for (j = r; j < n; ++j) \
pp1[j] += nd1; \
} \
} while (0)

◆ TEMPLATE [6/8]

#define TEMPLATE ( c)

◆ TEMPLATE [7/8]

#define TEMPLATE ( c)
Value:
do { \
c##TYPE *pv = c##PTR(value); \
if (LENGTH(value) == r) { \
mode = 1; \
for (j = 0; j < r; ++j) \
if (c##NOT_ZERO(pv[j])) \
++nd1; \
} else if (c##NOT_ZERO(pv[0])) { \
mode = 2; \
nd1 = r; \
} \
} while (0)

◆ TEMPLATE [8/8]

#define TEMPLATE ( c)

Function Documentation

◆ dense_diag_get()

SEXP dense_diag_get ( SEXP obj,
const char * class,
int names )

◆ dense_diag_set()

SEXP dense_diag_set ( SEXP from,
const char * class,
SEXP value,
int new )

◆ denseCholesky_diag_get()

SEXP denseCholesky_diag_get ( SEXP s_trf,
SEXP s_root )

Definition at line 666 of file diag.c.

References DIM, GET_SLOT, Matrix_xSym, TYPEOF, and UPLO.

◆ R_dense_diag_get()

SEXP R_dense_diag_get ( SEXP s_obj,
SEXP s_names )

Definition at line 205 of file diag.c.

References dense_diag_get(), Matrix_class(), valid_dense, and VALID_LOGIC2.

◆ R_dense_diag_set()

SEXP R_dense_diag_set ( SEXP s_from,
SEXP s_value )

◆ R_sparse_diag_get()

SEXP R_sparse_diag_get ( SEXP s_obj,
SEXP s_names )

Definition at line 215 of file diag.c.

References Matrix_class(), sparse_diag_get(), VALID_LOGIC2, and valid_sparse.

◆ R_sparse_diag_N2U()

SEXP R_sparse_diag_N2U ( SEXP s_from)

Definition at line 660 of file diag.c.

References Matrix_class(), sparse_diag_N2U(), and valid_sparse.

◆ R_sparse_diag_set()

SEXP R_sparse_diag_set ( SEXP s_from,
SEXP s_value )

◆ R_sparse_diag_U2N()

SEXP R_sparse_diag_U2N ( SEXP s_from)

Definition at line 654 of file diag.c.

References Matrix_class(), sparse_diag_U2N(), and valid_sparse.

◆ sparse_diag_get()

SEXP sparse_diag_get ( SEXP obj,
const char * class,
int names )

◆ sparse_diag_N2U()

SEXP sparse_diag_N2U ( SEXP from,
const char * class )

Definition at line 631 of file diag.c.

References DIAG, DIM, newObject(), SET_DIAG, SET_UPLO, sparse_band(), and UPLO.

Referenced by R_sparse_diag_N2U().

◆ sparse_diag_set()

SEXP sparse_diag_set ( SEXP from,
const char * class,
SEXP value )

◆ sparse_diag_U2N()

SEXP sparse_diag_U2N ( SEXP from,
const char * class )

Definition at line 621 of file diag.c.

References DIAG, and R_sparse_diag_set().

Referenced by R_sparse_diag_U2N(), and R_sparse_matmult().

◆ sparseCholesky_diag_get()

SEXP sparseCholesky_diag_get ( SEXP s_trf,
SEXP s_root )

Definition at line 702 of file diag.c.

References M2CHF().