Extreme Optimization™: Complexity made simple.

Numerical Components
for .NET

  • Home
  • •
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • •
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • •
  • Support
    • Frequently Asked Questions
    • QuickStart Samples
    • Sample Applications
    • Downloads
  • •
  • Blog
  • •
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Contact us
Introduction
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand ReferenceReference
  • Home
  • Documentation
  • Reference
  • Extreme.Mathematics.LinearAlgebra.Sparse Namespace
  • SparseCompressedColumnMatrix Class
    • Members
    • Constructors
    • Methods
    • Properties
Collapse imageExpand ImageCopy imageCopyHover image
       




SparseCompressedColumnMatrix Class

Members  See Also 
Represents a sparse matrix in Compressed Sparse Column format.

Namespace:  Extreme.Mathematics.LinearAlgebra.Sparse
Assembly:  Extreme.Numerics.Net20 (in Extreme.Numerics.Net20.dll) Version: 3.6.10055.0 (3.6.10077.0)

Syntax

C#
[SerializableAttribute]
public sealed class SparseCompressedColumnMatrix : SparseMatrix, 
	IResizableMatrix, ISerializable
Visual Basic (Declaration)
<SerializableAttribute> _
Public NotInheritable Class SparseCompressedColumnMatrix _
	Inherits SparseMatrix _
	Implements IResizableMatrix, ISerializable
Visual C++
[SerializableAttribute]
public ref class SparseCompressedColumnMatrix sealed : public SparseMatrix, 
	IResizableMatrix, ISerializable
F#
[<SealedAttribute>]
[<SerializableAttribute>]
type SparseCompressedColumnMatrix =  
    class
        inherit SparseMatrix
        interface IResizableMatrix
        interface ISerializable
    end

Remarks

Use the SparseCompressedColumnMatrix class to represent sparse matrices. Only the nonzero components of the matrix are stored. This not only saves memory, but also allows many calculations to be performed faster.

The compressed sparse column format stores the components in column-major order. Within each column, only the row indexes and the values of the nonzero components are stored.

The components of a sparse matrix can be specified in a variety of ways. A common method is to supply the rows, columns, and values of the nonzero components. Another way is to build up the matrix using the

CopyC#
Insert
methods: InsertEntry(Double, Int32, Int32), InsertEntries(array<Double>[]()[], array<Int32>[]()[], array<Int32>[]()[]), InsertRow(Int32, array<Double>[]()[], array<Int32>[]()[]), InsertColumn(Int32, array<Double>[]()[], array<Int32>[]()[]), InsertClique(Matrix, array<Int32>[]()[], array<Int32>[]()[]). Individual components can also be set, but this is generally less efficient.

Sparse matrices can also be read directly from data files in Matrix Market format. Use the MatrixMarketReader for this purpose.

The NonzeroCount property returns the number of nonzero components. The FillFactor property returns a number between 0 and 1 that is the proportion of nonzero components to the total number of components in the matrix. To iterate through the nonzero components of a sparse matrix, use the NonzeroComponents property. This property enumerates RowColumnValueTriplet objects, each containing the row, column, and value of a nonzero component.

A disadvantage of sparse matrices is that working with individual components tends to be slower. Every access usually requires a lookup in a list. To avoid duplicate lookups for elementary operations on components, use one of the specialized methods: AddAt(Int32, Int32, Double), SubtractAt(Int32, Int32, Double), MultiplyAt(Int32, Int32, Double) and DivideAt(Int32, Int32, Double).

Inheritance Hierarchy

System..::.Object
  Extreme.Mathematics.LinearAlgebra..::.LinearTransformation
    Extreme.Mathematics..::.Matrix
      Extreme.Mathematics.LinearAlgebra.Sparse..::.SparseMatrix
        Extreme.Mathematics.LinearAlgebra.Sparse..::.SparseCompressedColumnMatrix

See Also

SparseCompressedColumnMatrix Members
Extreme.Mathematics.LinearAlgebra.Sparse Namespace

Send comments on this topic to support@extremeoptimization.com

Copyright © 2003-2010, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.