Mercurial > forge
changeset 1074:8f3457880ca0 octave-forge
minor test and error mods
author | aadler |
---|---|
date | Tue, 21 Oct 2003 14:35:12 +0000 |
parents | 0a72b0728ec9 |
children | f0afd951cc1b |
files | main/sparse/make_sparse.h main/sparse/sp_test.m main/sparse/sparse_inv.cc |
diffstat | 3 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/main/sparse/make_sparse.h Mon Oct 20 17:31:31 2003 +0000 +++ b/main/sparse/make_sparse.h Tue Oct 21 14:35:12 2003 +0000 @@ -19,6 +19,9 @@ $Id$ $Log$ +Revision 1.17 2003/10/21 14:35:12 aadler +minor test and error mods + Revision 1.16 2003/08/29 19:40:56 aadler throw error rather than segfault for singular matrices @@ -113,9 +116,10 @@ # define DEBUGMSG(x) #endif -// Thanks to To: Paul Kienzle <pkienzle@kienzle.powernet.co.uk> -// for help with error handling -#define SP_FATAL_ERR(str) { error("sparse: %s", str); octave_throw_bad_alloc (); } +// This is not the right error to thow +#define SP_FATAL_ERR(str) do { error("sparse: %s" \ + "(NOTE: you may ignore following memory error)", str); \ + octave_throw_bad_alloc(); } while (0) // The SuperLU includes need to be first, // otherwise the cygwin build breaks!
--- a/main/sparse/sp_test.m Mon Oct 20 17:31:31 2003 +0000 +++ b/main/sparse/sp_test.m Tue Oct 21 14:35:12 2003 +0000 @@ -23,7 +23,7 @@ prefer_zero_one_indexing= 0; page_screen_output=1; SZ=10; -NTRIES=100; +NTRIES=1 ; errortol= 1e-10; res=zeros(1,300); % should be enough space @@ -675,7 +675,10 @@ all(all(abs( PsR'*Ls4*Us4*PsC - drf )< mag)) ; all(all( Ls4 .* LL == Ls4 )) ; all(all( Us4 .* UU == Us4 )) ] ); - elseif 0 + end + i=i+1; % i=200 + + if 0 % OCTAVE [Ls4,Us4,Ps4] = lu( drs ); res(i)= res(i) + ... all([ all(all(abs( Ps4'*Ls4*Us4 - Pf4'*Lf4*Uf4 )<mag)) ; @@ -683,7 +686,6 @@ all(all( Ls4 .* LL == Ls4 )) ; all(all( Us4 .* UU == Us4 )) ] ); end - i=i+1; % i=201 dsi = spinv( drs ); @@ -834,6 +836,9 @@ % % $Log$ +% Revision 1.17 2003/10/21 14:35:12 aadler +% minor test and error mods +% % Revision 1.16 2003/10/18 04:55:47 aadler % spreal spimag and new tests %
--- a/main/sparse/sparse_inv.cc Mon Oct 20 17:31:31 2003 +0000 +++ b/main/sparse/sparse_inv.cc Tue Oct 21 14:35:12 2003 +0000 @@ -95,9 +95,9 @@ Note: 2nd input funcionality has not been verified\n\ With a second input, the columns of A are permuted before factoring:\n\ \n\ -[L,U,P] = superlu(A,psparse) returns triangular L and U and permutation\n\ +[L,U,P] = splu(A,psparse) returns triangular L and U and permutation\n\ prow with P*A(:,psparse) = L*U.\n\ -[L,U] = superlu(A,psparse) returns permuted triangular L and triangular U\n\ +[L,U] = splu(A,psparse) returns permuted triangular L and triangular U\n\ with A(:,psparse) = L*U.\n\ Here psparse will normally be a user-supplied permutation matrix or vector\n\ to be applied to the columns of A for sparsity. \n\ @@ -126,7 +126,7 @@ int permc_spec=3; if (nargin ==2) { - ColumnVector permcidx = args(1).column_vector_value(); + ColumnVector permcidx ( args(1).vector_value() ); for( int i= 0; i< n ; i++ ) perm_c[i]= (int) permcidx(i) - 1; permc_spec= -1; //permc is preselected @@ -467,6 +467,9 @@ /* * $Log$ + * Revision 1.14 2003/10/21 14:35:12 aadler + * minor test and error mods + * * Revision 1.13 2003/10/18 01:13:00 aadler * texinfo for documentation strings *