src/sparse

Types

SparseMatrix = object
  ia*: seq[int]
  ja*: seq[int]
  aa*: seq[float]
  Source Edit
DynamicVector = seq[float]
  Source Edit

Procs

proc newVector(size: int): DynamicVector {...}{.raises: [], tags: [].}
  Source Edit
proc size(vector: DynamicVector): int {...}{.raises: [], tags: [].}
  Source Edit
proc `+`(a, b: DynamicVector): DynamicVector {...}{.raises: [], tags: [].}
  Source Edit
proc `*`(a: float; b: DynamicVector): DynamicVector {...}{.raises: [], tags: [].}
  Source Edit
proc `-`(a, b: DynamicVector): DynamicVector {...}{.raises: [], tags: [].}
  Source Edit
proc dot(a, b: DynamicVector): float {...}{.raises: [], tags: [].}
Dot product of two vectors a and b.   Source Edit
proc norm(a: DynamicVector): float {...}{.raises: [], tags: [].}
Compute the norm of a.   Source Edit
proc setDiagonalRows(A: var SparseMatrix; rows: seq[int]) {...}{.raises: [], tags: [].}
  Source Edit
proc `*`(A: SparseMatrix; b: DynamicVector): DynamicVector {...}{.raises: [],
    tags: [].}
  Source Edit
proc rows(A: SparseMatrix): int {...}{.raises: [], tags: [].}
  Source Edit
proc cols(A: SparseMatrix): int {...}{.raises: [], tags: [].}
  Source Edit
proc `$`(A: SparseMatrix): string {...}{.raises: [], tags: [].}
  Source Edit
proc getEntry(A: SparseMatrix; i, j: int): float {...}{.raises: [], tags: [].}
  Source Edit
proc getIndex(A: SparseMatrix; i, j: int): int {...}{.raises: [], tags: [].}
  Source Edit
proc nonzero_bounds_row(A: SparseMatrix; row: int): (int, int) {...}{.raises: [],
    tags: [].}
  Source Edit
proc toCSR(Ai, Aj: seq[int]; Ax: seq[float]): SparseMatrix {...}{.raises: [],
    tags: [].}
Convert triplet list format into CSR matrix.   Source Edit