BRIDGES
  • Articles
  • BRIDGES
Search Results for

    Show / Hide Table of Contents
    • Settings
    • LinearAlgebra
      • Vectors
        • DenseVector
        • SparseVector
        • Vector
      • Factorisation
        • SparseQR
      • Matrices
        • DenseMatrix
        • Matrix
        • SparseMatrix
        • Sparse
          • CompressedColumn
          • CompressedRow
        • Storage
          • DictionaryOfKeys
    • Algebra
      • Measure
        • IDotProduct<TSelf, TValue>
        • IMetric<TSelf>
        • INorm<TSelf>
      • Sets
        • IGroupAction<TSelf, TValue>
      • Fundamentals
        • IAddable<T>
    • Solvers
      • GuidedProjection
        • Energy
        • GuidedProjectionAlgorithm
        • LinearisedConstraint
        • QuadraticConstraint
        • VariableSet
        • EnergyTypes
          • SegmentOrthogonality
          • SegmentParallelity
        • Interfaces
          • IEnergyType
          • ILinearisedConstraintType
          • IQuadraticConstraintType
        • QuadraticConstraintTypes
          • CoherentLength
          • LowerBound
          • UpperBound
          • VectorLength
    • Arithmetic
      • Polynomials
        • Multivariate
          • Monomial
          • Polynomial
        • Univariate
          • Polynomial
          • Specials
            • Bernstein
            • BSpline
      • Numbers
        • Complex
        • Quaternion
        • Real
    • Geometry
      • Euclidean3D
        • Basis
        • BSplineCurve
        • BSplineSurface
        • Circle
        • Frame
        • Line
        • NurbsCurve
        • NurbsSurface
        • Plane
        • Point
        • Polyline
        • Ray
        • Segment
        • Sphere
        • Vector
      • Kernel
        • BSplineCurve<TPoint>
        • BSplineSurface<TPoint>
        • CurveParameterFormat
        • IGeometricallyEquatable<T>
      • Projective3D
        • Point
    • DataStructures
      • PolyhedralMeshes
        • IEdge<TPosition>
        • IFace<TPosition>
        • IMesh<TPosition>
        • IVertex<TPosition>
        • FaceVertexMesh
          • Edge<TPosition>
          • Face<TPosition>
          • Mesh<TPosition>
          • Vertex<TPosition>
        • Abstract
          • Edge<TPosition, TVertex, TEdge, TFace>
          • Face<TPosition, TVertex, TEdge, TFace>
          • Mesh<TPosition, TVertex, TEdge, TFace>
          • Vertex<TPosition, TVertex, TEdge, TFace>
        • HalfedgeMesh
          • Edge<TPosition>
          • Face<TPosition>
          • Halfedge<TPosition>
          • Mesh<TPosition>
          • Vertex<TPosition>

    Class SparseMatrix

    Class defining a sparse matrix.

    Inheritance
    Object
    Matrix
    SparseMatrix
    CompressedColumn
    CompressedRow
    Implements
    IGroupAction<Matrix, Double>
    IGroupAction<SparseMatrix, Double>
    Inherited Members
    Matrix.RowCount
    Matrix.ColumnCount
    Matrix.Transpose(Matrix)
    Matrix.Add(Matrix, Matrix)
    Matrix.Subtract(Matrix, Matrix)
    Matrix.Opposite(Matrix)
    Matrix.Multiply(Matrix, Matrix)
    Matrix.TransposeMultiplySelf(Matrix)
    Matrix.Multiply(Double, Matrix)
    Matrix.Multiply(Matrix, Double)
    Matrix.Divide(Matrix, Double)
    Matrix.Multiply(Matrix, Vector)
    Matrix.Multiply(Matrix, DenseVector)
    Matrix.Multiply(Matrix, SparseVector)
    Matrix.TransposeMultiply(Matrix, Vector)
    Matrix.TransposeMultiply(Matrix, DenseVector)
    Matrix.TransposeMultiply(Matrix, SparseVector)
    Matrix.At(Int32, Int32)
    Matrix.IGroupAction<Matrix, Double>.Multiply(Double)
    Matrix.IGroupAction<Matrix, Double>.Divide(Double)
    Namespace: BRIDGES.LinearAlgebra.Matrices
    Assembly: BRIDGES.dll
    Syntax
    public abstract class SparseMatrix : Matrix, IGroupAction<Matrix, double>, IGroupAction<SparseMatrix, double>

    Constructors

    | Improve this Doc View Source

    SparseMatrix(Int32, Int32)

    Initialises a new instance of the SparseMatrix class.

    Declaration
    protected SparseMatrix(int rowCount, int columnCount)
    Parameters
    Type Name Description
    Int32 rowCount

    Number of rows of the SparseMatrix.

    Int32 columnCount

    Number of columns of the SparseMatrix.

    Properties

    | Improve this Doc View Source

    Item[Int32]

    Gets or sets the non-zero value of this sparse matrix at a given index.

    Declaration
    public abstract double this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    Index of the non-zero value to get.

    Property Value
    Type Description
    Double

    The non-zero value of this sparse matrix at the given index.

    | Improve this Doc View Source

    NonZerosCount

    Gets the number of non-zero values in this sparse matrix.

    Declaration
    public abstract int NonZerosCount { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    Add(SparseMatrix, SparseMatrix)

    Computes the addition of two SparseMatrix.

    Declaration
    public static SparseMatrix Add(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the addition.

    SparseMatrix right

    Right SparseMatrix for the addition.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the addition.

    | Improve this Doc View Source

    Divide(SparseMatrix, Double)

    Computes the scalar division of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix Divide(SparseMatrix operand, double divisor)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix to divide.

    Double divisor

    number to divide with.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the scalar division.

    | Improve this Doc View Source

    Multiply(SparseMatrix, SparseMatrix)

    Computes the multiplication of two SparseMatrix.

    Declaration
    public static SparseMatrix Multiply(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the multiplication.

    SparseMatrix right

    Right SparseMatrix for the multiplication.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, DenseVector)

    Computes the right multiplication of a SparseMatrix with a DenseVector : A·V.

    Declaration
    public static DenseVector Multiply(SparseMatrix matrix, DenseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    DenseVector vector

    DenseVector to multiply with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, SparseVector)

    Computes the right multiplication of a SparseMatrix with a SparseVector : A·V.

    Declaration
    public static SparseVector Multiply(SparseMatrix matrix, SparseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    SparseVector vector

    SparseVector to multiply with.

    Returns
    Type Description
    SparseVector

    The new SparseVector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, Vector)

    Computes the right multiplication of a SparseMatrix with a Vector : A·V.

    Declaration
    public static Vector Multiply(SparseMatrix matrix, Vector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    Vector vector

    Vector to multiply with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, Double)

    Computes the right scalar multiplication of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix Multiply(SparseMatrix operand, double factor)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix to multiply on the right.

    Double factor

    number to multiply with.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the right scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, SparseMatrix)

    Computes the left scalar multiplication of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix Multiply(double factor, SparseMatrix operand)
    Parameters
    Type Name Description
    Double factor

    number to multiply with.

    SparseMatrix operand

    SparseMatrix to multiply on the left.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the left scalar multiplication.

    | Improve this Doc View Source

    NonZeros()

    Provides an enumerable collection to iterate on the non-zero entries of the SparseMatrix non-zero entries.

    Declaration
    public abstract IEnumerable<(int rowIndex, int columnIndex, double value)> NonZeros()
    Returns
    Type Description
    IEnumerable<(, , )<Int32, Int32, Double>>

    The enumerable collection containing row index, the column index and the value of the SparseMatrix non-zero entries.

    | Improve this Doc View Source

    Subtract(SparseMatrix, SparseMatrix)

    Computes the subtraction of two SparseMatrix.

    Declaration
    public static SparseMatrix Subtract(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix to subtract.

    SparseMatrix right

    Right SparseMatrix to subtract with.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the subtraction.

    | Improve this Doc View Source

    ToArray()

    Translates this matrix into its bi-dimensional array representation.

    Declaration
    public override double[, ] ToArray()
    Returns
    Type Description
    Double[,]

    The bi-dimensional array representing the matrix.

    Overrides
    Matrix.ToArray()
    | Improve this Doc View Source

    Transpose(SparseMatrix)

    Transposes the SparseMatrix

    Declaration
    public static SparseMatrix Transpose(SparseMatrix matrix)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to tranpose.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix, transposed of the initial one.

    | Improve this Doc View Source

    TransposeMultiply(SparseMatrix, DenseVector)

    Computes the right multiplication of a SparseMatrix with a DenseVector : A·V.

    Declaration
    public static DenseVector TransposeMultiply(SparseMatrix matrix, DenseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    DenseVector vector

    DenseVector to multiply with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the multiplication.

    | Improve this Doc View Source

    TransposeMultiply(SparseMatrix, SparseVector)

    Computes the right multiplication of a SparseMatrix with a SparseVector : A·V.

    Declaration
    public static SparseVector TransposeMultiply(SparseMatrix matrix, SparseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    SparseVector vector

    SparseVector to multiply with.

    Returns
    Type Description
    SparseVector

    The new SparseVector resulting from the multiplication.

    | Improve this Doc View Source

    TransposeMultiply(SparseMatrix, Vector)

    Computes the right multiplication of a transposed SparseMatrix with a Vector : At·V.

    Declaration
    public static Vector TransposeMultiply(SparseMatrix matrix, Vector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to transpose then multiply on the right.

    Vector vector

    Vector to multiply with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the multiplication.

    | Improve this Doc View Source

    TransposeMultiplySelf(SparseMatrix)

    Computes the left multiplication of a SparseMatrix with its transposition : At·A.

    Declaration
    public static SparseMatrix TransposeMultiplySelf(SparseMatrix operand)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix for the operation.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the operation.

    Operators

    | Improve this Doc View Source

    Addition(SparseMatrix, DenseMatrix)

    Computes the right addition of a SparseMatrix with a DenseMatrix on the right.

    Declaration
    public static DenseMatrix operator +(SparseMatrix left, DenseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the addition.

    DenseMatrix right

    Right DenseMatrix for the addition.

    Returns
    Type Description
    DenseMatrix

    The new DenseMatrix resulting from the addition.

    | Improve this Doc View Source

    Addition(SparseMatrix, Matrix)

    Computes the right addition of a SparseMatrix with a Matrix on the right.

    Declaration
    public static Matrix operator +(SparseMatrix left, Matrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the addition.

    Matrix right

    Right Matrix for the addition.

    Returns
    Type Description
    Matrix

    The new Matrix resulting from the addition.

    | Improve this Doc View Source

    Addition(SparseMatrix, SparseMatrix)

    Computes the addition of two SparseMatrix.

    Declaration
    public static SparseMatrix operator +(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the addition.

    SparseMatrix right

    Right SparseMatrix for the addition.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the addition.

    | Improve this Doc View Source

    Division(SparseMatrix, Double)

    Computes the scalar division of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix operator /(SparseMatrix operand, double divisor)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix to divide.

    Double divisor

    number to divide with.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the scalar division.

    | Improve this Doc View Source

    Multiply(SparseMatrix, DenseMatrix)

    Computes the right multiplication of a SparseMatrix with a DenseMatrix.

    Declaration
    public static DenseMatrix operator *(SparseMatrix left, DenseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the multiplication.

    DenseMatrix right

    Right DenseMatrix for the multiplication.

    Returns
    Type Description
    DenseMatrix

    The new DenseMatrix resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, Matrix)

    Computes the right multiplication of a SparseMatrix with a Matrix.

    Declaration
    public static Matrix operator *(SparseMatrix left, Matrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the multiplication.

    Matrix right

    Right Matrix for the multiplication.

    Returns
    Type Description
    Matrix

    The new Matrix resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, SparseMatrix)

    Computes the multiplication of two SparseMatrix.

    Declaration
    public static SparseMatrix operator *(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix for the multiplication.

    SparseMatrix right

    Right SparseMatrix for the multiplication.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, DenseVector)

    Computes the right multiplication of a SparseMatrix with a DenseVector : A·V.

    Declaration
    public static DenseVector operator *(SparseMatrix matrix, DenseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    DenseVector vector

    DenseVector to multiply with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, SparseVector)

    Computes the right multiplication of a SparseMatrix with a SparseVector : A·V.

    Declaration
    public static SparseVector operator *(SparseMatrix matrix, SparseVector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    SparseVector vector

    SparseVector to multiply with.

    Returns
    Type Description
    SparseVector

    The new SparseVector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, Vector)

    Computes the right multiplication of a SparseMatrix with a Vector : A·V.

    Declaration
    public static Vector operator *(SparseMatrix matrix, Vector vector)
    Parameters
    Type Name Description
    SparseMatrix matrix

    SparseMatrix to multiply on the right.

    Vector vector

    Vector to multiply with.

    Returns
    Type Description
    Vector

    The new Vector resulting from the multiplication.

    | Improve this Doc View Source

    Multiply(SparseMatrix, Double)

    Computes the right scalar multiplication of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix operator *(SparseMatrix operand, double factor)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix to multiply on the right.

    Double factor

    number to multiply with.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the right scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, SparseMatrix)

    Computes the left scalar multiplication of a SparseMatrix with a number.

    Declaration
    public static SparseMatrix operator *(double factor, SparseMatrix operand)
    Parameters
    Type Name Description
    Double factor

    number to multiply with.

    SparseMatrix operand

    SparseMatrix to multiply on the left.

    Returns
    Type Description
    SparseMatrix

    The new SparseMatrix resulting from the left scalar multiplication.

    | Improve this Doc View Source

    Subtraction(SparseMatrix, DenseMatrix)

    Computes the subtraction of a SparseMatrix with a DenseMatrix.

    Declaration
    public static DenseMatrix operator -(SparseMatrix left, DenseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix to subtract.

    DenseMatrix right

    Right DenseMatrix to subtract with.

    Returns
    Type Description
    DenseMatrix

    The new DenseMatrix resulting from the subtraction.

    | Improve this Doc View Source

    Subtraction(SparseMatrix, Matrix)

    Computes the subtraction of a SparseMatrix with a Matrix.

    Declaration
    public static Matrix operator -(SparseMatrix left, Matrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix to subtract.

    Matrix right

    Right Matrix to subtract with.

    Returns
    Type Description
    Matrix

    The new Matrix resulting from the subtraction.

    | Improve this Doc View Source

    Subtraction(SparseMatrix, SparseMatrix)

    Computes the subtraction of two SparseMatrix.

    Declaration
    public static SparseMatrix operator -(SparseMatrix left, SparseMatrix right)
    Parameters
    Type Name Description
    SparseMatrix left

    Left SparseMatrix to subtract.

    SparseMatrix right

    Right SparseMatrix to subtract with.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix resulting from the subtraction.

    | Improve this Doc View Source

    UnaryNegation(SparseMatrix)

    Computes the opposite of the SparseMatrix.

    Declaration
    public static SparseMatrix operator -(SparseMatrix operand)
    Parameters
    Type Name Description
    SparseMatrix operand

    SparseMatrix whose opposite is to be computed.

    Returns
    Type Description
    SparseMatrix

    The SparseMatrix, opposite of the initial one.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IGroupAction<SparseMatrix, Double>.Divide(Double)

    Computes the right scalar division of the current element.

    Declaration
    SparseMatrix IGroupAction<SparseMatrix, double>.Divide(double divisor)
    Parameters
    Type Name Description
    Double divisor
    Returns
    Type Description
    SparseMatrix

    The new element resulting from the scalar dividion.

    | Improve this Doc View Source

    IGroupAction<SparseMatrix, Double>.Multiply(Double)

    Computes the right scalar multiplication of the current element.

    Declaration
    SparseMatrix IGroupAction<SparseMatrix, double>.Multiply(double factor)
    Parameters
    Type Name Description
    Double factor
    Returns
    Type Description
    SparseMatrix

    The new element resulting from the scalar multiplication.

    Implements

    IGroupAction<TSelf, TValue>
    IGroupAction<TSelf, TValue>
    • Improve this Doc
    • View Source
    In This Article
    Back to top By ENPC and the Build'In Platform