Main Page | Directories | File List | Globals

Mutils.c File Reference

#include "Mutils.h"
#include "triplet_to_col.h"
#include <R_ext/Lapack.h>

Functions

char norm_type (char *typstr)
char rcond_type (char *typstr)
double get_double_by_name (SEXP obj, char *nm)
SEXP set_double_by_name (SEXP obj, double val, char *nm)
SEXP as_det_obj (double val, int log, int sign)
SEXP get_factors (SEXP obj, char *nm)
SEXP set_factors (SEXP obj, SEXP val, char *nm)
SEXP dgCMatrix_set_Dim (SEXP x, int nrow)
int csc_unsorted_columns (int ncol, const int p[], const int i[])
void csc_sort_columns (int ncol, const int p[], int i[], double x[])
SEXP csc_check_column_sorting (SEXP m)
SEXP triple_as_SEXP (int nrow, int ncol, int nz, const int Ti[], const int Tj[], const double Tx[], char *Rclass)
void csc_components_transpose (int m, int n, int nnz, const int xp[], const int xi[], const double xx[], int ap[], int ai[], double ax[])
void ssc_symbolic_permute (int n, int upper, const int perm[], int Ap[], int Ai[])
double * nlme_symmetrize (double *a, const int nc)
void nlme_check_Lapack_error (int info, const char *laName)
SEXP nlme_replaceSlot (SEXP obj, SEXP names, SEXP value)
SEXP nlme_weight_matrix_list (SEXP MLin, SEXP wts, SEXP adjst, SEXP MLout)
SEXP Matrix_make_named (int TYP, char **names)
SEXP alloc3Darray (SEXPTYPE mode, int nrow, int ncol, int nface)
double * expand_csc_column (double *dest, int m, int j, const int Ap[], const int Ai[], const double Ax[])

Function Documentation

SEXP alloc3Darray SEXPTYPE  mode,
int  nrow,
int  ncol,
int  nface
 

Allocate a 3-dimensional array

Parameters:
mode The R mode (e.g. INTSXP)
nrow number of rows
ncol number of columns
nface number of faces
Returns:
A 3-dimensional array of the indicated dimensions and mode

SEXP as_det_obj double  val,
int  log,
int  sign
 

SEXP csc_check_column_sorting SEXP  m  ) 
 

Check for sorted columns in an object that inherits from the dgCMatrix class. Resort the columns if necessary.

Parameters:
m pointer to an object that inherits from the dgCMatrix class
Returns:
m with the columns sorted by increasing row index

void csc_components_transpose int  m,
int  n,
int  nnz,
const int  xp[],
const int  xi[],
const double  xx[],
int  ap[],
int  ai[],
double  ax[]
 

void csc_sort_columns int  ncol,
const int  p[],
int  i[],
double  x[]
 

Sort the columns in a sparse column-oriented matrix so that each column is in increasing order of row index.

Parameters:
ncol number of columns
p column pointers
i row indices
x values of nonzero elements

int csc_unsorted_columns int  ncol,
const int  p[],
const int  i[]
 

Check for unsorted columns in the row indices

Parameters:
ncol number of columns
p column pointers
i row indices
Returns:
0 if all columns are sorted, otherwise 1

SEXP dgCMatrix_set_Dim SEXP  x,
int  nrow
 

double* expand_csc_column double *  dest,
int  m,
int  j,
const int  Ap[],
const int  Ai[],
const double  Ax[]
 

Expand a column of a compressed, sparse, column-oriented matrix.

Parameters:
dest array to hold the result
m number of rows in the matrix
j index (0-based) of column to expand
Ap array of column pointers
Ai array of row indices
Ax array of non-zero values
Returns:
dest

double get_double_by_name SEXP  obj,
char *  nm
 

SEXP get_factors SEXP  obj,
char *  nm
 

SEXP Matrix_make_named int  TYP,
char **  names
 

Create a named vector of type TYP

Parameters:
TYP a vector SEXP type (e.g. REALSXP)
names names of list elements with null string appended
Returns:
pointer to a named vector of type TYP

void nlme_check_Lapack_error int  info,
const char *  laName
 

Check the error code returned by an Lapack routine and create an appropriate error message.

Parameters:
info Error code as returned from the Lapack routine
laName Character string containing the name of the Lapack routine

SEXP nlme_replaceSlot SEXP  obj,
SEXP  names,
SEXP  value
 

Replace the value of a slot or subslot of an object in place. This routine purposely does not copy the value of obj. Use with caution.

Parameters:
obj object with slot to be replaced
names vector of names. The last element is the name of the slot to replace. The leading elements are the names of slots and subslots of obj.
value the replacement value for the slot
Returns:
obj, with the named slot modified in place.

double* nlme_symmetrize double *  a,
const int  nc
 

Symmetrize a matrix by copying the strict upper triangle into the lower triangle.

Parameters:
a pointer to a matrix in Fortran storage mode
nc number of columns (and rows and leading dimension) in the matrix
Returns:
a, symmetrized

SEXP nlme_weight_matrix_list SEXP  MLin,
SEXP  wts,
SEXP  adjst,
SEXP  MLout
 

Produce a weighted copy of the matrices in MLin in the storage allocated to MLout

Parameters:
MLin input matrix list
wts real vector of weights
adjst adjusted response
MLout On input a list of matrices of the same dimensions as MLin.
Returns:
MLout with its contents overwritten by a weighted copy of MLin according to wts with adjst overwriting the response.

char norm_type char *  typstr  ) 
 

char rcond_type char *  typstr  ) 
 

SEXP set_double_by_name SEXP  obj,
double  val,
char *  nm
 

SEXP set_factors SEXP  obj,
SEXP  val,
char *  nm
 

void ssc_symbolic_permute int  n,
int  upper,
const int  perm[],
int  Ap[],
int  Ai[]
 

SEXP triple_as_SEXP int  nrow,
int  ncol,
int  nz,
const int  Ti[],
const int  Tj[],
const double  Tx[],
char *  Rclass
 


Generated on Fri Feb 18 08:49:35 2005 for Matrix by  doxygen 1.4.1