Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-314

New sparse vector implementation: int[] indices; double[] values;

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Later
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:

      all

      Description

      OpenMapRealVector is nice for fast random access, but if all you do with your sparse vectors is dot them together, add them onto dense vectors, and so forth, the representation as just an array of indices and an array of values is more compact, and faster (for these operations).

      It becomes prohibitive to do modification, however, so the usual thing is to have them be immutable - use an OpenMapRealVector while modifing, then seal them up into the constructor for an IntDoubleArrayVector form for fast iteration and so forth.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jake.mannix Jake Mannix
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: