Vcalc - vector calculator for HRRs

(Version as of Aug 6, 1998 is vcalc0.9) Vcalc is vector calculator which provides operations for computing with HRRs: convolution, associative memory, vector transpose, and normalization. Vectors can be real or complex. Notation is infix and functions are supported (though user-defined functions are not). Notation is pretty standard, except for a few more operators like x . y (dot product), <x> (normalization), and |x| (Euclidean length).

One ususual aspect of vcalc notation is that functions can have local variables specified in the parameter list, after a semicolon. Thus, the following two examples print the same thing:

> x = {1/2 1/3}
> print(x)
{0.5 0.333}
> print(x; precision=6, brace=false)
0.5 0.333333
> print.precision=6
> print.brace=false
> print(x)
0.5 0.333333

Variables controlling behaviour of vcalc

Operators

Functions

<.> - normalization

<x> or equivalently normalize(x) is the normalized version of x

Control:

Examples:

> y = {1 2 3 4}
> y
{1 2 3 4}
> <y>
{0.183 0.365 0.548 0.73}
> <y;type="nopnorm">
{1 2 3 4}
> normalize.type
unit
> normalize.type="nopnorm"
> normalize(y)
{1 2 3 4}
> normalize(y;type="unit")
{0.183 0.365 0.548 0.73}

cos

cos(x) - the cosine of x

Control:

Examples:


sqrt

print

repeat

cons

top

pop

push

randvec

time

randSeed

uniform

rand

bitvec

orthogonalize

match

blend

blend(x,list) - calculates a blend of x among the vectors in list

Control:

Examples:

> a = <randvec()>
> b = <randvec()>
> c = <randvec()>
> blend.capacity = 2
> match.capacity = 3
> blend.transfer = "boundedlinear"
> store(s, a,b,c)
> x = 2*a + b + c
> match(x, s)
a                    1.80447
b                    0.812107
c                    0.783128
> y = blend(x, s)
> y
{-0.605 -0.0471 0.226 -0.0293 -0.534 0.552 0.705 -0.075}
> a + 0.812107 * b
{-0.605 -0.0471 0.226 -0.0293 -0.534 0.552 0.705 -0.075}

Last modified by tap: Thu Aug 6 18:15:06 NZST 1998