public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Alken <alken@colorado.edu>
To: Alexis Tantet <alexis.tantet@gmail.com>
Cc: "gsl-discuss@sourceware.org" <gsl-discuss@sourceware.org>
Subject: Re: Sparse matrix extension
Date: Sun, 07 Feb 2016 20:14:00 -0000	[thread overview]
Message-ID: <56B7A59D.5040707@colorado.edu> (raw)
In-Reply-To: <CAMWWPT2KTLjufNdwW=y-xaJ1dKkxDNQwgat4DB4ZwKDrK_fZSA@mail.gmail.com>

Hi Alexis,

>> I'm not sure what you mean. I've added a new function gsl_spmatrix_ptr
>> to the git, which as far as I can tell does exactly what your
>> sum_duplicate flag does. It searches the matrix for an (i,j) element,
>> and if found returns a pointer. If not found a null pointer is returned.
>> This makes it easy for the user to modify A(i,j) after it has been added
>> to the matrix. Are you thinking of something else? Can you point me to
>> the Eigen routine?
>>
> What I meant is to have the equivalent of gsl_spmatrix_compress,
> with the difference that gsl_spmatrix_ptr is used instead of gsl_spmatrix_set,
> so has to build the compressed matrix from triplets, summing the
> duplicates, instead of replacing them.
> This is what is done here :
> The http://eigen.tuxfamily.org/dox/classEigen_1_1SparseMatrix.html#a5bcf3187e372ff7cea1e8f61152ae49b
>
> Best,
> Alexis

I'm not sure why a user would ever need to do this. The whole point of
the binary tree structure in the triplet storage is to efficiently find
duplicate entries, so that if a user tries to call gsl_spmatrix_set on
an element which is already been previously set, it can find that
element with a binary search (rather than linearly searching the arrays)
and change the value of that element.

Therefore, the way the triplet storage is designed, there is will never
be a duplicate element in the triplet arrays. All of the (i[n],j[n])
will be unique for each n <= nz.

Am I missing something?

Patrick

  reply	other threads:[~2016-02-07 20:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMWWPT3uJj4Vrn7ut6+F18gY===zd6+1r1UJhz0hcCj--zwtdg@mail.gmail.com>
2016-01-19 16:43 ` Alexis Tantet
2016-01-19 17:02   ` Patrick Alken
2016-01-19 19:55     ` Alexis Tantet
2016-01-19 20:50       ` Patrick Alken
2016-01-20 18:31         ` Alexis Tantet
2016-02-07  0:03           ` Patrick Alken
2016-02-07  1:03             ` Alexis Tantet
2016-02-07 17:25               ` Patrick Alken
2016-02-07 19:32                 ` Alexis Tantet
2016-02-07 20:14                   ` Patrick Alken [this message]
2016-02-07 20:31                     ` Alexis Tantet
2016-02-07 21:34                       ` Patrick Alken
2016-02-08  0:59                         ` Alexis Tantet
2016-02-10 13:16                           ` Alexis Tantet
2016-02-10 13:48                             ` Alexis Tantet
2016-02-10 15:56                             ` Patrick Alken
2016-02-12 10:43                               ` Alexis Tantet
2016-02-13 19:42                                 ` Patrick Alken
2016-02-14 11:06                                   ` Alexis Tantet
2016-02-14 18:11                                     ` Patrick Alken
2016-02-14 18:25                                       ` Brian Gladman
2016-02-15  5:10                                         ` Patrick Alken
2016-02-15 11:09                                           ` Brian Gladman
     [not found]                                             ` <CAMWWPT0J9ENRZjJHLO=cxot4DGdSLer+n2HkBVnhFnO0oiVV8g@mail.gmail.com>
2016-02-15 13:56                                               ` Alexis Tantet
2016-02-15 17:17                                                 ` Patrick Alken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B7A59D.5040707@colorado.edu \
    --to=alken@colorado.edu \
    --cc=alexis.tantet@gmail.com \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).