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 DenseVector

    Class defining a dense vector.

    Inheritance
    Object
    Vector
    DenseVector
    Implements
    IDotProduct<Vector, Double>
    INorm<Vector>
    IMetric<Vector>
    IGroupAction<Vector, Double>
    IEquatable<DenseVector>
    IEnumerable<Double>
    IDotProduct<DenseVector, Double>
    INorm<DenseVector>
    IMetric<DenseVector>
    IGroupAction<DenseVector, Double>
    Inherited Members
    Vector.Add(Vector, Vector)
    Vector.Subtract(Vector, Vector)
    Vector.Opposite(Vector)
    Vector.Multiply(Double, Vector)
    Vector.Multiply(Vector, Double)
    Vector.Divide(Vector, Double)
    Vector.TransposeMultiply(Vector, Vector)
    Vector.GramSchmidt(IEnumerable<Vector>)
    Vector.Norm()
    Vector.SquaredNorm()
    Vector.IMetric<Vector>.DistanceTo(Vector)
    Vector.IDotProduct<Vector, Double>.DotProduct(Vector)
    Vector.IGroupAction<Vector, Double>.Multiply(Double)
    Vector.IGroupAction<Vector, Double>.Divide(Double)
    Namespace: BRIDGES.LinearAlgebra.Vectors
    Assembly: BRIDGES.dll
    Syntax
    public sealed class DenseVector : Vector, IDotProduct<Vector, double>, INorm<Vector>, IMetric<Vector>, IGroupAction<Vector, double>, IDotProduct<DenseVector, double>, INorm<DenseVector>, IMetric<DenseVector>, IGroupAction<DenseVector, double>

    Constructors

    | Improve this Doc View Source

    DenseVector(DenseVector)

    Initialises a new instance of the DenseVector class from another DenseVector.

    Declaration
    public DenseVector(DenseVector vector)
    Parameters
    Type Name Description
    DenseVector vector

    DenseVector to deep copy.

    | Improve this Doc View Source

    DenseVector(SparseVector)

    Initialises a new instance of the DenseVector class from a SparseVector.

    Declaration
    public DenseVector(SparseVector vector)
    Parameters
    Type Name Description
    SparseVector vector

    SparseVector to copy.

    | Improve this Doc View Source

    DenseVector(IList<Double>)

    Initialises a new instance of the DenseVector class from its components.

    Declaration
    public DenseVector(IList<double> components)
    Parameters
    Type Name Description
    IList<Double> components

    Components of the DenseVector.

    | Improve this Doc View Source

    DenseVector(Int32)

    Initialises a new instance of the DenseVector class of given size, containing only zeros.

    Declaration
    public DenseVector(int size)
    Parameters
    Type Name Description
    Int32 size

    Number of component of the DenseVector.

    Properties

    | Improve this Doc View Source

    Item[Int32]

    Gets or sets the component at a given index.

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

    Index of the component to get or set.

    Property Value
    Type Description
    Double

    The value of the component.

    Overrides
    Vector.Item[Int32]
    | Improve this Doc View Source

    Size

    Number of component of this vector.

    Declaration
    public override int Size { get; }
    Property Value
    Type Description
    Int32
    Overrides
    Vector.Size

    Methods

    | Improve this Doc View Source

    Add(DenseVector, DenseVector)

    Computes the addition of two DenseVector.

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

    Left DenseVector for the addition.

    DenseVector right

    Right DenseVector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Add(DenseVector, SparseVector)

    Computes the right addition of a DenseVector with a SparseVector.

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

    Left DenseVector for the addition.

    SparseVector right

    Right SparseVector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Add(DenseVector, Vector)

    Computes the right addition of a DenseVector with a Vector.

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

    Left DenseVector for the addition.

    Vector right

    Right Vector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Divide(DenseVector, Double)

    Computes the scalar division of a DenseVector with a number.

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

    DenseVector to divide.

    Double divisor

    number to divide with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the scalar division.

    | Improve this Doc View Source

    Equals(DenseVector)

    Class defining a dense vector.

    Declaration
    public bool Equals(DenseVector other)
    Parameters
    Type Name Description
    DenseVector other
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Equals(Vector)

    Class defining a dense vector.

    Declaration
    public override bool Equals(Vector other)
    Parameters
    Type Name Description
    Vector other
    Returns
    Type Description
    Boolean
    Overrides
    Vector.Equals(Vector)
    | Improve this Doc View Source

    Equals(Object)

    Class defining a dense vector.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    Vector.Equals(Object)
    | Improve this Doc View Source

    GetEnumerator()

    Class defining a dense vector.

    Declaration
    public override IEnumerator<double> GetEnumerator()
    Returns
    Type Description
    IEnumerator<Double>
    Overrides
    Vector.GetEnumerator()
    | Improve this Doc View Source

    GetHashCode()

    Class defining a dense vector.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    Vector.GetHashCode()
    | Improve this Doc View Source

    GramSchmidt(IEnumerable<DenseVector>)

    Ortho-normalise the set of DenseVector using a Gram-Schimdt process.

    Declaration
    public static DenseVector[] GramSchmidt(IEnumerable<DenseVector> vectors)
    Parameters
    Type Name Description
    IEnumerable<DenseVector> vectors

    Set of DenseVector to operate on.

    Returns
    Type Description
    DenseVector[]

    The ortho-normal set of DenseVector.

    Remarks

    If the vectors are not linearly independent the number of vectors will change.

    | Improve this Doc View Source

    Multiply(DenseVector, Double)

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

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

    DenseVector to multiply on the right.

    Double factor

    number to multiply with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the right scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, DenseVector)

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

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

    number to multiply with.

    DenseVector operand

    DenseVector to multiply on the left.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the left scalar multiplication.

    | Improve this Doc View Source

    Opposite(DenseVector)

    Computes the opposite of the DenseVector.

    Declaration
    public static DenseVector Opposite(DenseVector operand)
    Parameters
    Type Name Description
    DenseVector operand

    DenseVector from which the opposite is computed.

    Returns
    Type Description
    DenseVector

    The DenseVector, opposite of the initial one.

    | Improve this Doc View Source

    StandardVector(Int32, Int32)

    Returns the unit DenseVector of a given size, with one at the given row index and zeros elsewhere.

    Declaration
    public static DenseVector StandardVector(int size, int index)
    Parameters
    Type Name Description
    Int32 size

    Size of the DenseVector.

    Int32 index

    Index of the standard vector, i.e of the component equal to one.

    Returns
    Type Description
    DenseVector

    The new DenseVector representing the standard vector.

    | Improve this Doc View Source

    Subtract(DenseVector, DenseVector)

    Computes the subtraction of two DenseVector.

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

    Left DenseVector to subtract.

    DenseVector right

    Right DenseVector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    Subtract(DenseVector, SparseVector)

    Computes the right subtraction of a DenseVector with a SparseVector.

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

    Left DenseVector to subtract.

    SparseVector right

    Right SparseVector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    Subtract(DenseVector, Vector)

    Computes the right subtraction of a DenseVector with a Vector.

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

    Left DenseVector to subtract.

    Vector right

    Right Vector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    ToArray()

    Translates this vector into its array representation.

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

    The array representing the vector.

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

    ToString()

    Class defining a dense vector.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Vector.ToString()
    | Improve this Doc View Source

    TransposeMultiply(DenseVector, DenseVector)

    Computes the multiplication between the transposed left DenseVector and the right DenseVector.

    Declaration
    public static double TransposeMultiply(DenseVector left, DenseVector right)
    Parameters
    Type Name Description
    DenseVector left

    Left DenseVector to transpose, then multiply.

    DenseVector right

    Right DenseVector to multiply.

    Returns
    Type Description
    Double

    The scalar value resulting from the operation.

    | Improve this Doc View Source

    TransposeMultiply(DenseVector, SparseVector)

    Computes the multiplication between the transposed left DenseVector and the right SparseVector.

    Declaration
    public static double TransposeMultiply(DenseVector left, SparseVector right)
    Parameters
    Type Name Description
    DenseVector left

    Left DenseVector to transpose, then multiply.

    SparseVector right

    Right SparseVector to multiply.

    Returns
    Type Description
    Double

    The scalar value resulting from the operation.

    | Improve this Doc View Source

    TransposeMultiply(DenseVector, Vector)

    Computes the multiplication between the transposed left DenseVector and the right Vector.

    Declaration
    public static double TransposeMultiply(DenseVector left, Vector right)
    Parameters
    Type Name Description
    DenseVector left

    Left DenseVector to transpose, then multiply.

    Vector right

    Right Vector to multiply.

    Returns
    Type Description
    Double

    The scalar value resulting from the operation.

    | Improve this Doc View Source

    Zero(Int32)

    Returns the neutral DenseVector for the addition.

    Declaration
    public static DenseVector Zero(int size)
    Parameters
    Type Name Description
    Int32 size

    Number of component of the DenseVector.

    Returns
    Type Description
    DenseVector

    The DenseVector of the given size, with zeros on every coordinates.

    Operators

    | Improve this Doc View Source

    Addition(DenseVector, DenseVector)

    Computes the addition of two DenseVector.

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

    Left DenseVector for the addition.

    DenseVector right

    Right DenseVector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Addition(DenseVector, SparseVector)

    Computes the right addition of a DenseVector with a SparseVector.

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

    Left DenseVector for the addition.

    SparseVector right

    Right SparseVector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Addition(DenseVector, Vector)

    Computes the right addition of a DenseVector with a Vector.

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

    Left DenseVector for the addition.

    Vector right

    Right Vector for the addition.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the addition.

    | Improve this Doc View Source

    Division(DenseVector, Double)

    Computes the scalar division of a DenseVector with a number.

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

    DenseVector to divide.

    Double divisor

    number to divide with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the scalar division.

    | Improve this Doc View Source

    Equality(DenseVector, DenseVector)

    Evaluates whether two DenseVector are equal or not.

    Declaration
    public static bool operator ==(DenseVector left, DenseVector right)
    Parameters
    Type Name Description
    DenseVector left

    Left DenseVector for the comparison.

    DenseVector right

    Right DenseVector for the comparison.

    Returns
    Type Description
    Boolean

    true if the two DenseVector are equal, false otherwise.

    | Improve this Doc View Source

    Inequality(DenseVector, DenseVector)

    Evaluates whether two DenseVector are different.

    Declaration
    public static bool operator !=(DenseVector left, DenseVector right)
    Parameters
    Type Name Description
    DenseVector left

    Left DenseVector for the comparison.

    DenseVector right

    Right DenseVector for the comparison.

    Returns
    Type Description
    Boolean

    true if the two DenseVector are different, false otherwise.

    | Improve this Doc View Source

    Multiply(DenseVector, Double)

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

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

    DenseVector to multiply on the right.

    Double factor

    number to multiply with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the right scalar multiplication.

    | Improve this Doc View Source

    Multiply(Double, DenseVector)

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

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

    number to multiply with.

    DenseVector operand

    DenseVector to multiply on the left.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the left scalar multiplication.

    | Improve this Doc View Source

    Subtraction(DenseVector, DenseVector)

    Computes the subtraction of two DenseVector.

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

    Left DenseVector to subtract.

    DenseVector right

    Right DenseVector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    Subtraction(DenseVector, SparseVector)

    Computes the right subtraction of a DenseVector with a SparseVector.

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

    Left DenseVector to subtract.

    SparseVector right

    Right SparseVector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    Subtraction(DenseVector, Vector)

    Computes the right subtraction of a DenseVector with a Vector.

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

    Left DenseVector to subtract.

    Vector right

    Right Vector to subtract with.

    Returns
    Type Description
    DenseVector

    The new DenseVector resulting from the subtraction.

    | Improve this Doc View Source

    UnaryNegation(DenseVector)

    Computes the opposite of the DenseVector.

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

    DenseVector from which the opposite is computed.

    Returns
    Type Description
    DenseVector

    The DenseVector, opposite of the initial one.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IDotProduct<DenseVector, Double>.DotProduct(DenseVector)

    Computes the dot product of this element with another element.

    Declaration
    double IDotProduct<DenseVector, double>.DotProduct(DenseVector other)
    Parameters
    Type Name Description
    DenseVector other
    Returns
    Type Description
    Double

    The value of the dot product of the two elements.

    | Improve this Doc View Source

    IMetric<DenseVector>.DistanceTo(DenseVector)

    Computes the distance of this element to another element.

    Declaration
    double IMetric<DenseVector>.DistanceTo(DenseVector other)
    Parameters
    Type Name Description
    DenseVector other
    Returns
    Type Description
    Double

    The value of the distance between the two elements.

    | Improve this Doc View Source

    IGroupAction<DenseVector, Double>.Divide(Double)

    Computes the right scalar division of the current element.

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

    The new element resulting from the scalar dividion.

    | Improve this Doc View Source

    IGroupAction<DenseVector, Double>.Multiply(Double)

    Computes the right scalar multiplication of the current element.

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

    The new element resulting from the scalar multiplication.

    Implements

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