Changeset 29421 in project


Ignore:
Timestamp:
07/27/13 05:43:58 (6 years ago)
Author:
anonymous
Message:

abarbu documentation update

Location:
wiki/eggref/4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/csp

    r28367 r29421  
    1010problems.
    1111
    12 A CSP is compsoed of a number of ''domain-variable''s that have a
     12A CSP is composed of a number of ''domain-variable''s that have a
    1313domain, a set of bindings they can assume, along with a number of
    1414constraints. This egg supports 5 kinds of constraints: ''efd'' (early
     
    2929Create a domain variable whose domain is ''domain''.
    3030
     31<parameter>*csp-strategy*</parameter>
    3132<procedure>(assert-constraint! constraint domain-variables)</procedure>
    3233
    33 Assert a constraint, ''constraint'' is a function that returns a
    34 boolean, amongst a number of domain variables. The kind of constraint
    35 is determined by inspecting ''*strategy*''. Valid types are: ''efd''
    36 (early failure detection), ''fc'' (forward checking), ''vp'' (value
    37 propagation), ''gfc'' (generalized forward checking) and ''ac'' (arc
    38 consistency).
     34Assert a constraint, a function that returns a boolean, between a
     35number of domain variables. The kind of constraint is determined by
     36inspecting ''*csp-strategy*''. Valid types are: ''efd'' (early failure
     37detection), ''fc'' (forward checking), ''vp'' (value propagation),
     38''gfc'' (generalized forward checking) and ''ac'' (arc
     39consistency). The default is ''ac''. For constraints of low arity, a
     40small number of domain variables, it will use an optimized version of
     41the constraint propagation code.
    3942
    4043<procedure>(bound? domain-variable)</procedure>
     
    4548==== Constraints
    4649
    47 <procedure>(assert-unary-constraint-gfc! constraint x)</procedure>
    48 <procedure>(assert-binary-constraint-gfc! constraint x y)</procedure>
    49 <procedure>(assert-ternary-constraint-gfc! constraint x y z)</procedure>
    50 <procedure>(assert-unary-constraint-ac! constraint x)</procedure>
    51 <procedure>(assert-binary-constraint-ac! constraint x y)</procedure>
    52 <procedure>(assert-ternary-constraint-ac! constraint x y z)</procedure>
    5350<procedure>(assert-unary-constraint-efd! constraint x)</procedure>
    5451<procedure>(assert-binary-constraint-efd! constraint x y)</procedure>
     
    6057<procedure>(assert-binary-constraint-vp! constraint x y)</procedure>
    6158<procedure>(assert-ternary-constraint-vp! constraint x y z)</procedure>
     59<procedure>(assert-unary-constraint-gfc! constraint x)</procedure>
     60<procedure>(assert-binary-constraint-gfc! constraint x y)</procedure>
     61<procedure>(assert-ternary-constraint-gfc! constraint x y z)</procedure>
     62<procedure>(assert-unary-constraint-ac! constraint x)</procedure>
     63<procedure>(assert-binary-constraint-ac! constraint x y)</procedure>
     64<procedure>(assert-ternary-constraint-ac! constraint x y z)</procedure>
    6265
    6366Assert each of the 5 kinds of constraints between domain-variables
    64 ''x'', ''y'' and ''z''.
     67''x'', ''y'' and ''z''. You can always use ''assert-constraint!''
     68instead and it will default to these functions if your constraint is
     69of low arity.
    6570
     71<procedure>(assert-constraint-efd! constraint ds)</procedure>
     72<procedure>(assert-constraint-fc! constraint ds)</procedure>
     73<procedure>(assert-constraint-vp! constraint ds)</procedure>
     74<procedure>(assert-constraint-gfc! constraint ds)</procedure>
    6675<procedure>(assert-constraint-ac! constraint ds)</procedure>
    6776
    68 Assert an arc consistency constraint between all domain-variables in
    69 the list ds.
     77Assert each of the 5 kinds of constraints between the list of
     78domain-variables ds. You can always use ''assert-constraint!''
     79instead as it will pick an optimized version for each of the above if
     80the arity of the constraint is low.
    7081
    7182==== Low-level
     
    7586<procedure>(restrict-domain! x domain)</procedure>
    7687
    77 Only of interest to implementors.
     88Only of interest to implementers.
    7889
    7990=== Examples
    8091
    81 This solves [[Project Euler problem 43|http://projecteuler.net/problem=43]].
     92This solves [[http://projecteuler.net/problem=43|Project Euler problem 43]].
    8293
    8394  (use traversal nondeterminism csp)
  • wiki/eggref/4/define-structure

    r28171 r29421  
    55[[https://github.com/abarbu/define-structure|github repository]].
    66
    7 == define-structure
     7= define-structure
    88
    99This is a Chicken Scheme egg which implements a QobiScheme-compatible
     
    1616
    1717<macro>(define-structure name . fields)</macro>
     18<macro>(define-public-structure name . fields)</macro>
     19<macro>(define-private-structure name . fields)</macro>
    1820
    19 Creates a new structure.
     21Creates a new structure. By default all structures are public,
     22generate an export form, making define-structure an alias for
     23define-public-structure.
    2024
    2125==== Use
  • wiki/eggref/4/linear-algebra

    r28363 r29421  
    3636<procedure>(v+ u v)</procedure>
    3737<procedure>(v- u v)</procedure>
    38 <procedure>(k*v k u)</procedure>
     38<procedure>(k*v k v)</procedure>
     39<procedure>(v*k v k)</procedure>
     40<procedure>(k+v k v)</procedure>
     41<procedure>(v+k v k)</procedure>
    3942<procedure>(v/k v k)</procedure>
     43<procedure>(v* u v)</procedure>
     44<procedure>(v/ u v)</procedure>
    4045<procedure>(v= u v)</procedure>
    4146<procedure>(rotate-90 u)</procedure>
     
    7176<procedure>(m+ a b)</procedure>
    7277<procedure>(m- a b)</procedure>
     78<procedure>(m+k m k)</procedure>
     79<procedure>(m+k-diagonal m k)</procedure>
     80<procedure>(k+m k m)</procedure>
    7381<procedure>(m*v a v)</procedure>
    74 <procedure>(transpose-matrix a)</procedure>
     82<procedure>(matrix-transpose a)</procedure>
    7583<procedure>(outer-product f u v)</procedure>
    7684<procedure>(self-outer-product f v)</procedure>
    7785<procedure>(m* a b)</procedure>
     86<procedure>(m*. a b)</procedure>
     87<procedure>(m/. a b)</procedure>
    7888<procedure>(v*m v a)</procedure>
    7989<procedure>(k*m k m)</procedure>
     90<procedure>(m*k m k)</procedure>
    8091<procedure>(m/k m k)</procedure>
    8192<procedure>(v*m*v v m)</procedure>
     
    107118<procedure>(unshape-matrix m)</procedure>
    108119<procedure>(crop m x y w h)</procedure>
     120<procedure>(submatrix m x-offset y-offset x-size y-size)</procedure>
    109121<procedure>(matrix-ref-nd m . is)</procedure>
    110122<procedure>(matrix-3d-ref a s i j)</procedure>
  • wiki/eggref/4/redis

    r28356 r29421  
    44== redis
    55
    6 This page is maintained in the package's [[https://github.com/abarbu/redis-chicken |github repository]].
     6This page is maintained in the package's
     7[[https://github.com/abarbu/redis-chicken |github repository]].
    78
    89Fast bindings to redis using hiredis. Note that you will need to fetch
  • wiki/eggref/4/scheme2c-compatibility

    r28362 r29421  
    1313Scheme->C-compatible API and naming scheme.
    1414
    15 ==== List operations
     15==== Lists
    1616
    1717<procedure>(eleventh x)</procedure>
    1818<procedure>(twelfth x)</procedure>
     19
     20==== Strings
     21
     22<procedure>(lines string)</procedure>
     23
     24Combine a list of lines into a string separated by newlines.
     25
     26<procedure>(unlines l)</procedure>
     27
     28Split a string into a list of lines.
     29
     30<procedure>(words string)</procedure>
     31
     32Split a string into words.
     33
     34<procedure>(unwords l)</procedure>
     35
     36Combine a list of words into a string separated by spaces.
     37
     38<procedure>(number-of-fields string)</procedure>
     39<procedure>(field-ref string n)</procedure>
     40<procedure>(fields string)</procedure>
    1941
    2042==== System
     
    6890<procedure>(with-temporary-file prefix f)</procedure>
    6991
    70 Call f with a unique filename that will be removed once f
    71 returns. Note that for now prefix and its extension is ignored! This
    72 is a bug.
     92Call f with a unique filename that will be removed once f returns. The
     93extension of prefix is honored, but not its base filename.
    7394
    7495==== Bitwise operations
Note: See TracChangeset for help on using the changeset viewer.