Changeset f0fb366 in git


Ignore:
Timestamp:
Nov 9, 2009, 12:08:26 PM (15 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
fd760f7e6161b8bb84a74b7b8c42ac252cbeb31b
Parents:
bfa2deb0033ef0679fd34718a46b524db667a98a
Message:
fix for non-working example by Bruns (inversion of matrix over the complex numbers)

git-svn-id: file:///usr/local/Singular/svn/trunk@12258 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/linalg.lib

    rbfa2deb rf0fb366  
    123123{
    124124//--------------------------- initialization and check ------------------------
    125    int ii,u,i,opt;
     125   int ii,u,notInvertible,opt;
    126126   matrix invA;
    127127   int db = printlevel-voice+3;      //used for comments
     
    198198         if ( D1[ii] != gen(ii) )
    199199         {
    200             dbprint(db,"// ** matrix is not invertible");
    201             i = 1;
     200            notInvertible = 1;
    202201            break;
    203202         }
     
    214213      kill @R;
    215214   }
    216    if( i==1 ) { return(invA); }     //matrix not invetible
     215   if( notInvertible == 1 )
     216   {
     217     // The matrix A seems to be non-invertible.
     218     // Note that there are examples, where this is not true but only due to
     219     // inexact computations in the field of reals or complex numbers:
     220     // ring r = complex, x, dp;
     221     // The following matrix has non-zero determinante but seems non-invertible:
     222     // matrix A[3][3] = 1,i,i,0,1,2,1,0,1+i;
     223     // For this example, inverse_B yields the correct answer.
     224     // So, let's use this as a workaround whenever we have this situation:
     225     list myList = inverse_B(A);
     226     matrix Try = inverse_B(A)[1];
     227     if (myList[2] == poly(1)) { return (Try); }
     228     else
     229     {
     230       dbprint(db,"// ** matrix is not invertible");
     231       return(invA);
     232     }
     233   }
    217234   else { return(matrix(D2)); }     //matrix invertible with inverse D2
    218235
Note: See TracChangeset for help on using the changeset viewer.