Cholesky

JudiLing.make_transform_facFunction

The first part of make transform matrix, usually used by the learn_paths function to save time and computing resources.

source
JudiLing.make_transform_matrixMethod
make_transform_matrix(fac::Union{LinearAlgebra.Cholesky, SuiteSparse.CHOLMOD.Factor}, X::Union{SparseMatrixCSC, Matrix}, Y::Union{SparseMatrixCSC, Matrix})

Second step in calculating the Cholesky decomposition for the transformation matrix.

source
JudiLing.make_transform_matrixMethod
make_transform_matrix(X::SparseMatrixCSC, Y::Matrix)

Use Cholesky decomposition to calculate the transformation matrix from X to Y, where X is a sparse matrix and Y is a dense matrix.

Obligatory Arguments

  • X::SparseMatrixCSC: the X matrix, where X is a sparse matrix
  • Y::Matrix: the Y matrix, where Y is a dense matrix

Optional Arguments

  • method::Symbol = :additive: whether :additive or :multiplicative decomposition is required
  • shift::Float64 = 0.02: shift value for :additive decomposition
  • multiplier::Float64 = 1.01: multiplier value for :multiplicative decomposition
  • output_format::Symbol = :auto: to force output format to dense(:dense) or sparse(:sparse), make it auto(:auto) to determined by the program
  • sparse_ratio::Float64 = 0.05: the ratio to decide whether a matrix is sparse
  • verbose::Bool = false: if true, more information will be printed out

Examples

# additive mode
JudiLing.make_transform_matrix(
    C,
    S,
    method = :additive,
    shift = 0.02,
    verbose = false)

# multiplicative mode
JudiLing.make_transform_matrix(
    C,
    S,
    method = :multiplicative,
    multiplier = 1.01,
    verbose = false)

# further control of sparsity ratio
JudiLing.make_transform_matrix(
  ...
    output_format = :auto,
    sparse_ratio = 0.05,
  ...)
source
JudiLing.make_transform_matrixMethod
make_transform_matrix(X::Matrix, Y::Union{SparseMatrixCSC, Matrix})

Use the Cholesky decomposition to calculate the transformation matrix from X to Y, where X is a dense matrix and Y is either a dense matrix or a sparse matrix.

Obligatory Arguments

  • X::Matrix: the X matrix, where X is a dense matrix
  • Y::Union{SparseMatrixCSC, Matrix}: the Y matrix, where Y is either a sparse or a dense matrix

Optional Arguments

  • method::Symbol = :additive: whether :additive or :multiplicative decomposition is required
  • shift::Float64 = 0.02: shift value for :additive decomposition
  • multiplier::Float64 = 1.01: multiplier value for :multiplicative decomposition
  • output_format::Symbol = :auto: to force output format to dense(:dense) or sparse(:sparse), make it auto(:auto) to determined by the program
  • sparse_ratio::Float64 = 0.05: the ratio to decide whether a matrix is sparse
  • verbose::Bool = false: if true, more information will be printed out

Examples

# additive mode
JudiLing.make_transform_matrix(
    C,
    S,
    method = :additive,
    shift = 0.02,
    verbose = false)

# multiplicative mode
JudiLing.make_transform_matrix(
    C,
    S,
    method=:multiplicative,
    multiplier = 1.01,
    verbose = false)

# further control of sparsity ratio
JudiLing.make_transform_matrix(
    ...
    output_format = :auto,
    sparse_ratio = 0.05,
    ...)
source
JudiLing.make_transform_matrixMethod
make_transform_matrix(X::SparseMatrixCSC, Y::SparseMatrixCSC)

Use the Cholesky decomposition to calculate the transformation matrix from X to Y, where X is a sparse matrix and Y is a sparse matrix.

Obligatory Arguments

  • X::SparseMatrixCSC: the X matrix, where X is a sparse matrix
  • Y::SparseMatrixCSC: the Y matrix, where Y is a sparse matrix

Optional Arguments

  • method::Symbol = :additive: whether :additive or :multiplicative decomposition is required
  • shift::Float64 = 0.02: shift value for :additive decomposition
  • multiplier::Float64 = 1.01: multiplier value for :multiplicative decomposition
  • output_format::Symbol = :auto: to force output format to dense(:dense) or sparse(:sparse), make it auto(:auto) to determined by the program
  • sparse_ratio::Float64 = 0.05: the ratio to decide whether a matrix is sparse
  • verbose::Bool = false: if true, more information will be printed out

Examples

# additive mode
JudiLing.make_transform_matrix(
    C,
    S,
    method = :additive,
    shift = 0.02,
    verbose = false)

# multiplicative mode
JudiLing.make_transform_matrix(
    C,
    S,
    method = :multiplicative,
    multiplier = 1.01,
    verbose = false)

# further control of sparsity ratio
JudiLing.make_transform_matrix(
    ...
    output_format = :auto,
    sparse_ratio = 0.05,
    ...)
source
JudiLing.format_matrixFunction
format_matrix(M::Union{SparseMatrixCSC, Matrix}, output_format=:auto)

Convert output matrix format to either a dense matrix or a sparse matrix.

source