-
Notifications
You must be signed in to change notification settings - Fork 1
/
linear_solver_logs.jl
75 lines (66 loc) · 2.31 KB
/
linear_solver_logs.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
############################################################################################
## This file is part of RLinearAlgebra.jl
##
## Overview: abstractions and methods for logging linear system equation solvers, and
## providing stopping rules.
##
## Contents
## - Abstract Types
## - `log_update!` function documentation
## - Loggers
## - Export Statements
##
############################################################################################
# Dependencies: LinearAlgebra
#############################################
# Abstract Types
#############################################
"""
LinSysSolverLog
Abstract supertype for logging information about a randomized linear system solver.
Note, all descendants that are `mutable struct`s must have fields
- `iterations::Int64`, which tracks the number of iterations of the solver
- `converged::Bool`, which tracks whether the solver has converged to the solution (by some
notion of convergence that is specified by the user).
"""
abstract type LinSysSolverLog end
#############################################
# `log_update!` function docstring
#############################################
"""
log_update!(
log::LinSysSolverLog,
sampler::LinSysSampler,
x::AbstractVector,
samp:s:Tuple,
iter::Int64,
A,
b)
A common interface for specifying different strategies for updating the `log` with supertype
`LinSysSolverLog`. A `sampler` of supertype `LinSysSampler` can be used to provide
specific multiple implementations for the same `log` type. `x` is the iterate value.
`samp` is the output generated by the `sample` function (see `linears_samplers.jl`).
`iter` is the current iteration counter. `A` and `b` specify the linear system.
"""
function log_update!(
log::Nothing,
sampler::LinSysSampler,
x::AbstractVector,
samp::Tuple,
iter::Int64,
A,
b
)
return nothing
end
#############################################
# Loggers
#############################################
include("linear_solver_logs/solve_log_oracle.jl")
include("linear_solver_logs/solve_log_full.jl")
include("linear_solver_logs/solve_log_ma.jl")
#############################################
# Exports
#############################################
#export LinSysSolverLog
#export LSLogOracle, LSLogFull