From: Ralf J. <jue...@cs...> - 2010-05-15 19:49:34
|
Hi Fabian, You've found a bug in lush2, thanks for reporting. I've just submitted a fix to svn. While I was at it I also renamed the function 'new-storage-mmap' to 'new-storage/mmap' as it is documented. To get the fix now you would need to make a build from the svn sources. Let us know if you need any help with that. Ralf On Fri, 14 May 2010, Fabian wrote: > > Hi all, > > I'm trying to upgrade to lush2 and up to now everthing worked well > thanks to the construct "(with-namespace lush1- ". > But now I ran into problems when i tried to read in some old data. > > In lush1 i used the following function and in worked well: > > ;;lush1 version > (de funktion-load-array-idx2 (fn) > (let ((fst (float-storage)) (metinfo ()) (ten2 ())) > ;;map storage > (storage-mmap fst fn 0) > ;;make idx > (setq metinfo (mapfor (i 1 2) (fst i))) > (setq ten2 (new-index fst metinfo)) > (idx-changeoffset ten2 3) > ten2)) > > Here i just make a storage map to a file holding some float numbers > and create an idx2. (first three entries are meta-info) > > I converted this function to lush2 in the following way: > > ;;lush2 version > (de funktion-load-array-idx2 (fn) > (let ((fst (new-storage-mmap 'float fn)) (metinfo ()) (ten2 ())) > (setq metinfo (mapfor (i 1 2) (fst i))) > (setq ten2 (new-index fst metinfo)) > (idx-set-offset ten2 3) ten2)) > > So up to some trivial renaming it is the same. > > Now lets use it: > > (setq a-1 (funktion-load-array-idx2 "/tmp/mat-test.mat")) > = ::Index:FloatStorage:<210x492> > > so it seems that it worked, but when when i do: > > (a-1 () ()) > > lush2 crashes immediately with the error message: > > lush2: cmm.c:363: live: Assertion `i != -1' failed. > > Here some further observations: > Only print a part of the matrix: > > ((idx-extend (idx-extend a-1 0 -90) 1 -282) () ()) > > i can execute this command twice, but it then also crashes > with the same error message. > > When i load in the matrix with my function and then save it, > restart lush2 and then use the new copy, everthing is ok: > > (setq a-1 (funktion-load-array-idx2 "/tmp/mat-test.mat")) > (save-matrix a-1 "/tmp/mat-test-2.mat") > > ;;restart lush2 > > (setq a-2 (load-matrix "/tmp/mat-test-2.mat")) > ;;now everthing is ok > (a-2 () ()) > > > > Any ideas ?? > > > Thanks, > Fabian > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Lush-users mailing list > Lus...@li... > https://lists.sourceforge.net/lists/listinfo/lush-users > |