Search Results for

    Show / Hide Table of Contents

    Class PackedSparseMatrix

    This is a sparse matrix where each row is an array of (column,value) pairs This is more efficient for Matrix*Vector multiply.

    Inheritance
    Object
    PackedSparseMatrix
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: g3
    Assembly: cs.temp.dll.dll
    Syntax
    public class PackedSparseMatrix

    Constructors

    PackedSparseMatrix(DVector<matrix_entry>, Int32, Int32, Boolean)

    Declaration
    public PackedSparseMatrix(DVector<matrix_entry> entries, int numRows, int numCols, bool bSymmetric = true)
    Parameters
    Type Name Description
    DVector<matrix_entry> entries
    Int32 numRows
    Int32 numCols
    Boolean bSymmetric

    PackedSparseMatrix(PackedSparseMatrix)

    Declaration
    public PackedSparseMatrix(PackedSparseMatrix copy)
    Parameters
    Type Name Description
    PackedSparseMatrix copy

    PackedSparseMatrix(SymmetricSparseMatrix, Boolean)

    Declaration
    public PackedSparseMatrix(SymmetricSparseMatrix m, bool bTranspose = false)
    Parameters
    Type Name Description
    SymmetricSparseMatrix m
    Boolean bTranspose

    Fields

    Columns

    Declaration
    public int Columns
    Field Value
    Type Description
    Int32

    IsSymmetric

    Declaration
    public bool IsSymmetric
    Field Value
    Type Description
    Boolean

    NumNonZeros

    Declaration
    public int NumNonZeros
    Field Value
    Type Description
    Int32

    Rows

    Declaration
    public PackedSparseMatrix.nonzero[][] Rows
    Field Value
    Type Description
    PackedSparseMatrix.nonzero[][]

    Sorted

    Declaration
    public bool Sorted
    Field Value
    Type Description
    Boolean

    StorageMode

    Declaration
    public PackedSparseMatrix.StorageModes StorageMode
    Field Value
    Type Description
    PackedSparseMatrix.StorageModes

    Properties

    FrobeniusNorm

    Declaration
    public double FrobeniusNorm { get; }
    Property Value
    Type Description
    Double

    Item[Int32, Int32]

    Declaration
    public double this[int r, int c] { get; set; }
    Parameters
    Type Name Description
    Int32 r
    Int32 c
    Property Value
    Type Description
    Double

    MaxNorm

    Declaration
    public double MaxNorm { get; }
    Property Value
    Type Description
    Double

    Trace

    Declaration
    public double Trace { get; }
    Property Value
    Type Description
    Double

    Methods

    DotColumnVector(Int32, Double[], Int32, Int32)

    Compute dot product of this.row[r1] and this.row[r2], up to N elements

    Declaration
    public double DotColumnVector(int c, double[] vec, int start_row = 0, int end_row = 2147483647)
    Parameters
    Type Name Description
    Int32 c
    Double[] vec
    Int32 start_row
    Int32 end_row
    Returns
    Type Description
    Double

    DotRowAllColumns(Int32, Double[], Int32[], PackedSparseMatrix)

    Compute dot product of this.row[r] with all columns of M, where columns are stored in MTranspose rows. In theory more efficient than doing DotRowColumn(r,c) for each c, however so far the difference is negligible...perhaps because there are quite a few more branches in the inner loop

    Declaration
    public void DotRowAllColumns(int r, double[] sums, int[] col_indices, PackedSparseMatrix MTranspose)
    Parameters
    Type Name Description
    Int32 r
    Double[] sums
    Int32[] col_indices
    PackedSparseMatrix MTranspose

    DotRowColumn(Int32, Int32, PackedSparseMatrix)

    Compute dot product of this.row[r] and M.col[c], where the column is stored as MTranspose.row[c]

    Declaration
    public double DotRowColumn(int r, int c, PackedSparseMatrix MTranspose)
    Parameters
    Type Name Description
    Int32 r
    Int32 c
    PackedSparseMatrix MTranspose
    Returns
    Type Description
    Double

    DotRows(Int32, Int32, Int32)

    Compute dot product of this.row[r1] and this.row[r2], up to N elements

    Declaration
    public double DotRows(int r1, int r2, int MaxCol = 2147483647)
    Parameters
    Type Name Description
    Int32 r1
    Int32 r2
    Int32 MaxCol
    Returns
    Type Description
    Double

    DotRowSelf(Int32)

    Dot product of this.row[r] with itself

    Declaration
    public double DotRowSelf(int r)
    Parameters
    Type Name Description
    Int32 r
    Returns
    Type Description
    Double

    DotRowVector(Int32, Double[], Int32)

    Compute dot product of this.row[r] and vec, up to N elements

    Declaration
    public double DotRowVector(int r, double[] vec, int MaxCol = 2147483647)
    Parameters
    Type Name Description
    Int32 r
    Double[] vec
    Int32 MaxCol
    Returns
    Type Description
    Double

    FromDense(DenseMatrix, Boolean)

    Declaration
    public static PackedSparseMatrix FromDense(DenseMatrix m, bool bSymmetric)
    Parameters
    Type Name Description
    DenseMatrix m
    Boolean bSymmetric
    Returns
    Type Description
    PackedSparseMatrix

    MatrixInfo(Boolean)

    Declaration
    public string MatrixInfo(bool bExtended = false)
    Parameters
    Type Name Description
    Boolean bExtended
    Returns
    Type Description
    String

    Multiply(Double[], Double[])

    Declaration
    public void Multiply(double[] X, double[] Result)
    Parameters
    Type Name Description
    Double[] X
    Double[] Result

    Multiply_Parallel(Double[], Double[])

    Declaration
    public void Multiply_Parallel(double[] X, double[] Result)
    Parameters
    Type Name Description
    Double[] X
    Double[] Result

    Multiply_Parallel_3(Double[][], Double[][])

    Hardcoded variant for 3 RHS vectors, much faster

    Declaration
    public void Multiply_Parallel_3(double[][] X, double[][] Result)
    Parameters
    Type Name Description
    Double[][] X
    Double[][] Result

    NonZeroIndicesByRow(Boolean)

    Declaration
    public IEnumerable<Vector2i> NonZeroIndicesByRow(bool bWantSorted = true)
    Parameters
    Type Name Description
    Boolean bWantSorted
    Returns
    Type Description
    IEnumerable<Vector2i>

    NonZeroIndicesForRow(Int32, Boolean)

    Declaration
    public IEnumerable<Vector2i> NonZeroIndicesForRow(int r, bool bWantSorted = true)
    Parameters
    Type Name Description
    Int32 r
    Boolean bWantSorted
    Returns
    Type Description
    IEnumerable<Vector2i>

    NonZerosRange(Int32)

    For row r, find interval that nonzeros lie in

    Declaration
    public Interval1i NonZerosRange(int r)
    Parameters
    Type Name Description
    Int32 r
    Returns
    Type Description
    Interval1i

    Sort(Boolean)

    sort each row

    Declaration
    public void Sort(bool bParallel = true)
    Parameters
    Type Name Description
    Boolean bParallel

    Square()

    Declaration
    public PackedSparseMatrix Square()
    Returns
    Type Description
    PackedSparseMatrix
    In This Article
    Back to top ViRGIS VR GIS