Changeset be138d0 in tol


Ignore:
Timestamp:
May 24, 2010, 1:59:23 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
86ae138
Parents:
ef24521
Message:

New function CholeskiMinimumResidualsSolve

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2188 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/bmath/blinalg
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/bmath/blinalg/linalg.cpp

    ref24521 rbe138d0  
    292292}
    293293
     294//--------------------------------------------------------------------
     295BMatrix<double> CholeskiMinimumResidualsSolve(
     296  const BMatrix<double>& A,
     297  const BMatrix<double>& b)
     298
     299/*! Solves Ax=b using Cholesky decomposition
     300 */
     301//--------------------------------------------------------------------
     302{
     303  BMatrix<double> x;
     304  BVMat A_, b_, x_;
     305  A_.DMat2VMat(A, false,0.50,DEpsilon());
     306  b_.DMat2dense(b);
     307  if(!BVMat::CholeskiMinRes(A_,b_,x_))
     308  {
     309    x_.GetDMat(x);
     310  }
     311  return(x);
     312}
     313
     314//--------------------------------------------------------------------
     315BMat CholeskiMinimumResidualsSolve(const BMat& A, const BMat& b)
     316
     317/*! Solves Ax=b using Cholesky decomposition
     318 */
     319//--------------------------------------------------------------------
     320{
     321  BMat x;
     322  BMatrix<double>& dA = (BMatrix<double>&)A;
     323  BMatrix<double>& db = (BMatrix<double>&)b;
     324  BMatrix<double>& dx = (BMatrix<double>&)x;
     325  dx = CholeskiMinimumResidualsSolve(dA,db);
     326  return(x);
     327}
    294328
    295329//--------------------------------------------------------------------
    … …  
    379413    BMat A = B << Urc.T();
    380414    BMat z(n-r,1); z.SetAllValuesTo(0);
    381     BMat v = MinimumResidualsSolve(A, y) ;
     415    BMat v = gsl_MinimumResidualsSolve(A, y) ;
    382416   
    383417    for(j=0; j<c; j++)
  • tol/bmath/blinalg/tol_blinalg.h

    ref24521 rbe138d0  
    6161  int maxIter = -1
    6262);
     63
     64BMatrix<double> CholeskiMinimumResidualsSolve(
     65  const BMatrix<double>& A,
     66  const BMatrix<double>& b);
     67BMat CholeskiMinimumResidualsSolve(
     68  const BMat& A,
     69  const BMat& b);
     70
    6371
    6472BDat LinearLeastSquareSolve
Note: See TracChangeset for help on using the changeset viewer.