示例#1
0
CAMLprim value ml_gsl_linalg_PTLQ_svx_T (value QR, value TAU, value P, value X)
{
  _DECLARE_MATRIX(QR);
  _DECLARE_VECTOR2(TAU,X);
  GSL_PERMUT_OF_BIGARRAY(P);
  _CONVERT_MATRIX(QR);
  _CONVERT_VECTOR2(TAU,X);
  gsl_linalg_PTLQ_svx_T (&m_QR, &v_TAU, &perm_P, &v_X);
  return Val_unit;
}
示例#2
0
CAMLprim value ml_gsl_linalg_PTLQ_Lsvx_T (value LQ, value P, value X)
{
  _DECLARE_MATRIX(LQ);
  _DECLARE_VECTOR(X);
  GSL_PERMUT_OF_BIGARRAY(P);
  _CONVERT_MATRIX(LQ);
  _CONVERT_VECTOR(X);
  gsl_linalg_PTLQ_Lsvx_T (&m_LQ, &perm_P, &v_X);
  return Val_unit;
}
示例#3
0
CAMLprim value ml_gsl_linalg_LU_svx(value LU, value P, value X)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX(LU);
  _DECLARE_VECTOR(X);
  _CONVERT_MATRIX(LU);
  _CONVERT_VECTOR(X);
  gsl_linalg_LU_svx(&m_LU, &perm_P, &v_X);
  return Val_unit;
}
示例#4
0
CAMLprim value ml_gsl_linalg_QRPT_Rsvx(value QR, value P, value X)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX(QR);
  _DECLARE_VECTOR(X);
  _CONVERT_MATRIX(QR);
  _CONVERT_VECTOR(X);
  gsl_linalg_QRPT_Rsvx(&m_QR, &perm_P, &v_X);
  return Val_unit;
}
示例#5
0
CAMLprim value ml_gsl_linalg_QR_lssolve(value QR, value TAU, value B, value X, 
			       value RES)
{
  _DECLARE_MATRIX(QR);
  _DECLARE_VECTOR4(TAU, RES, B, X);
  _CONVERT_MATRIX(QR);
  _CONVERT_VECTOR4(TAU, RES, B, X);
  gsl_linalg_QR_lssolve(&m_QR, &v_TAU, &v_B, &v_X, &v_RES);
  return Val_unit;
}
示例#6
0
CAMLprim value ml_gsl_blas_ssymv(value uplo, value alpha, value A,
                                 value X, value beta, value Y)
{
    _DECLARE_MATRIX(A);
    _DECLARE_VECTOR2(X, Y);
    _CONVERT_MATRIX(A);
    _CONVERT_VECTOR2(X, Y);
    gsl_blas_ssymv(CBLAS_UPLO_val(uplo), Double_val(alpha),
                   &m_A, &v_X, Double_val(beta), &v_Y);
    return Val_unit;
}
示例#7
0
CAMLprim value ml_gsl_blas_strsv(value uplo, value transa, value diag,
                                 value A, value X)
{
    _DECLARE_MATRIX(A);
    _DECLARE_VECTOR(X);
    _CONVERT_MATRIX(A);
    _CONVERT_VECTOR(X);
    gsl_blas_strsv(CBLAS_UPLO_val(uplo), CBLAS_TRANS_val(transa),
                   CBLAS_DIAG_val(diag), &m_A, &v_X);
    return Val_unit;
}
示例#8
0
CAMLprim value ml_gsl_blas_sgemv(value transa, value alpha, value A,
                                 value X, value beta, value Y)
{
    _DECLARE_MATRIX(A);
    _DECLARE_VECTOR2(X, Y);
    _CONVERT_MATRIX(A);
    _CONVERT_VECTOR2(X, Y);
    gsl_blas_sgemv(CBLAS_TRANS_val(transa), Double_val(alpha),
                   &m_A, &v_X, Double_val(beta), &v_Y);
    return Val_unit;
}
示例#9
0
/* P^T L Q decomposition */
CAMLprim value ml_gsl_linalg_PTLQ_decomp (value A, value TAU, value P, value NORM)
{
  int signum;
  _DECLARE_MATRIX(A);
  _DECLARE_VECTOR2(TAU,NORM);
  GSL_PERMUT_OF_BIGARRAY(P);
  _CONVERT_MATRIX(A);
  _CONVERT_VECTOR2(TAU,NORM);
  gsl_linalg_PTLQ_decomp (&m_A, &v_TAU, &perm_P, &signum, &v_NORM);
  return Val_int (signum);
}
示例#10
0
CAMLprim value ml_gsl_linalg_LQ_lssolve_T(value LQ, value TAU, 
					  value B, value X, 
					  value RES)
{
  _DECLARE_MATRIX(LQ);
  _DECLARE_VECTOR4(TAU, RES, B, X);
  _CONVERT_MATRIX(LQ);
  _CONVERT_VECTOR4(TAU, RES, B, X);
  gsl_linalg_LQ_lssolve_T(&m_LQ, &v_TAU, &v_B, &v_X, &v_RES);
  return Val_unit;
}
示例#11
0
CAMLprim value ml_gsl_linalg_QRPT_solve(value QR, value TAU, value P, 
					value B, value X)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX(QR);
  _DECLARE_VECTOR3(TAU, B, X);
  _CONVERT_MATRIX(QR);
  _CONVERT_VECTOR3(TAU, B, X);
  gsl_linalg_QRPT_solve(&m_QR, &v_TAU, &perm_P, &v_B, &v_X);
  return Val_unit;
}
示例#12
0
/* 2D transforms */
CAMLprim value
ml_gsl_wavelet2d_transform_matrix (value w, value ordering,
				   value dir, value a, value ws)
{
  _DECLARE_MATRIX(a);
  _CONVERT_MATRIX(a);
  if (Int_val (ordering) == 0)
    gsl_wavelet2d_transform_matrix (Wavelet_val (w), &m_a,
				    gsl_direction_val (dir), WS_val (ws));
  else
    gsl_wavelet2d_nstransform_matrix (Wavelet_val (w), &m_a,
				      gsl_direction_val (dir), WS_val (ws));
  return Val_unit;
}
示例#13
0
CAMLprim value ml_gsl_linalg_LU_lndet(value LU)
{
  _DECLARE_MATRIX(LU);
  _CONVERT_MATRIX(LU);
  return copy_double(gsl_linalg_LU_lndet(&m_LU));
}
示例#14
0
CAMLprim value ml_gsl_linalg_LU_det(value LU, value sig)
{
  _DECLARE_MATRIX(LU);
  _CONVERT_MATRIX(LU);
  return copy_double(gsl_linalg_LU_det(&m_LU, Int_val(sig)));
}
示例#15
0
CAMLprim value ml_gsl_linalg_LU_sgndet(value LU, value sig)
{
  _DECLARE_MATRIX(LU);
  _CONVERT_MATRIX(LU);
  return Val_int(gsl_linalg_LU_sgndet(&m_LU, Int_val(sig)));
}