Changeset 50ef8f6 in tol


Ignore:
Timestamp:
Oct 2, 2012, 5:53:47 PM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
8891b0c
Parents:
a623204
Message:

Refs #1136
Adding function SvdMinimumResidualsSolve

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

Location:
tol/bmath/blinalg
Files:
2 edited

Legend:

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

    ra623204 r50ef8f6  
    328328
    329329//--------------------------------------------------------------------
     330BMat SvdMinimumResidualsSolve(const BMat& A, const BMat& b)
     331
     332/*! Solves Ax=b using SVD decomposition
     333 */
     334//--------------------------------------------------------------------
     335{
     336  BText method = BText("Golub_Reinsch_Mod");
     337  int r = A.Rows();
     338  int c = A.Columns();
     339  BMat U, V;
     340  BDiagMatrix<BDat> D, Dp;
     341  D.Alloc(c);
     342  U.Alloc(r,c);
     343  V.Alloc(c,c);
     344  gsl_SingularValueDecomposition(A,U,D,V, method);
     345  Dp = D.P(Sqrt(DEpsilon()));
     346  return(V*Dp*((b.T()*U).T()));
     347}
     348
     349//--------------------------------------------------------------------
    330350BMat Kernel(const BMat& A)
    331351
  • tol/bmath/blinalg/tol_blinalg.h

    ra623204 r50ef8f6  
    6969  const BMat& b);
    7070
     71BMat SvdMinimumResidualsSolve(const BMat& A, const BMat& b);
    7172
    7273BDat LinearLeastSquareSolve
Note: See TracChangeset for help on using the changeset viewer.