next up previous contents
Next: Telluride Matrix-Vector Multiplication Routine Up: Telluride Solver Options Previous: Vector Derived Type

CG ``Guts''

external User_Precond, User_y_eq_Ax
optional :: User_Precond, User_y_eq_Ax
real(kind=JT_real_type), intent(in), dimension(:) :: b
real(kind=JT_real_type), intent(inout), dimension(:), target :: x

! Local (host code need not know about special vector type): type(JT_vector_type) :: x_vec

[snip]

! Initialize PGSLib scope flag and vector derived types. call JT_InitScope (control%scope) call JT_NullifyVectorAux (x_vec) x_vec%values => x ! note: no copying

[snip; start main loop]

if (control%scope == JT_scope_global) then call JT_DeallocateVectorAux (x_vec) end if

[snip]

call JT_ApplyPrecond (control, coeff, r, w_vec, status, & precond, User_Precond, User_y_eq_Ax)

[snip]

if (PRESENT(User_y_eq_Ax)) then call User_y_eq_Ax (nunk, p_vec, w, status) else w = MatMul(coeff, p) end if

[snip]

call JT_DeallocateVectorAux (x_vec)


next up previous contents
Next: Telluride Matrix-Vector Multiplication Routine Up: Telluride Solver Options Previous: Vector Derived Type

John A. Turner