Esempio n. 1
0
int
gsl_linalg_PTLQ_solve_T (const gsl_matrix * QR,
                         const gsl_vector * tau,
                         const gsl_permutation * p,
                         const gsl_vector * b,
                         gsl_vector * x)
{
  if (QR->size1 != QR->size2)
    {
      GSL_ERROR ("QR matrix must be square", GSL_ENOTSQR);
    }
  else if (QR->size2 != p->size)
    {
      GSL_ERROR ("matrix size must match permutation size", GSL_EBADLEN);
    }
  else if (QR->size2 != b->size)
    {
      GSL_ERROR ("matrix size must match b size", GSL_EBADLEN);
    }
  else if (QR->size1 != x->size)
    {
      GSL_ERROR ("matrix size must match solution size", GSL_EBADLEN);
    }
  else
    {
      gsl_vector_memcpy (x, b);

      gsl_linalg_PTLQ_svx_T (QR, tau, p, x);
      
      return GSL_SUCCESS;
    }
}
Esempio n. 2
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;
}
Esempio n. 3
0
 /**
  * C++ version of gsl_linalg_PTLQ_svx_T().
  * @param LQ A matrix
  * @param tau A vector
  * @param p A permutation
  * @param x A vector
  * @return Error code on failure
  */
 inline int PTLQ_svx_T( matrix const& LQ, vector const& tau, permutation const& p, vector& x ){
   return gsl_linalg_PTLQ_svx_T( LQ.get(), tau.get(), p.get(), x.get() ); }