version 1.5, 2015/04/01 06:10:34 |
version 1.6, 2022/04/06 01:03:42 |
|
|
/*$OpenXM: OpenXM/src/hgm/orthant/src/hgm_ko_orthant.c,v 1.4 2015/03/24 06:10:33 takayama Exp $*/ |
/*$OpenXM: OpenXM/src/hgm/orthant/src/hgm_ko_orthant.c,v 1.5 2015/04/01 06:10:34 takayama Exp $*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <math.h> |
#include <math.h> |
|
|
#ifndef _STANDALONE |
#ifndef _STANDALONE |
#include <R_ext/BLAS.h> |
#include <R_ext/BLAS.h> |
#include <R_ext/Lapack.h> |
#include <R_ext/Lapack.h> |
|
#ifndef FCONE |
|
#define FCONE |
#endif |
#endif |
|
|
void hgm_ko_orthant(int *, double *, double *, double *retv); |
void hgm_ko_orthant(int *, double *, double *, double *retv); |
Line 162 sigma_mu2xy(double *sigma, double *mu, double *x, doub |
|
Line 164 sigma_mu2xy(double *sigma, double *mu, double *x, doub |
|
alpha = -0.5; |
alpha = -0.5; |
dscal_(&dimdim, &alpha, x, &one); |
dscal_(&dimdim, &alpha, x, &one); |
#else |
#else |
|
#endif |
F77_CALL(dcopy)(&dimdim, sigma, &one, x, &one); |
F77_CALL(dcopy)(&dimdim, sigma, &one, x, &one); |
F77_CALL(dpotrf)("U", &dim, x, &dim, &info); |
F77_CALL(dpotrf)("U", &dim, x, &dim, &info FCONE); |
F77_CALL(dpotri)("U", &dim, x, &dim, &info); |
F77_CALL(dpotri)("U", &dim, x, &dim, &info FCONE); |
F77_CALL(dsymv)("U", &dim, &alpha, x, &dim, mu, &one, &beta, y, &one); |
F77_CALL(dsymv)("U", &dim, &alpha, x, &dim, mu, &one, &beta, y, &one FCONE); |
alpha = -0.5; |
alpha = -0.5; |
F77_CALL(dscal)(&dimdim, &alpha, x, &one); |
F77_CALL(dscal)(&dimdim, &alpha, x, &one); |
#endif |
#endif |
Line 386 cal_sigmaI_muI(const int I) |
|
Line 389 cal_sigmaI_muI(const int I) |
|
#ifdef _STANDALONE |
#ifdef _STANDALONE |
dpotrf_("U", &n, g_submat, &m, &info); |
dpotrf_("U", &n, g_submat, &m, &info); |
#else |
#else |
F77_CALL(dpotrf)("U", &n, g_submat, &m, &info); |
F77_CALL(dpotrf)("U", &n, g_submat, &m, &info FCONE); |
#endif |
#endif |
//oxprintfe( "info=%d\n", info); |
//oxprintfe( "info=%d\n", info); |
n = m = deg_I; |
n = m = deg_I; |
#ifdef _STANDALONE |
#ifdef _STANDALONE |
dpotri_("U", &n, g_submat, &m, &info); |
dpotri_("U", &n, g_submat, &m, &info); |
#else |
#else |
F77_CALL(dpotri)("U", &n, g_submat, &m, &info); |
F77_CALL(dpotri)("U", &n, g_submat, &m, &info FCONE); |
#endif |
#endif |
//oxprintfe( "info=%d\n", info); |
//oxprintfe( "info=%d\n", info); |
for ( i = 0; i < deg_I; i++) |
for ( i = 0; i < deg_I; i++) |
Line 462 cal_det_sigmaI(const int I, const int deg_I) |
|
Line 465 cal_det_sigmaI(const int I, const int deg_I) |
|
#ifdef _STANDALONE |
#ifdef _STANDALONE |
dpotrf_("U", &n, g_submat, &m, &info); |
dpotrf_("U", &n, g_submat, &m, &info); |
#else |
#else |
F77_CALL(dpotrf)("U", &n, g_submat, &m, &info); |
F77_CALL(dpotrf)("U", &n, g_submat, &m, &info FCONE); |
#endif |
#endif |
//oxprintfe( "info=%d\n", info); |
//oxprintfe( "info=%d\n", info); |
for ( i = 0; i < deg_I; i++) |
for ( i = 0; i < deg_I; i++) |