Пример #1
0
CAMLprim value ml_gsl_linalg_LU_invert(value LU, value P, value INV)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX2(LU, INV);
  _CONVERT_MATRIX2(LU, INV);
  gsl_linalg_LU_invert(&m_LU, &perm_P, &m_INV);
  return Val_unit;
}
Пример #2
0
CAMLprim value ml_gsl_linalg_QR_update(value Q, value R, value W, value V)
{
  _DECLARE_MATRIX2(Q, R);
  _DECLARE_VECTOR2(W, V);
  _CONVERT_MATRIX2(Q, R);
  _CONVERT_VECTOR2(W, V);
  gsl_linalg_QR_update(&m_Q, &m_R, &v_W, &v_V);
  return Val_unit;
}
Пример #3
0
CAMLprim value ml_gsl_linalg_LQ_LQsolve(value Q, value L, value B, value X)
{
  _DECLARE_MATRIX2(Q,L);
  _DECLARE_VECTOR2(B,X);
  _CONVERT_MATRIX2(Q,L);
  _CONVERT_VECTOR2(B,X);
  gsl_linalg_LQ_LQsolve(&m_Q, &m_L, &v_B, &v_X);
  return Val_unit;
}
Пример #4
0
CAMLprim value ml_gsl_linalg_LQ_update(value LQ, value R, value V, value W)
{
  _DECLARE_MATRIX2(LQ,R);
  _DECLARE_VECTOR2(V,W);
  _CONVERT_MATRIX2(LQ,R);
  _CONVERT_VECTOR2(V,W);
  gsl_linalg_LQ_update(&m_LQ, &m_R, &v_V, &v_W);
  return Val_unit;
}
Пример #5
0
CAMLprim value ml_gsl_linalg_SV_solve(value U, value V, value S, value B, value X)
{
  _DECLARE_MATRIX2(U, V);
  _DECLARE_VECTOR3(S, B, X);
  _CONVERT_MATRIX2(U, V);
  _CONVERT_VECTOR3(S, B, X);
  gsl_linalg_SV_solve(&m_U, &m_V, &v_S, &v_B, &v_X);
  return Val_unit;
}
Пример #6
0
CAMLprim value ml_gsl_linalg_SV_decomp_jacobi(value A, value V, value S)
{
  _DECLARE_MATRIX2(A, V);
  _DECLARE_VECTOR(S);
  _CONVERT_MATRIX2(A, V);
  _CONVERT_VECTOR(S);
  gsl_linalg_SV_decomp_jacobi(&m_A, &m_V, &v_S);
  return Val_unit;
}
Пример #7
0
/* Singular Value Decomposition */
CAMLprim value ml_gsl_linalg_SV_decomp(value A, value V, value S, value WORK)
{
  _DECLARE_MATRIX2(A, V);
  _DECLARE_VECTOR2(S, WORK);
  _CONVERT_MATRIX2(A, V);
  _CONVERT_VECTOR2(S, WORK);
  gsl_linalg_SV_decomp(&m_A, &m_V, &v_S, &v_WORK);
  return Val_unit;
}
Пример #8
0
CAMLprim value ml_gsl_linalg_bidiag_unpack2(value A, value TAU_U, value TAU_V, value V)
{
  _DECLARE_MATRIX2(A, V);
  _DECLARE_VECTOR2(TAU_U, TAU_V);
  _CONVERT_MATRIX2(A, V);
  _CONVERT_VECTOR2(TAU_U, TAU_V);
  gsl_linalg_bidiag_unpack2(&m_A, &v_TAU_U, &v_TAU_V, &m_V);
  return Val_unit;
}
Пример #9
0
CAMLprim value ml_gsl_linalg_QR_QRsolve(value Q, value R, value B, value X)
{
  _DECLARE_MATRIX2(Q, R);
  _DECLARE_VECTOR2(B, X);
  _CONVERT_MATRIX2(Q, R);
  _CONVERT_VECTOR2(B, X);
  gsl_linalg_QR_QRsolve(&m_Q, &m_R, &v_B, &v_X);
  return Val_unit;
}
Пример #10
0
CAMLprim value ml_gsl_linalg_PTLQ_update (value Q, value L, value P, value V, value W)
{
  _DECLARE_MATRIX2(Q,L);
  _DECLARE_VECTOR2(V,W);
  GSL_PERMUT_OF_BIGARRAY(P);
  _CONVERT_MATRIX2(Q,L);
  _CONVERT_VECTOR2(V,W);
  gsl_linalg_PTLQ_update (&m_Q, &m_L, &perm_P, &v_V, &v_W);
  return Val_unit;
}
Пример #11
0
CAMLprim value ml_gsl_linalg_PTLQ_LQsolve_T (value Q, value L, value P, value B, value X)
{
  _DECLARE_MATRIX2(Q,L);
  _DECLARE_VECTOR2(B,X);
  GSL_PERMUT_OF_BIGARRAY(P);
  _CONVERT_MATRIX2(Q,L);
  _CONVERT_VECTOR2(B,X);
  gsl_linalg_PTLQ_LQsolve_T (&m_Q, &m_L, &perm_P, &v_B, &v_X);
  return Val_unit;
}
Пример #12
0
CAMLprim value ml_gsl_blas_ssyrk(value uplo, value trans, value alpha,
                                 value A, value beta, value C)
{
    _DECLARE_MATRIX2(A, C);
    _CONVERT_MATRIX2(A, C);
    gsl_blas_ssyrk(CBLAS_UPLO_val(uplo), CBLAS_TRANS_val(trans),
                   Double_val(alpha), &m_A,
                   Double_val(beta), &m_C);
    return Val_unit;
}
Пример #13
0
CAMLprim value ml_gsl_linalg_symmtd_unpack(value A, value TAU, value Q, 
					   value DIAG, value SUBDIAG)
{
  _DECLARE_MATRIX2(A, Q);
  _DECLARE_VECTOR3(TAU, DIAG, SUBDIAG);
  _CONVERT_MATRIX2(A, Q);
  _CONVERT_VECTOR3(TAU, DIAG, SUBDIAG);
  gsl_linalg_symmtd_unpack(&m_A, &v_TAU, &m_Q, &v_DIAG, &v_SUBDIAG);
  return Val_unit;
}
Пример #14
0
CAMLprim value ml_gsl_blas_strsm(value side, value uplo,
                                 value transa, value diag,
                                 value alpha, value A, value B)
{
    _DECLARE_MATRIX2(A, B);
    _CONVERT_MATRIX2(A, B);
    gsl_blas_strsm(CBLAS_SIDE_val(side), CBLAS_UPLO_val(uplo),
                   CBLAS_TRANS_val(transa), CBLAS_DIAG_val(diag),
                   Double_val(alpha), &m_A, &m_B);
    return Val_unit;
}
Пример #15
0
CAMLprim value ml_gsl_linalg_QRPT_QRsolve(value Q, value R, value P, 
					  value B, value X)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX2(Q, R);
  _DECLARE_VECTOR2(B, X);
  _CONVERT_MATRIX2(Q, R);
  _CONVERT_VECTOR2(B, X);
  gsl_linalg_QRPT_QRsolve(&m_Q, &m_R, &perm_P, &v_B, &v_X);
  return Val_unit;
}
Пример #16
0
CAMLprim value ml_gsl_linalg_QRPT_update(value Q, value R, value P, 
				value U, value V)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX2(Q, R);
  _DECLARE_VECTOR2(U, V);
  _CONVERT_MATRIX2(Q, R);
  _CONVERT_VECTOR2(U, V);
  gsl_linalg_QRPT_update(&m_Q, &m_R, &perm_P, &v_U, &v_V);
  return Val_unit;
}
Пример #17
0
CAMLprim value ml_gsl_linalg_LU_refine(value A, value LU, value P, 
				       value B, value X, value RES)
{
  GSL_PERMUT_OF_BIGARRAY(P);
  _DECLARE_MATRIX2(A, LU);
  _DECLARE_VECTOR3(B, X, RES);
  _CONVERT_MATRIX2(A, LU);
  _CONVERT_VECTOR3(B, X, RES);
  gsl_linalg_LU_refine(&m_A, &m_LU, &perm_P, &v_B, &v_X, &v_RES);
  return Val_unit;
}
Пример #18
0
CAMLprim value ml_gsl_multifit_linear(value wo, value x, value y, 
				      value c, value cov, value ws)
{
  double chisq;
  _DECLARE_MATRIX2(x,cov);
  _DECLARE_VECTOR2(y,c);
  _CONVERT_MATRIX2(x,cov);
  _CONVERT_VECTOR2(y,c);
  if(wo == Val_none)
    gsl_multifit_linear(&m_x, &v_y, &v_c, &m_cov, 
			&chisq, MultifitWS_val(ws));
  else {
    value w=Field(wo, 0);
    _DECLARE_VECTOR(w);
    _CONVERT_VECTOR(w);
    gsl_multifit_wlinear(&m_x, &v_w, &v_y, &v_c, &m_cov, 
			 &chisq, MultifitWS_val(ws));
  }
  return copy_double(chisq);
}