The cl-iterative Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-iterative Reference Manual

This is the cl-iterative Reference Manual, version 0.1.0, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 13:44:43 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

#+TITLE: CL-ITERATIVE

* Introduction
All linearly iterative algorithms can be transformed into the form
=x=f(x)= for some value =x= and some function =f(x)=. This system
provides a way to perform an iterative algorithm as a process of
finding the solution of this equation.

Furthermore, many existing implementations provide very limited
control over how iterations are performed: what if the value is bound
and the iterative step takes it out the boundaries? what if one wants
to log the progress of computation? what if the computation needs to
be stopped after some iterations?.. =CL-ITERATIVE= system provides the
refined control over the progress of iterations by means of special
structures called (unsurprisingly) /controls/.

The library was tested with SBCL (1.2.14) and ECL (15.3.7) on Linux
(Ubuntu 15.10 x86-64).

* Modus operandi

The key idea of the method is to perform the computation only if
=ITERATOR:ITERATOR= object is in state =CONTINUE= and stop otherwise
(for category theory lovers and purists: =ITERATOR:ITERATOR= is
amalgamated =Either= monad on top of another =Either= monad).

The state of computation can be changed by means of controls. This
system provides the following controls:
- =FINISHED-VALUE= :: successfully stops the computation if certain
     condition on computation value is reached.
- =FAILED-VALUE= :: stops the computation with a failure if certain
     condition on computation value is reached.
- =LIMIT-ITERATIONS= :: stops the computation with a failure if number
     of iterations exceeds the limit.
- =LOG-COMPUTATION= :: logs the progress of iterative computation, can
     be viewed as a probe.
- =CONVERGED-VALUE= :: successfully stops the computation if the value
     has converged in some sense (using user-specified predicate of
     closeness =CLOSE-P=; for mathematical purists: user specifies the
     topology of the computation space).
- =CONVERGED-NUMBER= :: simplified version of =CONVERGED-VALUE= for
     numbers where closeness is defined as =|x-y| 0
        ;; due to quadratic convergence of the algorithm
        (assert successful-p () "Could not find the square root of S = ~A" s)
        ;; Just for illustrative purposes: return extra info - why computation
        ;; was stopped?
        (values final-x info))))
#+END_SRC

If want to find square root of 4,
#+BEGIN_EXAMPLE
> (sqrt-heron 4d0)
2.0d0
((:CONVERGED-NUMBER))
#+END_EXAMPLE

If we want to peek into how the computation proceeds, we can add the
logging function:

#+BEGIN_SRC lisp
  (defun sqrt-heron (s)
    (flet ((improve (x)
             (* 0.5d0 (+ x (/ s x))))
           (log-function (indicator x)           ; log computation
             (if (eq indicator :init)
                 (format t "~&INIT: x = ~A~%" x)
                 (format t "~&x = ~A~%" x))))
      (multiple-value-bind (final-x successful-p info)
          (fixed-point
           #'improve 1d0
           :pre-treat (add-info)
           :controls (combine-controls
                      (log-computation #'log-function) ; add it before convergence test
                      (converged-number-with-id)
                      (limit-iterations-with-id 20)))
        (assert successful-p () "Could not find the square root of S = ~A" s)
        (values final-x info))))
#+END_SRC

Then, the output and the result will look as follows:

#+BEGIN_EXAMPLE
> (sqrt-heron 4d0)
INIT: x = 1.0d0
x = 2.5d0
x = 2.05d0
x = 2.000609756097561d0
x = 2.0000000929222947d0
x = 2.000000000000002d0
x = 2.0d0
2.0d0
((:CONVERGED-NUMBER))
#+END_EXAMPLE

Check the system =CL-ITERATIVE-TESTS= for more examples.

* License

Copyright (c) 2016 Alexey Cherkaev

Distributed under [[https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiny8GhzPfKAhUFCBoKHQJjAqoQFggdMAA&url=http%3A%2F%2Fwww.gnu.org%2Flicenses%2Flgpl-3.0.en.html&usg=AFQjCNH0YhKhWIzlQpbpN7pxqZ_1g6XuPw&sig2=gQ6rswjeI4TgwERG0jRzhA][LGPLv3]] license.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-iterative

Author

Alexey Cherkaev (mobius-eng)

License

LGPLv3

Description

Generic iterative algorithm with multiple controls

Version

0.1.0

Dependencies
Source

cl-iterative.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-iterative.asd

Location

cl-iterative.asd

Systems

cl-iterative (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-iterative/package.lisp

Parent

cl-iterative (system)

Location

package.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-iterative/iterator.lisp

Dependency

package.lisp (file)

Parent

cl-iterative (system)

Location

iterator.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-iterative/cl-iterative.lisp

Dependency

iterator.lisp (file)

Parent

cl-iterative (system)

Location

cl-iterative.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.5 cl-iterative/iteratorex.lisp

Dependency

cl-iterative.lisp (file)

Parent

cl-iterative (system)

Location

iteratorex.lisp

Exported Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.6 cl-iterative/cl-iterative-ex.lisp

Dependency

iteratorex.lisp (file)

Parent

cl-iterative (system)

Location

cl-iterative-ex.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-iterative-ex

Upgrades controls from CL-ITERATIVE to work with ITERATOREX

Source

package.lisp (file)

Use List
Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.2 iteratorex

Extension of ITERATOR to annotate it with INFO

Source

package.lisp (file)

Use List
Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

4.3 cl-iterative

Control of computation flow and iterative algorithm

Source

package.lisp (file)

Use List
Used By List
Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.4 iterator

Computation flow

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: define-simple-constructor CLASS (&rest ARGS)

Make simple constuctor with boa arguments for CLASS

Package

cl-iterative

Source

cl-iterative.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: ->continue ITERATOR &optional UPDATE-VALUE-FUNCTION

Change status of the ITERATOR to :CONTINUE

Package

iterator

Source

iterator.lisp (file)

Function: ->failed ITERATOR &optional UPDATE-VALUE-FUNCTION

Change status of the ITERATOR to :FAILED

Package

iterator

Source

iterator.lisp (file)

Function: ->finished ITERATOR &optional UPDATE-VALUE-FUNCTION

Change status of the ITERATOR to :FINISHED

Package

iterator

Source

iterator.lisp (file)

Function: add-info &optional INIT-INFO

Constructs ADD-INFO control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: alter-value FUNCTION
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: bind ITERATOR &rest FUNCTIONS

Propogates ITERATOR’s value through FUNCTIONS iff its status is :CONTINUE. Each function must accept iterator’s value and return a new iterator.

Package

iterator

Source

iterator.lisp (file)

Function: change-status ITERATOR NEW-STATUS &optional UPDATE-VALUE-FUNCTION

Destructively change iterator’s status

Package

iterator

Source

iterator.lisp (file)

Function: combine-controls &rest CONTROLS

Combine controls forming a generic control. Controls are applied in order they appear

Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: continue VAL

Make contine iterator

Package

iterator

Source

iterator.lisp (file)

Function: continue-p ITERATOR

Is ITERATOR :CONTINUE?

Package

iterator

Source

iterator.lisp (file)

Function: control INIT APPLY
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: converged-number &optional TOLERANCE
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: converged-number-with-id &optional ID TOLERANCE

Constructs CONVERGED-NUMBER-WITH-ID control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: converged-value CLOSE-P COPY &optional FINAL
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: converged-value-with-id CLOSE-P COPY &optional ID FINAL

Constructs CONVERGED-VALUE-WITH-ID control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: failed VAL

Make failed iterator

Package

iterator

Source

iterator.lisp (file)

Function: failed-p ITERATOR

Is ITERATOR :FAILED?

Package

iterator

Source

iterator.lisp (file)

Function: failed-value PREDICATE &optional FINAL
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: failed-value-with-id PREDICATE &optional ID FINAL

Constructs FAILED-VALUE-WITH-ID control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: finished VAL

Make finished iterator

Package

iterator

Source

iterator.lisp (file)

Function: finished-p ITERATOR

Is ITERATOR :FINISHED?

Package

iterator

Source

iterator.lisp (file)

Function: finished-value PREDICATE &optional FINAL
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: finished-value-with-id PREDICATE &optional ID FINAL

Constructs FINIED-VALUE-WITH-ID control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: fixed-point FUNCTION INIT-VALUE &key PRE-TREAT CONTROLS POST-TREAT

Fixed point method solving x=f(x) starting from x0.
CONTROL is an object implementing control protocol: INIT-CONTROL and APPLY-CONTROL.
FUNCTION might change INIT-VALUE destuctively
Returns (VALUES SOLUTION SOLVED-P INDICATOR), where
SOLUTION is the final result,
SOLVED-P is the indicator if the solution was reached successfully, INDICATOR is an extra indicator of what could have gone wrong.

Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: fmap ITERATOR &rest FUNCTIONS

Update iterators value iff it is :CONTINUE

Package

iterator

Source

iterator.lisp (file)

Function: iterate Y0 ITER-COMPUTATION &optional PRE-TREAT POST-TREAT

Iteratively apply CONTROL to iterator Y0 until it finishes

Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: iterator STATUS VALUE

Constructs ITERATOR with given STATUS and VALUE

Package

iterator

Source

iterator.lisp (file)

Function: limit-iterations MAX &optional FINAL
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: limit-iterations-with-id MAX &optional ID FINAL

Constructs LIMIT-ITERATIONS-WITH-ID control

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Function: log-computation LOG-FUNCTION
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: replace-value ITERATOR NEW-VALUE

Destrcutively change ITERATOR’s value

Package

iterator

Source

iterator.lisp (file)

Function: update-value ()

Destructively update ITERATOR’s value

Package

iterator

Source

iterator.lisp (file)

Function: upgrade ITERATOR &optional INFO
Package

iteratorex

Source

iteratorex.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: apply-control CONTROL VALUE

Apply CONTROL to a VALUE. CONTROL must return ITERATOR

Package

cl-iterative

Source

cl-iterative.lisp (file)

Methods
Method: apply-control (CONTROL control-with-id) (VALUE iteratorex) after
Source

cl-iterative-ex.lisp (file)

Method: apply-control (CONTROL add-info) (VAL iteratorex)
Source

cl-iterative-ex.lisp (file)

Method: apply-control (CONTROL add-info) (VAL iterator)
Source

cl-iterative-ex.lisp (file)

Method: apply-control (CONTROL control) VALUE
Method: apply-control (CONTROL alter-value) VALUE
Method: apply-control (CONTROL converged-number) VALUE
Method: apply-control (CONTROL converged-value) VALUE
Method: apply-control (CONTROL log-computation) VALUE
Method: apply-control (CONTROL limit-iterations) VALUE
Method: apply-control (CONTROL change-status) VALUE
Method: apply-control CONTROL VALUE
Generic Function: control-apply-function OBJECT
Generic Function: (setf control-apply-function) NEW-VALUE OBJECT
Package

cl-iterative

Methods
Method: control-apply-function (CONTROL control)
Method: (setf control-apply-function) NEW-VALUE (CONTROL control)

A generic control apply function

Source

cl-iterative.lisp (file)

Generic Function: control-id OBJECT
Package

cl-iterative-ex

Methods
Method: control-id OBJ
Source

cl-iterative-ex.lisp (file)

Method: control-id (CONTROL-WITH-ID control-with-id)

automatically generated reader method

Source

cl-iterative-ex.lisp (file)

Generic Function: control-init-function OBJECT
Generic Function: (setf control-init-function) NEW-VALUE OBJECT
Package

cl-iterative

Methods
Method: control-init-function (CONTROL control)
Method: (setf control-init-function) NEW-VALUE (CONTROL control)

A generic control init function

Source

cl-iterative.lisp (file)

Generic Function: fixed-point-result-indicator ITERATOR

Returns the indicator of the cause of the final result

Package

cl-iterative

Source

cl-iterative.lisp (file)

Methods
Method: fixed-point-result-indicator (ITERATOR iteratorex)
Source

cl-iterative-ex.lisp (file)

Method: fixed-point-result-indicator (ITERATOR iterator)
Generic Function: info OBJECT
Generic Function: (setf info) NEW-VALUE OBJECT
Package

iteratorex

Methods
Method: info (OBJ iterator)
Source

iteratorex.lisp (file)

Method: info (ITERATOREX iteratorex)

automatically generated reader method

Source

iteratorex.lisp (file)

Method: (setf info) NEW-VALUE (ITERATOREX iteratorex)

automatically generated writer method

Source

iteratorex.lisp (file)

Generic Function: init-control CONTROL INIT-VALUE

Initialize CONTROL using INIT-VALUE. Useful for stateful controls

Package

cl-iterative

Source

cl-iterative.lisp (file)

Methods
Method: init-control (CONTROL control) INIT-VALUE
Method: init-control (CONTROL converged-number) INIT-VALUE
Method: init-control (CONTROL converged-value) INIT-VALUE
Method: init-control (CONTROL log-computation) INIT-VALUE
Method: init-control (CONTROL limit-iterations) INIT-VALUE
Method: init-control CONTROL INIT-VALUE
Generic Function: init-info OBJECT
Package

cl-iterative-ex

Methods
Method: init-info (ADD-INFO add-info)

automatically generated reader method

Source

cl-iterative-ex.lisp (file)

Generic Function: push-info-p OBJECT
Package

cl-iterative-ex

Methods
Method: push-info-p OBJ
Source

cl-iterative-ex.lisp (file)

Method: push-info-p (CONTROL-WITH-ID control-with-id)

automatically generated reader method

Source

cl-iterative-ex.lisp (file)

Generic Function: status OBJECT
Generic Function: (setf status) NEW-VALUE OBJECT
Package

iterator

Methods
Method: status (ITERATOR iterator)
Method: (setf status) NEW-VALUE (ITERATOR iterator)

Iterator status: :continue :finished or :failed

Source

iterator.lisp (file)

Generic Function: value OBJECT
Generic Function: (setf value) NEW-VALUE OBJECT
Package

iterator

Methods
Method: value (ITERATOR iterator)
Method: (setf value) NEW-VALUE (ITERATOR iterator)

Iterator value

Source

iterator.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Classes

Class: add-info ()

Control that adds info to an iterator

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: init-info
Initargs

:init-info

Readers

init-info (generic function)

Class: alter-value ()

Control that alters the value if, for example, it is outside of some boundaries. The behaviour is control by FUNCTION.

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: alter-value-function

Function that alters the value. Must return ITERATOR

Initargs

:function

Readers

alter-value-function (generic function)

Class: control ()

A generic control class. It is used to combine other controls.

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: control-init-function

A generic control init function

Initargs

:init

Readers

control-init-function (generic function)

Writers

(setf control-init-function) (generic function)

Slot: control-apply-function

A generic control apply function

Initargs

:apply

Readers

control-apply-function (generic function)

Writers

(setf control-apply-function) (generic function)

Class: control-with-id ()

Control mixin that adds ID to other controls

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: id
Initargs

:id

Readers

control-id (generic function)

Slot: push-info-p
Initargs

:push-info-p

Readers

push-info-p (generic function)

Class: converged-number ()

Control that will finish the computation if the number sequence converges. This is a simplified (for numbers) version of CONVERGED-VALUE

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

converged-number-with-id (class)

Direct methods
Direct slots
Slot: converged-number-tolerance

Absolute tolerance within which two numbers are considered to be the same

Initargs

:tolerance

Readers

converged-number-tolerance (generic function)

Slot: converged-number-last

Internal storage of the previous item in the sequence

Readers

converged-number-last (generic function)

Writers

(setf converged-number-last) (generic function)

Class: converged-number-with-id ()

Extension of CONVERGED-NUMBER with ID info

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses
Class: converged-value ()

Controls if the sequence of values is converged (Cauchy criteria) Since the value might change destructively, it requires COPY function to store the copy of the previous value in the sequence

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

converged-value-with-id (class)

Direct methods
Direct slots
Slot: converged-value-close-p

Predicate that checks if two values are close enough for the sequence to be considered convergent

Initargs

:close-p

Readers

converged-value-close-p (generic function)

Slot: converged-value-copy

Reliably copy the value: the value itself might be
detroyed during the computation, this function must be able to copy it to reliably compare previus and current value in the sequence

Initargs

:copy

Readers

converged-value-copy (generic function)

Slot: converged-value-final

Final function to apply to value once converged

Initargs

:final

Readers

converged-value-final (generic function)

Slot: converged-value-last

Internal: stores the previous value (copied) of the sequence

Readers

converged-value-last (generic function)

Writers

(setf converged-value-last) (generic function)

Class: converged-value-with-id ()

Extension of CONVERGED-VALUE with ID info

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses
Class: failed-value ()

Change computation to failed if predicate returns T

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

change-status (class)

Direct subclasses

failed-value-with-id (class)

Direct slots
Slot: change-status-target
Initform

(function iterator:->failed)

Class: failed-value-with-id ()

Extension of FAILED-VALUE with ID info

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses
Class: finished-value ()

Change computation to finish if predicate returns T

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

change-status (class)

Direct subclasses

finished-value-with-id (class)

Direct slots
Slot: change-status-target
Initform

(function iterator:->finished)

Class: finished-value-with-id ()

Extension of FINISHED-VALUE with ID info

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses
Class: iterator ()

Computation flow status

Package

iterator

Source

iterator.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

iteratorex (class)

Direct methods
Direct slots
Slot: status

Iterator status: :continue :finished or :failed

Initargs

:status

Readers

status (generic function)

Writers

(setf status) (generic function)

Slot: value

Iterator value

Initargs

:value

Readers

value (generic function)

Writers

(setf value) (generic function)

Class: iteratorex ()
Package

iteratorex

Source

iteratorex.lisp (file)

Direct superclasses

iterator (class)

Direct methods
Direct slots
Slot: info
Readers

info (generic function)

Writers

(setf info) (generic function)

Class: limit-iterations ()

Control that fails computation if it exceeds max number of evaluations

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses

limit-iterations-with-id (class)

Direct methods
Direct slots
Slot: limit-iterations-max

Max number of evaluations permitted

Initargs

:max

Readers

limit-iterations-max (generic function)

Slot: limit-iterations-final

Final function to apply to value once failed

Initargs

:final

Readers

limit-iterations-final (generic function)

Slot: limit-iterations-performed

Internal storage of the number of evaluations already performed

Initform

0

Readers

limit-iterations-performed (generic function)

Writers

(setf limit-iterations-performed) (generic function)

Class: limit-iterations-with-id ()

Extension of LIMIT-ITERATIONS with ID info

Package

cl-iterative-ex

Source

cl-iterative-ex.lisp (file)

Direct superclasses
Class: log-computation ()

Control that logs the progress of computation

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: log-function

Function to log the computation process.
Accepts two arguments: (TAG VALUE)
TAG is either :INIT or :APPLY indicating at which point it was called VALUE is ITERATOR’s value passed.

Initargs

:log-function

Readers

log-function (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: iterator-p OBJ

Returns T if a given OBJ is ITERATOR

Package

iterator

Source

iterator.lisp (file)

Function: reduce-list ()

Reduce (fold left) LIST with FUNCTION starting from INIT-STATE. Supports shortcircuiting if FUNCTION returns REDUCED value

Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: reduced X
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: reduced-p X
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: reduced-value X
Package

cl-iterative

Source

cl-iterative.lisp (file)

Function: status-p OBJ STATUS

If OBJ is ITERATOR checks its STATUS

Package

iterator

Source

iterator.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Generic functions

Generic Function: alter-value-function OBJECT
Package

cl-iterative

Methods
Method: alter-value-function (ALTER-VALUE alter-value)

Function that alters the value. Must return ITERATOR

Source

cl-iterative.lisp (file)

Generic Function: change-status-final OBJECT
Package

cl-iterative

Methods
Method: change-status-final (CHANGE-STATUS change-status)

Final transformation to apply to value once predicate is T

Source

cl-iterative.lisp (file)

Generic Function: change-status-pred OBJECT
Package

cl-iterative

Methods
Method: change-status-pred (CHANGE-STATUS change-status)

Predicate on the value of ITERATOR

Source

cl-iterative.lisp (file)

Generic Function: change-status-target OBJECT
Package

cl-iterative

Methods
Method: change-status-target (CHANGE-STATUS change-status)

Function of iterator changing the status

Source

cl-iterative.lisp (file)

Generic Function: converged-number-last OBJECT
Generic Function: (setf converged-number-last) NEW-VALUE OBJECT
Package

cl-iterative

Methods
Method: converged-number-last (CONVERGED-NUMBER converged-number)
Method: (setf converged-number-last) NEW-VALUE (CONVERGED-NUMBER converged-number)

Internal storage of the previous item in the sequence

Source

cl-iterative.lisp (file)

Generic Function: converged-number-tolerance OBJECT
Package

cl-iterative

Methods
Method: converged-number-tolerance (CONVERGED-NUMBER converged-number)

Absolute tolerance within which two numbers are considered to be the same

Source

cl-iterative.lisp (file)

Generic Function: converged-value-close-p OBJECT
Package

cl-iterative

Methods
Method: converged-value-close-p (CONVERGED-VALUE converged-value)

Predicate that checks if two values are close enough for the sequence to be considered convergent

Source

cl-iterative.lisp (file)

Generic Function: converged-value-copy OBJECT
Package

cl-iterative

Methods
Method: converged-value-copy (CONVERGED-VALUE converged-value)

Reliably copy the value: the value itself might be
detroyed during the computation, this function must be able to copy it to reliably compare previus and current value in the sequence

Source

cl-iterative.lisp (file)

Generic Function: converged-value-final OBJECT
Package

cl-iterative

Methods
Method: converged-value-final (CONVERGED-VALUE converged-value)

Final function to apply to value once converged

Source

cl-iterative.lisp (file)

Generic Function: converged-value-last OBJECT
Generic Function: (setf converged-value-last) NEW-VALUE OBJECT
Package

cl-iterative

Methods
Method: converged-value-last (CONVERGED-VALUE converged-value)
Method: (setf converged-value-last) NEW-VALUE (CONVERGED-VALUE converged-value)

Internal: stores the previous value (copied) of the sequence

Source

cl-iterative.lisp (file)

Generic Function: limit-iterations-final OBJECT
Package

cl-iterative

Methods
Method: limit-iterations-final (LIMIT-ITERATIONS limit-iterations)

Final function to apply to value once failed

Source

cl-iterative.lisp (file)

Generic Function: limit-iterations-max OBJECT
Package

cl-iterative

Methods
Method: limit-iterations-max (LIMIT-ITERATIONS limit-iterations)

Max number of evaluations permitted

Source

cl-iterative.lisp (file)

Generic Function: limit-iterations-performed OBJECT
Generic Function: (setf limit-iterations-performed) NEW-VALUE OBJECT
Package

cl-iterative

Methods
Method: limit-iterations-performed (LIMIT-ITERATIONS limit-iterations)
Method: (setf limit-iterations-performed) NEW-VALUE (LIMIT-ITERATIONS limit-iterations)

Internal storage of the number of evaluations already performed

Source

cl-iterative.lisp (file)

Generic Function: log-function OBJECT
Package

cl-iterative

Methods
Method: log-function (LOG-COMPUTATION log-computation)

Function to log the computation process.
Accepts two arguments: (TAG VALUE)
TAG is either :INIT or :APPLY indicating at which point it was called VALUE is ITERATOR’s value passed.

Source

cl-iterative.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Classes

Class: change-status ()

Base class for control changing status based on predicate on value

Package

cl-iterative

Source

cl-iterative.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: change-status-pred

Predicate on the value of ITERATOR

Initargs

:predicate

Readers

change-status-pred (generic function)

Slot: change-status-final

Final transformation to apply to value once predicate is T

Initargs

:final

Initform

(function identity)

Readers

change-status-final (generic function)

Slot: change-status-target

Function of iterator changing the status

Readers

change-status-target (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-iterative.asd: The cl-iterative<dot>asd file
cl-iterative/cl-iterative-ex.lisp: The cl-iterative/cl-iterative-ex<dot>lisp file
cl-iterative/cl-iterative.lisp: The cl-iterative/cl-iterative<dot>lisp file
cl-iterative/iterator.lisp: The cl-iterative/iterator<dot>lisp file
cl-iterative/iteratorex.lisp: The cl-iterative/iteratorex<dot>lisp file
cl-iterative/package.lisp: The cl-iterative/package<dot>lisp file

F
File, Lisp, cl-iterative.asd: The cl-iterative<dot>asd file
File, Lisp, cl-iterative/cl-iterative-ex.lisp: The cl-iterative/cl-iterative-ex<dot>lisp file
File, Lisp, cl-iterative/cl-iterative.lisp: The cl-iterative/cl-iterative<dot>lisp file
File, Lisp, cl-iterative/iterator.lisp: The cl-iterative/iterator<dot>lisp file
File, Lisp, cl-iterative/iteratorex.lisp: The cl-iterative/iteratorex<dot>lisp file
File, Lisp, cl-iterative/package.lisp: The cl-iterative/package<dot>lisp file

L
Lisp File, cl-iterative.asd: The cl-iterative<dot>asd file
Lisp File, cl-iterative/cl-iterative-ex.lisp: The cl-iterative/cl-iterative-ex<dot>lisp file
Lisp File, cl-iterative/cl-iterative.lisp: The cl-iterative/cl-iterative<dot>lisp file
Lisp File, cl-iterative/iterator.lisp: The cl-iterative/iterator<dot>lisp file
Lisp File, cl-iterative/iteratorex.lisp: The cl-iterative/iteratorex<dot>lisp file
Lisp File, cl-iterative/package.lisp: The cl-iterative/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (   -  
A   B   C   D   F   G   I   L   M   P   R   S   U   V  
Index Entry  Section

(
(setf control-apply-function): Exported generic functions
(setf control-apply-function): Exported generic functions
(setf control-init-function): Exported generic functions
(setf control-init-function): Exported generic functions
(setf converged-number-last): Internal generic functions
(setf converged-number-last): Internal generic functions
(setf converged-value-last): Internal generic functions
(setf converged-value-last): Internal generic functions
(setf info): Exported generic functions
(setf info): Exported generic functions
(setf limit-iterations-performed): Internal generic functions
(setf limit-iterations-performed): Internal generic functions
(setf status): Exported generic functions
(setf status): Exported generic functions
(setf value): Exported generic functions
(setf value): Exported generic functions

-
->continue: Exported functions
->failed: Exported functions
->finished: Exported functions

A
add-info: Exported functions
alter-value: Exported functions
alter-value-function: Internal generic functions
alter-value-function: Internal generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions
apply-control: Exported generic functions

B
bind: Exported functions

C
change-status: Exported functions
change-status-final: Internal generic functions
change-status-final: Internal generic functions
change-status-pred: Internal generic functions
change-status-pred: Internal generic functions
change-status-target: Internal generic functions
change-status-target: Internal generic functions
combine-controls: Exported functions
continue: Exported functions
continue-p: Exported functions
control: Exported functions
control-apply-function: Exported generic functions
control-apply-function: Exported generic functions
control-id: Exported generic functions
control-id: Exported generic functions
control-id: Exported generic functions
control-init-function: Exported generic functions
control-init-function: Exported generic functions
converged-number: Exported functions
converged-number-last: Internal generic functions
converged-number-last: Internal generic functions
converged-number-tolerance: Internal generic functions
converged-number-tolerance: Internal generic functions
converged-number-with-id: Exported functions
converged-value: Exported functions
converged-value-close-p: Internal generic functions
converged-value-close-p: Internal generic functions
converged-value-copy: Internal generic functions
converged-value-copy: Internal generic functions
converged-value-final: Internal generic functions
converged-value-final: Internal generic functions
converged-value-last: Internal generic functions
converged-value-last: Internal generic functions
converged-value-with-id: Exported functions

D
define-simple-constructor: Exported macros

F
failed: Exported functions
failed-p: Exported functions
failed-value: Exported functions
failed-value-with-id: Exported functions
finished: Exported functions
finished-p: Exported functions
finished-value: Exported functions
finished-value-with-id: Exported functions
fixed-point: Exported functions
fixed-point-result-indicator: Exported generic functions
fixed-point-result-indicator: Exported generic functions
fixed-point-result-indicator: Exported generic functions
fmap: Exported functions
Function, ->continue: Exported functions
Function, ->failed: Exported functions
Function, ->finished: Exported functions
Function, add-info: Exported functions
Function, alter-value: Exported functions
Function, bind: Exported functions
Function, change-status: Exported functions
Function, combine-controls: Exported functions
Function, continue: Exported functions
Function, continue-p: Exported functions
Function, control: Exported functions
Function, converged-number: Exported functions
Function, converged-number-with-id: Exported functions
Function, converged-value: Exported functions
Function, converged-value-with-id: Exported functions
Function, failed: Exported functions
Function, failed-p: Exported functions
Function, failed-value: Exported functions
Function, failed-value-with-id: Exported functions
Function, finished: Exported functions
Function, finished-p: Exported functions
Function, finished-value: Exported functions
Function, finished-value-with-id: Exported functions
Function, fixed-point: Exported functions
Function, fmap: Exported functions
Function, iterate: Exported functions
Function, iterator: Exported functions
Function, iterator-p: Internal functions
Function, limit-iterations: Exported functions
Function, limit-iterations-with-id: Exported functions
Function, log-computation: Exported functions
Function, reduce-list: Internal functions
Function, reduced: Internal functions
Function, reduced-p: Internal functions
Function, reduced-value: Internal functions
Function, replace-value: Exported functions
Function, status-p: Internal functions
Function, update-value: Exported functions
Function, upgrade: Exported functions

G
Generic Function, (setf control-apply-function): Exported generic functions
Generic Function, (setf control-init-function): Exported generic functions
Generic Function, (setf converged-number-last): Internal generic functions
Generic Function, (setf converged-value-last): Internal generic functions
Generic Function, (setf info): Exported generic functions
Generic Function, (setf limit-iterations-performed): Internal generic functions
Generic Function, (setf status): Exported generic functions
Generic Function, (setf value): Exported generic functions
Generic Function, alter-value-function: Internal generic functions
Generic Function, apply-control: Exported generic functions
Generic Function, change-status-final: Internal generic functions
Generic Function, change-status-pred: Internal generic functions
Generic Function, change-status-target: Internal generic functions
Generic Function, control-apply-function: Exported generic functions
Generic Function, control-id: Exported generic functions
Generic Function, control-init-function: Exported generic functions
Generic Function, converged-number-last: Internal generic functions
Generic Function, converged-number-tolerance: Internal generic functions
Generic Function, converged-value-close-p: Internal generic functions
Generic Function, converged-value-copy: Internal generic functions
Generic Function, converged-value-final: Internal generic functions
Generic Function, converged-value-last: Internal generic functions
Generic Function, fixed-point-result-indicator: Exported generic functions
Generic Function, info: Exported generic functions
Generic Function, init-control: Exported generic functions
Generic Function, init-info: Exported generic functions
Generic Function, limit-iterations-final: Internal generic functions
Generic Function, limit-iterations-max: Internal generic functions
Generic Function, limit-iterations-performed: Internal generic functions
Generic Function, log-function: Internal generic functions
Generic Function, push-info-p: Exported generic functions
Generic Function, status: Exported generic functions
Generic Function, value: Exported generic functions

I
info: Exported generic functions
info: Exported generic functions
info: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-control: Exported generic functions
init-info: Exported generic functions
init-info: Exported generic functions
iterate: Exported functions
iterator: Exported functions
iterator-p: Internal functions

L
limit-iterations: Exported functions
limit-iterations-final: Internal generic functions
limit-iterations-final: Internal generic functions
limit-iterations-max: Internal generic functions
limit-iterations-max: Internal generic functions
limit-iterations-performed: Internal generic functions
limit-iterations-performed: Internal generic functions
limit-iterations-with-id: Exported functions
log-computation: Exported functions
log-function: Internal generic functions
log-function: Internal generic functions

M
Macro, define-simple-constructor: Exported macros
Method, (setf control-apply-function): Exported generic functions
Method, (setf control-init-function): Exported generic functions
Method, (setf converged-number-last): Internal generic functions
Method, (setf converged-value-last): Internal generic functions
Method, (setf info): Exported generic functions
Method, (setf limit-iterations-performed): Internal generic functions
Method, (setf status): Exported generic functions
Method, (setf value): Exported generic functions
Method, alter-value-function: Internal generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, apply-control: Exported generic functions
Method, change-status-final: Internal generic functions
Method, change-status-pred: Internal generic functions
Method, change-status-target: Internal generic functions
Method, control-apply-function: Exported generic functions
Method, control-id: Exported generic functions
Method, control-id: Exported generic functions
Method, control-init-function: Exported generic functions
Method, converged-number-last: Internal generic functions
Method, converged-number-tolerance: Internal generic functions
Method, converged-value-close-p: Internal generic functions
Method, converged-value-copy: Internal generic functions
Method, converged-value-final: Internal generic functions
Method, converged-value-last: Internal generic functions
Method, fixed-point-result-indicator: Exported generic functions
Method, fixed-point-result-indicator: Exported generic functions
Method, info: Exported generic functions
Method, info: Exported generic functions
Method, init-control: Exported generic functions
Method, init-control: Exported generic functions
Method, init-control: Exported generic functions
Method, init-control: Exported generic functions
Method, init-control: Exported generic functions
Method, init-control: Exported generic functions
Method, init-info: Exported generic functions
Method, limit-iterations-final: Internal generic functions
Method, limit-iterations-max: Internal generic functions
Method, limit-iterations-performed: Internal generic functions
Method, log-function: Internal generic functions
Method, push-info-p: Exported generic functions
Method, push-info-p: Exported generic functions
Method, status: Exported generic functions
Method, value: Exported generic functions

P
push-info-p: Exported generic functions
push-info-p: Exported generic functions
push-info-p: Exported generic functions

R
reduce-list: Internal functions
reduced: Internal functions
reduced-p: Internal functions
reduced-value: Internal functions
replace-value: Exported functions

S
status: Exported generic functions
status: Exported generic functions
status-p: Internal functions

U
update-value: Exported functions
upgrade: Exported functions

V
value: Exported generic functions
value: Exported generic functions

Jump to:   (   -  
A   B   C   D   F   G   I   L   M   P   R   S   U   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   A   C   I   L   P   S   V  
Index Entry  Section

A
alter-value-function: Exported classes

C
change-status-final: Internal classes
change-status-pred: Internal classes
change-status-target: Exported classes
change-status-target: Exported classes
change-status-target: Internal classes
control-apply-function: Exported classes
control-init-function: Exported classes
converged-number-last: Exported classes
converged-number-tolerance: Exported classes
converged-value-close-p: Exported classes
converged-value-copy: Exported classes
converged-value-final: Exported classes
converged-value-last: Exported classes

I
id: Exported classes
info: Exported classes
init-info: Exported classes

L
limit-iterations-final: Exported classes
limit-iterations-max: Exported classes
limit-iterations-performed: Exported classes
log-function: Exported classes

P
push-info-p: Exported classes

S
Slot, alter-value-function: Exported classes
Slot, change-status-final: Internal classes
Slot, change-status-pred: Internal classes
Slot, change-status-target: Exported classes
Slot, change-status-target: Exported classes
Slot, change-status-target: Internal classes
Slot, control-apply-function: Exported classes
Slot, control-init-function: Exported classes
Slot, converged-number-last: Exported classes
Slot, converged-number-tolerance: Exported classes
Slot, converged-value-close-p: Exported classes
Slot, converged-value-copy: Exported classes
Slot, converged-value-final: Exported classes
Slot, converged-value-last: Exported classes
Slot, id: Exported classes
Slot, info: Exported classes
Slot, init-info: Exported classes
Slot, limit-iterations-final: Exported classes
Slot, limit-iterations-max: Exported classes
Slot, limit-iterations-performed: Exported classes
Slot, log-function: Exported classes
Slot, push-info-p: Exported classes
Slot, status: Exported classes
Slot, value: Exported classes
status: Exported classes

V
value: Exported classes

Jump to:   A   C   I   L   P   S   V  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   F   I   L   P   S  
Index Entry  Section

A
add-info: Exported classes
alter-value: Exported classes

C
change-status: Internal classes
cl-iterative: The cl-iterative system
cl-iterative: The cl-iterative package
cl-iterative-ex: The cl-iterative-ex package
Class, add-info: Exported classes
Class, alter-value: Exported classes
Class, change-status: Internal classes
Class, control: Exported classes
Class, control-with-id: Exported classes
Class, converged-number: Exported classes
Class, converged-number-with-id: Exported classes
Class, converged-value: Exported classes
Class, converged-value-with-id: Exported classes
Class, failed-value: Exported classes
Class, failed-value-with-id: Exported classes
Class, finished-value: Exported classes
Class, finished-value-with-id: Exported classes
Class, iterator: Exported classes
Class, iteratorex: Exported classes
Class, limit-iterations: Exported classes
Class, limit-iterations-with-id: Exported classes
Class, log-computation: Exported classes
control: Exported classes
control-with-id: Exported classes
converged-number: Exported classes
converged-number-with-id: Exported classes
converged-value: Exported classes
converged-value-with-id: Exported classes

F
failed-value: Exported classes
failed-value-with-id: Exported classes
finished-value: Exported classes
finished-value-with-id: Exported classes

I
iterator: The iterator package
iterator: Exported classes
iteratorex: The iteratorex package
iteratorex: Exported classes

L
limit-iterations: Exported classes
limit-iterations-with-id: Exported classes
log-computation: Exported classes

P
Package, cl-iterative: The cl-iterative package
Package, cl-iterative-ex: The cl-iterative-ex package
Package, iterator: The iterator package
Package, iteratorex: The iteratorex package

S
System, cl-iterative: The cl-iterative system

Jump to:   A   C   F   I   L   P   S