ADMB Documentation  11.1.1916
 All Classes Files Functions Variables Typedefs Friends Defines
Defines | Functions | Variables
hs_sparse.cpp File Reference

(* $Id: hs_sparse.cpp 1756 2014-03-05 22:24:49Z johnoel $)

#include <fvar.hpp>
#include "hs.h"

Go to the source code of this file.

Defines

#define USE_ADJOINT_CODE
#define XCONST   const

Functions

int allocated (const dcompressed_triplet &_st)
int allocated (const dvar_compressed_triplet &_st)
int chol (XCONST hs_smatrix &A, XCONST hs_symbolic &T, hs_smatrix &L)
int chol (XCONST dvar_hs_smatrix &AA, XCONST hs_symbolic &T, dvar_hs_smatrix &LL)
int cholnew (XCONST hs_smatrix &A, XCONST hs_symbolic &S, hs_smatrix &L)
hs_smatrix cs_add (XCONST hs_smatrix &AA, XCONST hs_smatrix &BB, double alpha, double beta)
dvar_hs_smatrix cs_add (XCONST dvar_hs_smatrix &AA, XCONST dvar_hs_smatrix &BB, double alpha, double beta)
ivector cs_amd (XCONST hs_smatrix &A)
ivector cs_amd (XCONST dvar_hs_smatrix &A)
ivector cs_counts (XCONST hs_smatrix &A, XCONST ivector &parent, XCONST ivector &post)
ivector cs_counts (XCONST dvar_hs_smatrix &A, XCONST ivector &parent, XCONST ivector &post)
double cs_cumsum (ivector &p, ivector &c, int n)
int cs_diag (int i, int j, double aij, void *other)
int cs_diag (int i, int j, const prevariable &aij, void *other)
int cs_ereach (XCONST hs_smatrix &_A, int k, XCONST ivector &parent, ivector &s, ivector &w)
int cs_ereach (XCONST dvar_hs_smatrix &_A, int k, XCONST ivector &parent, ivector &s, ivector &w)
ivector cs_etree (XCONST hs_smatrix &_A)
ivector cs_etree (XCONST dvar_hs_smatrix &_A)
int cs_fkeep (hs_smatrix &A, int(*fkeep)(int, int, double, void *), void *other)
int cs_fkeep (dvar_hs_smatrix &A, int(*fkeep)(int, int, const prevariable &, void *), void *other)
dvector cs_ipvec (XCONST ivector &p, XCONST dvector &b)
int cs_leaf (int i, int j, XCONST ivector &first, ivector &maxfirst, ivector &prevleaf, ivector &ancestor, int *jleaf)
dvector cs_lsolve (XCONST hs_smatrix &LL, XCONST dvector &y)
dvar_vector cs_lsolve (XCONST dvar_hs_smatrix &LL, XCONST dvar_vector &y)
dvar_vector cs_lsolve (XCONST dvar_hs_smatrix &LL, XCONST dvector &y)
dvector cs_ltsolve (XCONST hs_smatrix &LL, XCONST dvector &y)
dvar_vector cs_ltsolve (XCONST dvar_hs_smatrix &LL, XCONST dvar_vector &y)
hs_smatrix cs_multiply (const hs_smatrix &A, const hs_smatrix &B)
ivector cs_pinv (XCONST ivector &p, int n)
ivector cs_post (XCONST ivector &parent, int n)
dvector cs_pvec (XCONST ivector &p, XCONST dvector &b)
dvar_vector cs_pvec (XCONST ivector &p, XCONST dvar_vector &b)
int cs_scatter (XCONST hs_smatrix &AA, int j, double beta, ivector &w, dvector &x, int mark, hs_smatrix &C, int nz)
int cs_scatter (XCONST dvar_hs_smatrix &AA, int j, double beta, ivector &w, dvar_vector &x, int mark, dvar_hs_smatrix &C, int nz)
int cs_tdfs (int j, int k, ivector &head, XCONST ivector &next, ivector &post, ivector &stack)
void cs_transpose (XCONST hs_smatrix &_A, int values, hs_smatrix &C)
void cs_transpose (XCONST dvar_hs_smatrix &_A, int values, dvar_hs_smatrix &C)
int cs_wclear (int mark, int lemax, ivector &w, int n)
static void dfcholeski_sparse (void)
void get_inverse_sparse_hessian (dcompressed_triplet &st, hs_symbolic &S, uostream &ofs1, ofstream &ofs, int usize, int xsize, dvector &u)
void hs_symperm (XCONST hs_smatrix &_A, XCONST ivector &pinv, hs_smatrix &C)
void hs_symperm (XCONST dvar_hs_smatrix &_A, XCONST ivector &pinv, dvar_hs_smatrix &C)
dvariable ln_det (XCONST dvar_hs_smatrix &M)
dvariable ln_det (XCONST dvar_hs_smatrix &_M, int &sgn)
double ln_det (XCONST hs_smatrix &_M)
double ln_det (XCONST hs_smatrix &_M, int &sgn)
dvariable ln_det (dvar_compressed_triplet &VM)
dvariable ln_det (dvar_compressed_triplet &VM, hs_symbolic &S)
dvariable ln_det (dvar_compressed_triplet &VM, hs_symbolic &S, dcompressed_triplet &s)
double ln_det (const dcompressed_triplet &VVM, const hs_symbolic &T)
double ln_det (const dcompressed_triplet &VVM)
dcompressed_triplet make_dcompressed_triplet (const dmatrix &M)
dmatrix make_dmatrix (dcompressed_triplet &M, int n, int m)
dmatrix make_dmatrix (dcompressed_triplet &M)
dmatrix make_dmatrix (const hs_smatrix &M)
dvar_matrix make_dvar_matrix (dvar_compressed_triplet &M)
dvar_matrix make_dvar_matrix (dvar_compressed_triplet &M, int n, int m)
hs_smatrix make_hs_smatrix (const dmatrix &M)
dmatrix make_sdmatrix (dcompressed_triplet &M)
dvar_matrix make_sdvar_matrix (dvar_compressed_triplet &M)
void myacc (int &p, int Lpi1, int ci, const ivector &Li, dvector &x, const dvector &Lx, const double &lki)
hs_smatrix operator* (const hs_smatrix &A, const hs_smatrix &B)
ostream & operator<< (const ostream &_ofs, const hs_smatrix &M)
istream & operator>> (istream &is, dcompressed_triplet &M)
istream & operator>> (istream &is, dvar_compressed_triplet &M)
void report_derivatives (const dvar_vector &x)
void report_dvar_vector_derivatives (void)
hs_smatrix * return_choleski_decomp (dcompressed_triplet &st)
dvar_hs_smatrix * return_choleski_decomp (dvar_compressed_triplet &st)
dvector return_choleski_decomp_solve (dcompressed_triplet &st, dvector &eps)
dvector return_choleski_factor_solve (hs_smatrix *PL, dvector &eps)
dvar_vector return_choleski_factor_solve (dvar_hs_smatrix *PL, dvector &eps)
dvector solve (dcompressed_triplet &st, dmatrix &Hess, dvector &grad)
dvector solve (dcompressed_triplet &st, dmatrix &Hess, dvector &grad, hs_symbolic &S)
dvector solve (const dcompressed_triplet &_st, const dvector &_grad, const hs_symbolic &S)
dvector solve (const dcompressed_triplet &_st, const dvector &_grad, const hs_symbolic &S, int &ierr)
int tmpxchol (XCONST hs_smatrix &A, XCONST hs_symbolic &S, hs_smatrix &L, ivector &xcount)
int tmpxchol1 (XCONST hs_smatrix &A, XCONST hs_symbolic &T, hs_smatrix &L, ivector &nxcount)
int varchol (XCONST dvar_hs_smatrix &A, XCONST hs_symbolic &S, dvar_hs_smatrix &L, dcompressed_triplet &sparse_triplet2)
static void xxx (int i)
static void xxx (ivector &i)
static void xxxv (ivector &x)

Variables

int check_flag = 0

Define Documentation

Definition at line 21 of file hs_sparse.cpp.

#define XCONST   const

Definition at line 17 of file hs_sparse.cpp.


Function Documentation

int allocated ( const dcompressed_triplet _st)

Definition at line 2848 of file hs_sparse.cpp.

int allocated ( const dvar_compressed_triplet _st)

Definition at line 2853 of file hs_sparse.cpp.

int chol ( XCONST hs_smatrix &  A,
XCONST hs_symbolic T,
hs_smatrix &  L 
)
int chol ( XCONST dvar_hs_smatrix &  AA,
XCONST hs_symbolic T,
dvar_hs_smatrix &  LL 
)

Definition at line 3421 of file hs_sparse.cpp.

int cholnew ( XCONST hs_smatrix &  A,
XCONST hs_symbolic S,
hs_smatrix &  L 
)

Definition at line 2965 of file hs_sparse.cpp.

hs_smatrix cs_add ( XCONST hs_smatrix &  AA,
XCONST hs_smatrix &  BB,
double  alpha,
double  beta 
)

Definition at line 1404 of file hs_sparse.cpp.

Referenced by cs_amd().

dvar_hs_smatrix cs_add ( XCONST dvar_hs_smatrix &  AA,
XCONST dvar_hs_smatrix &  BB,
double  alpha,
double  beta 
)

Definition at line 1449 of file hs_sparse.cpp.

ivector cs_amd ( XCONST hs_smatrix &  A)

Definition at line 1519 of file hs_sparse.cpp.

ivector cs_amd ( XCONST dvar_hs_smatrix &  A)

Definition at line 1852 of file hs_sparse.cpp.

ivector cs_counts ( XCONST hs_smatrix &  A,
XCONST ivector parent,
XCONST ivector post 
)

Definition at line 2301 of file hs_sparse.cpp.

ivector cs_counts ( XCONST dvar_hs_smatrix &  A,
XCONST ivector parent,
XCONST ivector post 
)

Definition at line 2357 of file hs_sparse.cpp.

double cs_cumsum ( ivector p,
ivector c,
int  n 
)

Definition at line 59 of file hs_sparse.cpp.

Referenced by cs_transpose(), and hs_symperm().

int cs_diag ( int  i,
int  j,
double  aij,
void *  other 
)

Definition at line 1273 of file hs_sparse.cpp.

Referenced by cs_amd().

int cs_diag ( int  i,
int  j,
const prevariable aij,
void *  other 
)

Definition at line 1274 of file hs_sparse.cpp.

int cs_ereach ( XCONST hs_smatrix &  _A,
int  k,
XCONST ivector parent,
ivector s,
ivector w 
)

Definition at line 744 of file hs_sparse.cpp.

Referenced by chol(), cholnew(), dfcholeski_sparse(), tmpxchol1(), and varchol().

int cs_ereach ( XCONST dvar_hs_smatrix &  _A,
int  k,
XCONST ivector parent,
ivector s,
ivector w 
)

Definition at line 773 of file hs_sparse.cpp.

ivector cs_etree ( XCONST hs_smatrix &  _A)

Definition at line 2186 of file hs_sparse.cpp.

ivector cs_etree ( XCONST dvar_hs_smatrix &  _A)

Definition at line 2218 of file hs_sparse.cpp.

int cs_fkeep ( hs_smatrix &  A,
int(*)(int, int, double, void *)  fkeep,
void *  other 
)

Definition at line 1278 of file hs_sparse.cpp.

Referenced by cs_amd().

int cs_fkeep ( dvar_hs_smatrix &  A,
int(*)(int, int, const prevariable &, void *)  fkeep,
void *  other 
)

Definition at line 1305 of file hs_sparse.cpp.

int cs_leaf ( int  i,
int  j,
XCONST ivector first,
ivector maxfirst,
ivector prevleaf,
ivector ancestor,
int *  jleaf 
)

Definition at line 2280 of file hs_sparse.cpp.

Referenced by cs_counts().

dvector cs_lsolve ( XCONST hs_smatrix &  LL,
XCONST dvector y 
)
dvar_vector cs_lsolve ( XCONST dvar_hs_smatrix &  LL,
XCONST dvar_vector y 
)

Definition at line 1173 of file hs_sparse.cpp.

dvar_vector cs_lsolve ( XCONST dvar_hs_smatrix &  LL,
XCONST dvector y 
)

Definition at line 1198 of file hs_sparse.cpp.

dvector cs_ltsolve ( XCONST hs_smatrix &  LL,
XCONST dvector y 
)

Definition at line 1224 of file hs_sparse.cpp.

Referenced by get_inverse_sparse_hessian(), and solve().

dvar_vector cs_ltsolve ( XCONST dvar_hs_smatrix &  LL,
XCONST dvar_vector y 
)

Definition at line 1248 of file hs_sparse.cpp.

hs_smatrix cs_multiply ( const hs_smatrix &  A,
const hs_smatrix &  B 
)

Definition at line 3588 of file hs_sparse.cpp.

Referenced by operator*().

ivector cs_pinv ( XCONST ivector p,
int  n 
)

Definition at line 2414 of file hs_sparse.cpp.

ivector cs_post ( XCONST ivector parent,
int  n 
)

Definition at line 2251 of file hs_sparse.cpp.

Definition at line 1133 of file hs_sparse.cpp.

int cs_scatter ( XCONST hs_smatrix &  AA,
int  j,
double  beta,
ivector w,
dvector x,
int  mark,
hs_smatrix &  C,
int  nz 
)

Definition at line 1333 of file hs_sparse.cpp.

Referenced by cs_add(), and cs_multiply().

int cs_scatter ( XCONST dvar_hs_smatrix &  AA,
int  j,
double  beta,
ivector w,
dvar_vector x,
int  mark,
dvar_hs_smatrix &  C,
int  nz 
)

Definition at line 1379 of file hs_sparse.cpp.

int cs_tdfs ( int  j,
int  k,
ivector head,
XCONST ivector next,
ivector post,
ivector stack 
)

Definition at line 1495 of file hs_sparse.cpp.

Referenced by cs_amd(), and cs_post().

void cs_transpose ( XCONST hs_smatrix &  _A,
int  values,
hs_smatrix &  C 
)

Definition at line 87 of file hs_sparse.cpp.

Referenced by cs_amd(), and cs_counts().

void cs_transpose ( XCONST dvar_hs_smatrix &  _A,
int  values,
dvar_hs_smatrix &  C 
)

Definition at line 119 of file hs_sparse.cpp.

int cs_wclear ( int  mark,
int  lemax,
ivector w,
int  n 
)

Definition at line 75 of file hs_sparse.cpp.

Referenced by cs_amd().

static void dfcholeski_sparse ( void  ) [static]

Definition at line 3163 of file hs_sparse.cpp.

Referenced by varchol().

void get_inverse_sparse_hessian ( dcompressed_triplet st,
hs_symbolic S,
uostream ofs1,
ofstream &  ofs,
int  usize,
int  xsize,
dvector u 
)
void hs_symperm ( XCONST hs_smatrix &  _A,
XCONST ivector pinv,
hs_smatrix &  C 
)

Definition at line 803 of file hs_sparse.cpp.

Referenced by chol(), cholnew(), dfcholeski_sparse(), tmpxchol1(), and varchol().

void hs_symperm ( XCONST dvar_hs_smatrix &  _A,
XCONST ivector pinv,
dvar_hs_smatrix &  C 
)

Definition at line 845 of file hs_sparse.cpp.

dvariable ln_det ( XCONST dvar_hs_smatrix &  M)

Definition at line 666 of file hs_sparse.cpp.

dvariable ln_det ( XCONST dvar_hs_smatrix &  _M,
int &  sgn 
)

Definition at line 673 of file hs_sparse.cpp.

double ln_det ( XCONST hs_smatrix &  _M)

Definition at line 679 of file hs_sparse.cpp.

double ln_det ( XCONST hs_smatrix &  _M,
int &  sgn 
)

Definition at line 685 of file hs_sparse.cpp.

Definition at line 2858 of file hs_sparse.cpp.

Definition at line 2875 of file hs_sparse.cpp.

Definition at line 2894 of file hs_sparse.cpp.

double ln_det ( const dcompressed_triplet VVM,
const hs_symbolic T 
)

Definition at line 2924 of file hs_sparse.cpp.

double ln_det ( const dcompressed_triplet VVM)

Definition at line 2946 of file hs_sparse.cpp.

Definition at line 3640 of file hs_sparse.cpp.

Referenced by make_hs_smatrix().

dmatrix make_dmatrix ( dcompressed_triplet M,
int  n,
int  m 
)

Definition at line 153 of file hs_sparse.cpp.

dmatrix make_dmatrix ( const hs_smatrix &  M)

Definition at line 3704 of file hs_sparse.cpp.

Definition at line 187 of file hs_sparse.cpp.

dvar_matrix make_dvar_matrix ( dvar_compressed_triplet M,
int  n,
int  m 
)

Definition at line 234 of file hs_sparse.cpp.

hs_smatrix make_hs_smatrix ( const dmatrix M)

Definition at line 3688 of file hs_sparse.cpp.

Definition at line 216 of file hs_sparse.cpp.

Definition at line 169 of file hs_sparse.cpp.

void myacc ( int &  p,
int  Lpi1,
int  ci,
const ivector Li,
dvector x,
const dvector Lx,
const double &  lki 
)

Definition at line 889 of file hs_sparse.cpp.

Referenced by cholnew().

hs_smatrix operator* ( const hs_smatrix &  A,
const hs_smatrix &  B 
)

Definition at line 3636 of file hs_sparse.cpp.

ostream& operator<< ( const ostream &  _ofs,
const hs_smatrix &  M 
)

Definition at line 3693 of file hs_sparse.cpp.

istream& operator>> ( istream &  is,
dcompressed_triplet M 
)

Definition at line 2603 of file hs_sparse.cpp.

istream& operator>> ( istream &  is,
dvar_compressed_triplet M 
)

Definition at line 2616 of file hs_sparse.cpp.

void report_derivatives ( const dvar_vector x)

Definition at line 3550 of file hs_sparse.cpp.

Definition at line 3541 of file hs_sparse.cpp.

Referenced by report_derivatives().

Definition at line 2629 of file hs_sparse.cpp.

Referenced by calculate_importance_sample_shess().

dvar_hs_smatrix* return_choleski_decomp ( dvar_compressed_triplet st)

Definition at line 2646 of file hs_sparse.cpp.

Definition at line 2663 of file hs_sparse.cpp.

dvector return_choleski_factor_solve ( hs_smatrix *  PL,
dvector eps 
)

Definition at line 2686 of file hs_sparse.cpp.

Referenced by calculate_importance_sample_shess().

dvar_vector return_choleski_factor_solve ( dvar_hs_smatrix *  PL,
dvector eps 
)

Definition at line 2703 of file hs_sparse.cpp.

dvector solve ( dcompressed_triplet st,
dmatrix Hess,
dvector grad 
)

Definition at line 2721 of file hs_sparse.cpp.

dvector solve ( dcompressed_triplet st,
dmatrix Hess,
dvector grad,
hs_symbolic S 
)

Definition at line 2751 of file hs_sparse.cpp.

dvector solve ( const dcompressed_triplet _st,
const dvector _grad,
const hs_symbolic S 
)

Definition at line 2786 of file hs_sparse.cpp.

dvector solve ( const dcompressed_triplet _st,
const dvector _grad,
const hs_symbolic S,
int &  ierr 
)

Definition at line 2813 of file hs_sparse.cpp.

int tmpxchol ( XCONST hs_smatrix &  A,
XCONST hs_symbolic S,
hs_smatrix &  L,
ivector xcount 
)
int tmpxchol1 ( XCONST hs_smatrix &  A,
XCONST hs_symbolic T,
hs_smatrix &  L,
ivector nxcount 
)

Definition at line 976 of file hs_sparse.cpp.

int varchol ( XCONST dvar_hs_smatrix &  A,
XCONST hs_symbolic S,
dvar_hs_smatrix &  L,
dcompressed_triplet sparse_triplet2 
)

Definition at line 3053 of file hs_sparse.cpp.

Referenced by ln_det().

static void xxx ( int  i) [static]

Definition at line 24 of file hs_sparse.cpp.

static void xxx ( ivector i) [static]

Definition at line 25 of file hs_sparse.cpp.

static void xxxv ( ivector x) [static]

Definition at line 26 of file hs_sparse.cpp.

Referenced by tmpxchol1().


Variable Documentation

int check_flag = 0

Definition at line 2892 of file hs_sparse.cpp.