~ubuntu-branches/ubuntu/raring/genius/raring

« back to all changes in this revision

Viewing changes to lib/functions/delta.gel

  • Committer: Logan Rosen
  • Date: 2012-12-23 04:12:09 UTC
  • mfrom: (1.2.8)
  • Revision ID: logatronico@gmail.com-20121223041209-kduaktqblmrcakhk
New upstream release (LP: #1092569).

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
## Discrete Delta
8
8
## Takes a vector v and returns 1 if any entry is non-zero, 0 otherwise
9
 
## FIXME: Is this right?
10
 
## FIXME: this works fine for vectors, but I need to cast matrices
11
 
# as vectors to get it to work for matrices.
12
9
function DiscreteDelta(v) = KroneckerDelta([0,v])
13
 
SetHelp("DiscreteDelta","functions","Returns 1 iff all elements are zero");
 
10
SetHelp("DiscreteDelta","functions","Returns 1 if and only if all elements are zero");
14
11
 
15
12
## Kronecker Delta
16
13
## Takes a vector v and returns 1 if all entries are equal,
23
20
  );
24
21
  1
25
22
 )
26
 
SetHelp("KroneckerDelta","functions","Returns 1 iff all elements are equal");
 
23
SetHelp("KroneckerDelta","functions","Returns 1 if and only if all elements are equal");
27
24
 
28
25
## Unit Step Function
29
26
## The integral of the Dirac Delta function