comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » bug in sprsin() for IDL 5.3?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
bug in sprsin() for IDL 5.3? [message #20208] Mon, 22 May 2000 00:00
jordan miles koss is currently offline  jordan miles koss
Messages: 1
Registered: May 2000
Junior Member
I think I may have found a bug in sprsin() for IDL 5.3 (RSI version). I
am running IDL on Linux with a 2.2 kernel. Version 5.3 of IDL
introduced a new way to create a sparse matrix; now you can create one
without having to create a regular matrix first. The syntax is:

Result = SPRSIN( Columns, Rows, Values, N [, /DOUBLE] [, THRESH=value] )

where N is the dimension of the matrix. Also, any matrix element whose
absolute value is less that THRESH is supposed to be set to zero.

It appears that the comparison forgets to take the absolute value of the
matrix element, and so all negative input values are set to zero.
Setting THRESH to a negative number seems to alleviate the problem. To
wit:

IDL> columns = [1,2,0]
IDL> rows = [0,1,2]
IDL> values = [1.0,-1.0,-0.1]
IDL> sprs_matrix = sprsin(columns, rows, values, 3)
IDL> print, fulstr(sprs_matrix)
0.00000 1.00000 0.00000
0.00000 0.00000 0.00000
0.00000 0.00000 0.00000
IDL> sprs_matrix = sprsin(columns, rows, values, 3, THRESH=-10.0)
IDL> print, fulstr(sprs_matrix)
0.00000 1.00000 0.00000
0.00000 0.00000 -1.00000
-0.100000 0.00000 0.00000

Has anyone else seen this bug on a different platform? Setting THRESH
to a negative number solves this particular problem, but is it possible
that this kludge might introduce a different problem down the road?

Thanks in advance for any help. I am new to the newsgroup, so I hope
this message conforms to your standards.

Jordan


--
Jordan Koss
j-koss@uchicago.edu
[Message index]
 
Read Message
Previous Topic: conversion vms time quadword to PC time
Next Topic: unexpected colors

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 02:48:08 PDT 2025

Total time taken to generate the page: 1.27829 seconds