octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there anything else that should be fixed for 2.9.5 or 2.1.73?


From: David Bateman
Subject: Re: Is there anything else that should be fixed for 2.9.5 or 2.1.73?
Date: Tue, 21 Mar 2006 12:26:07 +0100
User-agent: Mozilla Thunderbird 1.0.6-7.5.20060mdk (X11/20050322)

John W. Eaton wrote:

>On 19-Mar-2006, David Bateman wrote:
>
>| 2) Add an argument to the solve code that is just there for the dmsolve 
>| function to prevent ::solve from recalling dmsolve. This is slightly 
>| ugly, but perhaps less than the above.
>
>Would this be the simplest thing to do until we can find a better
>solution?
>
>| 3) Try and rewrite the dmsolve template functions as a template class or 
>| as part of the SparseMatrix class itself. In the first case, the class  
>| can be made a friend of SparseMatrix and SpaseComplexMatrix,and the 
>| second it implicitly as access. This seems to be a relatively large 
>| change for limited gain, and I'm not sure that I can do it without code 
>| duplication, which was the reason to write the code as a template 
>| function in the first place.
>
>What are the problems with declaring the function as a friend?  Can
>you give a small example that shows what you want or what causes
>trouble?
>
>jwe
>
>  
>
Ok, then what about the attached patch..

D.


2006-03-21  David Bateman  <address@hidden>

        * dSparse.cc (solve): Add argument singular_fallback, to allow
        fallback to QR solvers to be optional.
        * CSparse.cc (solve): ditto.
        * dSparse.h (solve): update declaration for new argument.
        * CSparse.h (solve): ditto.
        * sparse-dmsolve.cc (dmsolve): Use singular_fallback argument
        to bypass QR solvers when solving the well determined part of
        the problem.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./liboctave/dSparse.cc.orig 2006-03-21 11:52:28.978090138 +0100
--- ./liboctave/dSparse.cc      2006-03-21 10:06:05.964329221 +0100
***************
*** 6884,6890 ****
  }
  
  Matrix
! SparseMatrix::solve (SparseType &mattype, const Matrix& b, octave_idx_type& 
info) const
  {
    double rcond;
    return solve (mattype, b, info, rcond, 0);
--- 6884,6891 ----
  }
  
  Matrix
! SparseMatrix::solve (SparseType &mattype, const Matrix& b, 
!                    octave_idx_type& info) const
  {
    double rcond;
    return solve (mattype, b, info, rcond, 0);
***************
*** 6899,6906 ****
  
  Matrix
  SparseMatrix::solve (SparseType &mattype, const Matrix& b, octave_idx_type& 
err, 
!                    double& rcond, 
!                    solve_singularity_handler sing_handler) const
  {
    Matrix retval;
    int typ = mattype.type (false);
--- 6900,6907 ----
  
  Matrix
  SparseMatrix::solve (SparseType &mattype, const Matrix& b, octave_idx_type& 
err, 
!                    double& rcond, solve_singularity_handler sing_handler,
!                    bool singular_fallback) const
  {
    Matrix retval;
    int typ = mattype.type (false);
***************
*** 6929,6935 ****
      }
  
    // Rectangular or one of the above solvers flags a singular matrix
!   if (mattype.type (false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6930,6936 ----
      }
  
    // Rectangular or one of the above solvers flags a singular matrix
!   if (singular_fallback && mattype.type (false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 6968,6974 ****
  SparseMatrix
  SparseMatrix::solve (SparseType &mattype, const SparseMatrix& b, 
                     octave_idx_type& err, double& rcond,
!                    solve_singularity_handler sing_handler) const
  {
    SparseMatrix retval;
    int typ = mattype.type (false);
--- 6969,6976 ----
  SparseMatrix
  SparseMatrix::solve (SparseType &mattype, const SparseMatrix& b, 
                     octave_idx_type& err, double& rcond,
!                    solve_singularity_handler sing_handler,
!                    bool singular_fallback) const
  {
    SparseMatrix retval;
    int typ = mattype.type (false);
***************
*** 6995,7001 ****
        return SparseMatrix ();
      }
  
!   if (mattype.type (false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6997,7003 ----
        return SparseMatrix ();
      }
  
!   if (singular_fallback && mattype.type (false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 7035,7041 ****
  ComplexMatrix
  SparseMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
                     octave_idx_type& err, double& rcond, 
!                    solve_singularity_handler sing_handler) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
--- 7037,7044 ----
  ComplexMatrix
  SparseMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
                     octave_idx_type& err, double& rcond, 
!                    solve_singularity_handler sing_handler,
!                    bool singular_fallback) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 7062,7068 ****
        return ComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 7065,7071 ----
        return ComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 7102,7108 ****
  SparseComplexMatrix
  SparseMatrix::solve (SparseType &mattype, const SparseComplexMatrix& b, 
                     octave_idx_type& err, double& rcond,
!                    solve_singularity_handler sing_handler) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
--- 7105,7112 ----
  SparseComplexMatrix
  SparseMatrix::solve (SparseType &mattype, const SparseComplexMatrix& b, 
                     octave_idx_type& err, double& rcond,
!                    solve_singularity_handler sing_handler,
!                    bool singular_fallback) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 7129,7135 ****
        return SparseComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 7133,7139 ----
        return SparseComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
*** ./liboctave/dSparse.h.orig  2006-03-21 11:51:30.010792972 +0100
--- ./liboctave/dSparse.h       2006-03-21 09:59:28.461990219 +0100
***************
*** 265,288 ****
    Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info) 
const;
    Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info, 
                double& rcond) const;
!   Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info, 
double& rcond,
!               solve_singularity_handler sing_handler) const;
  
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b) const;
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
                       octave_idx_type& info) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
octave_idx_type& info, 
!                      double& rcond) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
octave_idx_type& info, 
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    SparseMatrix solve (SparseType &typ, const SparseMatrix& b) const;
    SparseMatrix solve (SparseType &typ, const SparseMatrix& b, 
                      octave_idx_type& info) const;
!   SparseMatrix solve (SparseType &typ, const SparseMatrix& b, 
octave_idx_type& info, 
!                     double& rcond) const;
!   SparseMatrix solve (SparseType &typ, const SparseMatrix& b, 
octave_idx_type& info, 
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (SparseType &typ, 
                             const SparseComplexMatrix& b) const;
--- 265,293 ----
    Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info) 
const;
    Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info, 
                double& rcond) const;
!   Matrix solve (SparseType &typ, const Matrix& b, octave_idx_type& info,
!               double& rcond, solve_singularity_handler sing_handler,
!               bool singular_fallback = true) const;
  
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b) const;
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
                       octave_idx_type& info) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
!                      octave_idx_type& info, double& rcond) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b,
!                      octave_idx_type& info, double& rcond, 
!                      solve_singularity_handler sing_handler,
!                      bool singular_fallback = true) const;
  
    SparseMatrix solve (SparseType &typ, const SparseMatrix& b) const;
    SparseMatrix solve (SparseType &typ, const SparseMatrix& b, 
                      octave_idx_type& info) const;
!   SparseMatrix solve (SparseType &typ, const SparseMatrix& b,
!                     octave_idx_type& info, double& rcond) const;
!   SparseMatrix solve (SparseType &typ, const SparseMatrix& b,
!                     octave_idx_type& info, double& rcond, 
!                     solve_singularity_handler sing_handler,
!                     bool singular_fallback = true) const;
  
    SparseComplexMatrix solve (SparseType &typ, 
                             const SparseComplexMatrix& b) const;
***************
*** 290,310 ****
                             octave_idx_type& info) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
                             octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
octave_idx_type& info, 
!              double& rcond, solve_singularity_handler sing_handler) const;
  
    ColumnVector solve (SparseType &typ, const ColumnVector& b) const;
    ColumnVector solve (SparseType &typ, const ColumnVector& b, 
                      octave_idx_type& info) const;
    ColumnVector solve (SparseType &typ, const ColumnVector& b, 
                      octave_idx_type& info, double& rcond) const;
!   ColumnVector solve (SparseType &typ, const ColumnVector& b, 
octave_idx_type& info,
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (SparseType &typ, 
                             const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (SparseType &typ, 
!                            const ComplexColumnVector& b, octave_idx_type& 
info) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
                             octave_idx_type& info, double& rcond) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
--- 295,318 ----
                             octave_idx_type& info) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
                             octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b,
!                            octave_idx_type& info, double& rcond, 
!                            solve_singularity_handler sing_handler,
!                            bool singular_fallabck = true) const;
  
    ColumnVector solve (SparseType &typ, const ColumnVector& b) const;
    ColumnVector solve (SparseType &typ, const ColumnVector& b, 
                      octave_idx_type& info) const;
    ColumnVector solve (SparseType &typ, const ColumnVector& b, 
                      octave_idx_type& info, double& rcond) const;
!   ColumnVector solve (SparseType &typ, const ColumnVector& b,
!                     octave_idx_type& info, double& rcond, 
!                     solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (SparseType &typ, 
                             const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b, 
!                            octave_idx_type& info) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
                             octave_idx_type& info, double& rcond) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
*** ./liboctave/CSparse.h.orig  2006-03-21 11:51:45.791077540 +0100
--- ./liboctave/CSparse.h       2006-03-21 10:03:42.961958374 +0100
***************
*** 273,299 ****
  public:
    // Generic interface to solver with no probing of type
    ComplexMatrix solve (SparseType &typ, const Matrix& b) const;
!   ComplexMatrix solve (SparseType &typ, const Matrix& b, octave_idx_type& 
info) const;
    ComplexMatrix solve (SparseType &typ, const Matrix& b, octave_idx_type& 
info, 
!               double& rcond) const;
    ComplexMatrix solve (SparseType &typ, const Matrix& b, octave_idx_type& 
info, 
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b) const;
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
                       octave_idx_type& info) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
octave_idx_type& info, 
!                      double& rcond) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
octave_idx_type& info, 
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
!                     octave_idx_type& info) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
octave_idx_type& info, 
!                     double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
octave_idx_type& info, 
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (SparseType &typ, 
                             const SparseComplexMatrix& b) const;
--- 273,305 ----
  public:
    // Generic interface to solver with no probing of type
    ComplexMatrix solve (SparseType &typ, const Matrix& b) const;
!   ComplexMatrix solve (SparseType &typ, const Matrix& b, 
!                      octave_idx_type& info) const;
    ComplexMatrix solve (SparseType &typ, const Matrix& b, octave_idx_type& 
info, 
!                      double& rcond) const;
    ComplexMatrix solve (SparseType &typ, const Matrix& b, octave_idx_type& 
info, 
!                      double& rcond, solve_singularity_handler sing_handler,
!                      bool singular_fallback = true) const;
  
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b) const;
    ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
                       octave_idx_type& info) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b, 
!                      octave_idx_type& info, double& rcond) const;
!   ComplexMatrix solve (SparseType &typ, const ComplexMatrix& b,
!                      octave_idx_type& info, double& rcond, 
!                      solve_singularity_handler sing_handler,
!                      bool singular_fallback = true) const;
  
    SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
!                            octave_idx_type& info) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
!                            octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseMatrix& b, 
!                            octave_idx_type& info, double& rcond, 
!                            solve_singularity_handler sing_handler,
!                            bool singular_fallback = true) const;
  
    SparseComplexMatrix solve (SparseType &typ, 
                             const SparseComplexMatrix& b) const;
***************
*** 301,321 ****
                             octave_idx_type& info) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
                             octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
octave_idx_type& info, 
!              double& rcond, solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b) const;
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b, 
!                     octave_idx_type& info) const;
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b, 
!                     octave_idx_type& info, double& rcond) const;
!   ComplexColumnVector solve (SparseType &typ, const ColumnVector& b, 
octave_idx_type& info,
!               double& rcond, solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (SparseType &typ, 
                             const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (SparseType &typ, 
!                            const ComplexColumnVector& b, octave_idx_type& 
info) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
                             octave_idx_type& info, double& rcond) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
--- 307,330 ----
                             octave_idx_type& info) const;
    SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b, 
                             octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (SparseType &typ, const SparseComplexMatrix& b,
!                            octave_idx_type& info, double& rcond, 
!                            solve_singularity_handler sing_handler,
!                            bool singular_fallback = true) const;
  
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b) const;
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b, 
!                            octave_idx_type& info) const;
    ComplexColumnVector solve (SparseType &typ, const ColumnVector& b, 
!                            octave_idx_type& info, double& rcond) const;
!   ComplexColumnVector solve (SparseType &typ, const ColumnVector& b,
!                            octave_idx_type& info, double& rcond, 
!                            solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (SparseType &typ, 
                             const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b, 
!                            octave_idx_type& info) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
                             octave_idx_type& info, double& rcond) const;
    ComplexColumnVector solve (SparseType &typ, const ComplexColumnVector& b,
***************
*** 325,331 ****
    // Generic interface to solver with probing of type
    ComplexMatrix solve (const Matrix& b) const;
    ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const;
!   ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond) 
const;
    ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond, 
                       solve_singularity_handler sing_handler) const;
  
--- 334,341 ----
    // Generic interface to solver with probing of type
    ComplexMatrix solve (const Matrix& b) const;
    ComplexMatrix solve (const Matrix& b, octave_idx_type& info) const;
!   ComplexMatrix solve (const Matrix& b, octave_idx_type& info, 
!                      double& rcond) const;
    ComplexMatrix solve (const Matrix& b, octave_idx_type& info, double& rcond, 
                       solve_singularity_handler sing_handler) const;
  
***************
*** 333,340 ****
    ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const;
    ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, 
                       double& rcond) const;
!   ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, double& 
rcond,
!                      solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (const SparseMatrix& b) const;
    SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info) 
const;
--- 343,350 ----
    ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info) const;
    ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info, 
                       double& rcond) const;
!   ComplexMatrix solve (const ComplexMatrix& b, octave_idx_type& info,
!                      double& rcond, solve_singularity_handler sing_handler) 
const;
  
    SparseComplexMatrix solve (const SparseMatrix& b) const;
    SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info) 
const;
***************
*** 342,366 ****
                             double& rcond) const;
    SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info, 
                             double& rcond, 
!                      solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (const SparseComplexMatrix& b) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& 
info) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& 
info, 
!                            double& rcond) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b, octave_idx_type& 
info, 
!                            double& rcond,
                             solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (const ColumnVector& b) const;
    ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info) 
const;
    ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info,
                             double& rcond) const;
!   ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, 
double& rcond,
                             solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& 
info) const;
    ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& 
info,
                             double& rcond) const;
    ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& 
info,
--- 352,379 ----
                             double& rcond) const;
    SparseComplexMatrix solve (const SparseMatrix& b, octave_idx_type& info, 
                             double& rcond, 
!                            solve_singularity_handler sing_handler) const;
  
    SparseComplexMatrix solve (const SparseComplexMatrix& b) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b, 
!                            octave_idx_type& info) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b,
!                            octave_idx_type& info, double& rcond) const;
!   SparseComplexMatrix solve (const SparseComplexMatrix& b,
!                            octave_idx_type& info, double& rcond,
                             solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (const ColumnVector& b) const;
    ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info) 
const;
    ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info,
                             double& rcond) const;
!   ComplexColumnVector solve (const ColumnVector& b, octave_idx_type& info, 
!                            double& rcond,
                             solve_singularity_handler sing_handler) const;
  
    ComplexColumnVector solve (const ComplexColumnVector& b) const;
!   ComplexColumnVector solve (const ComplexColumnVector& b, 
!                            octave_idx_type& info) const;
    ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& 
info,
                             double& rcond) const;
    ComplexColumnVector solve (const ComplexColumnVector& b, octave_idx_type& 
info,
***************
*** 377,383 ****
  
    SparseComplexMatrix reshape (const dim_vector& new_dims) const;
  
!   SparseComplexMatrix permute (const Array<octave_idx_type>& vec, bool inv = 
false) const;
  
    SparseComplexMatrix ipermute (const Array<octave_idx_type>& vec) const;
  
--- 390,397 ----
  
    SparseComplexMatrix reshape (const dim_vector& new_dims) const;
  
!   SparseComplexMatrix permute (const Array<octave_idx_type>& vec, 
!                              bool inv = false) const;
  
    SparseComplexMatrix ipermute (const Array<octave_idx_type>& vec) const;
  
*** ./liboctave/CSparse.cc.orig 2006-03-21 11:52:40.480553863 +0100
--- ./liboctave/CSparse.cc      2006-03-21 10:07:51.487843775 +0100
***************
*** 6717,6732 ****
  }
  
  ComplexMatrix
! SparseComplexMatrix::solve (SparseType &mattype, const Matrix& b, 
octave_idx_type& info, 
!                           double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
  
  ComplexMatrix
! SparseComplexMatrix::solve (SparseType &mattype, const Matrix& b, 
octave_idx_type& err, 
!                           double& rcond, 
!                           solve_singularity_handler sing_handler) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
--- 6717,6733 ----
  }
  
  ComplexMatrix
! SparseComplexMatrix::solve (SparseType &mattype, const Matrix& b,
!                           octave_idx_type& info, double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
  
  ComplexMatrix
! SparseComplexMatrix::solve (SparseType &mattype, const Matrix& b,
!                           octave_idx_type& err, double& rcond, 
!                           solve_singularity_handler sing_handler,
!                           bool singular_fallback) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 6753,6759 ****
        return ComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6754,6760 ----
        return ComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 6793,6799 ****
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseMatrix& b, 
                            octave_idx_type& err, double& rcond,
!                           solve_singularity_handler sing_handler) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
--- 6794,6801 ----
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseMatrix& b, 
                            octave_idx_type& err, double& rcond,
!                           solve_singularity_handler sing_handler,
!                           bool singular_fallback) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 6820,6826 ****
        return SparseComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6822,6828 ----
        return SparseComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 6852,6866 ****
  
  ComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
!                    octave_idx_type& info, double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
  
  ComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
!                    octave_idx_type& err, double& rcond, 
!                    solve_singularity_handler sing_handler) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
--- 6854,6869 ----
  
  ComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
!                           octave_idx_type& info, double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
  
  ComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const ComplexMatrix& b, 
!                           octave_idx_type& err, double& rcond, 
!                           solve_singularity_handler sing_handler,
!                           bool singular_fallback) const
  {
    ComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 6887,6893 ****
        return ComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6890,6896 ----
        return ComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
***************
*** 6912,6918 ****
  
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& 
b, 
!                    octave_idx_type& info) const
  {
    double rcond;
    return solve (mattype, b, info, rcond, 0);
--- 6915,6921 ----
  
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& 
b, 
!                           octave_idx_type& info) const
  {
    double rcond;
    return solve (mattype, b, info, rcond, 0);
***************
*** 6920,6926 ****
  
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& b,
!                    octave_idx_type& info, double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
--- 6923,6929 ----
  
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& b,
!                           octave_idx_type& info, double& rcond) const
  {
    return solve (mattype, b, info, rcond, 0);
  }
***************
*** 6928,6934 ****
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& 
b, 
                            octave_idx_type& err, double& rcond,
!                           solve_singularity_handler sing_handler) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
--- 6931,6938 ----
  SparseComplexMatrix
  SparseComplexMatrix::solve (SparseType &mattype, const SparseComplexMatrix& 
b, 
                            octave_idx_type& err, double& rcond,
!                           solve_singularity_handler sing_handler,
!                           bool singular_fallback) const
  {
    SparseComplexMatrix retval;
    int typ = mattype.type (false);
***************
*** 6955,6961 ****
        return SparseComplexMatrix ();
      }
  
!   if (mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
--- 6959,6965 ----
        return SparseComplexMatrix ();
      }
  
!   if (singular_fallback && mattype.type(false) == SparseType::Rectangular)
      {
        rcond = 1.;
  #ifdef USE_QRSOLVE
*** ./liboctave/sparse-dmsolve.cc.orig  2006-03-21 11:53:02.908500232 +0100
--- ./liboctave/sparse-dmsolve.cc       2006-03-21 10:20:33.031546044 +0100
***************
*** 395,401 ****
        pinv [p [i]] = i;
        RT btmp;
        dmsolve_permute (btmp, b, pinv);
-       SparseType mtyp (SparseType::Full);
        info = 0;
        retval.resize (nc, b_nc);
  
--- 395,400 ----
***************
*** 431,438 ****
          RT btmp2 = dmsolve_extract (btmp, NULL, NULL, dm->rr [1], dm->rr [2], 
                                      0, b_nc);
          double rcond = 0.0;
          RT mtmp = m.solve (mtyp, btmp2, info, rcond, 
!                            solve_singularity_warning);        
          if (info != 0)
            {
              info = 0;
--- 430,438 ----
          RT btmp2 = dmsolve_extract (btmp, NULL, NULL, dm->rr [1], dm->rr [2], 
                                      0, b_nc);
          double rcond = 0.0;
+         SparseType mtyp (SparseType::Full);
          RT mtmp = m.solve (mtyp, btmp2, info, rcond, 
!                            solve_singularity_warning, false); 
          if (info != 0)
            {
              info = 0;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]