Changeset 1478


Ignore:
Timestamp:
Sep 6, 2008, 8:55:46 PM (15 years ago)
Author:
Peter
Message:

reverting [1474] as original docs were correct. Clarified that SVD only works when rows>=columns for all algorithms and added an assert checking this.

Location:
trunk/yat/utility
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/SVD.cc

    r1437 r1478  
    3131#include "VectorBase.h"
    3232
     33#include <cassert>
    3334#include <sstream>
    3435
     
    5152  void SVD::decompose(SVDalgorithm algo)
    5253  {
     54    assert(U_.rows()>=U_.columns());
    5355    int status=0;
    5456    switch (algo) {
  • trunk/yat/utility/SVD.h

    r1474 r1478  
    4747     decomposition, SVD.
    4848
    49      A = U S V' = (MxM)(MxN)(NxN) = (MxN)\n   
     49     A = U S V' = (MxN)(NxN)(NxN) = (MxN)\n   
    5050
    5151     A = Matrix to be decomposed, size MxN\n
    52      U = Orthogonal matrix, size MxM\n
    53      S = Diagonal matrix of singular values, size MxN\n
     52     U = Orthogonal matrix, size MxN\n
     53     S = Diagonal matrix of singular values, size NxN\n
    5454     V = Orthogonal matrix, size NxN\n
    5555  */
     
    6060    /**
    6161       A number of SVD algorithms are implemented in GSL. They have
    62        their strengths and weaknesses, check the GSL documentation.
     62       their strengths and weaknesses.
    6363   
    64        There are restrictions on the matrix dimensions depending on
    65        which SVD algorithm is used. From the GSL's SVD source code one
    66        finds that the Golub-Reinsch algorithm implementation will not
    67        work on matrices with fewer rows than columns, the same is also
    68        true for the modified Golub-Reinsch algorithm.
    69    
    70        \see GSL's SVD documentation.
     64       \see GSL's SVD documentation.
    7165    */
    7266    enum SVDalgorithm {
     
    8074       input. The input matrix is copied for further use in the
    8175       object.
     76
     77       \note Number of rows must be equal or larger than number of columns.
    8278    */
    8379    SVD(const utility::Matrix& Ain);
Note: See TracChangeset for help on using the changeset viewer.