utility method for decaying a value by a given amount
More...
Go to the source code of this file.
|
| #define | decay(x, d) |
| | This is a type-generic decay "function". More...
|
| |
|
| static s1615 | decay_s1615 (s1615 x, decay_t decay) |
| | this method takes a s1615 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)). More...
|
| |
| static u1616 | decay_u1616 (u1616 x, decay_t decay) |
| | this method takes a s1616 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)). More...
|
| |
| static s015 | decay_s015 (s015 x, decay_t decay) |
| | this method takes a s015 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)). More...
|
| |
| static u016 | decay_u016 (u016 x, decay_t decay) |
| | this method takes a s016 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)). More...
|
| |
|
static u032 | decay_s1615_to_u032 (s1615 x, decay_t decay) |
| |
utility method for decaying a value by a given amount
The API includes:
- decay_s1615() decays a s1615 value x by a given decay amount
- decay_u1616() decays a u1616 value x by a given decay amount
- decay_s015() decays a s015 value x by a given decay amount
- decay_u016() decays a u016 value x by a given decay amount
- decay() is suppose to deduce the x value's type and call one of the above methods to decay it by a given decay amount.
Definition in file decay.h.
◆ decay
Value: ({ \
__typeof__(x) tmp = (x); \
if (__builtin_types_compatible_p(__typeof__(x), s1615)) {\
} else if (__builtin_types_compatible_p(__typeof__(x), u1616)) {\
} else if (__builtin_types_compatible_p(__typeof__(x), s015)) {\
} else if (__builtin_types_compatible_p(__typeof__(x), u016)) {\
} else {\
abort(1); \
}\
tmp; \
})
static u1616 decay_u1616(u1616 x, decay_t decay)
this method takes a s1616 and decays it by a given amount (denoted by the decay) (to compensate for t...
static s1615 decay_s1615(s1615 x, decay_t decay)
this method takes a s1615 and decays it by a given amount (denoted by the decay) (to compensate for t...
static u016 decay_u016(u016 x, decay_t decay)
this method takes a s016 and decays it by a given amount (denoted by the decay) (to compensate for th...
static s015 decay_s015(s015 x, decay_t decay)
this method takes a s015 and decays it by a given amount (denoted by the decay) (to compensate for th...
This is a type-generic decay "function".
- Parameters
-
| [in] | x | the value to decayed |
| [in] | d | the amount to decay the value by |
- Returns
- the new decayed value
Definition at line 118 of file decay.h.
◆ decay_t
this is a redefine of the ufract into a decay for easier conversions in the future if the type is redefined
Definition at line 44 of file decay.h.
◆ decay_s1615()
| static s1615 decay_s1615 |
( |
s1615 |
x, |
|
|
decay_t |
decay |
|
) |
| |
|
inlinestatic |
this method takes a s1615 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)).
- Parameters
-
| [in] | x | the s1615 value to decayed |
| [in] | decay | the amount to decay the value by |
- Returns
- the new decayed s1615 value
Definition at line 52 of file decay.h.
◆ decay_u1616()
| static u1616 decay_u1616 |
( |
u1616 |
x, |
|
|
decay_t |
decay |
|
) |
| |
|
inlinestatic |
this method takes a s1616 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)).
- Parameters
-
| [in] | x | the s1616 value to decayed |
| [in] | decay | the amount to decay the value by |
- Returns
- the new decayed s1616 value
Definition at line 65 of file decay.h.
◆ decay_s015()
| static s015 decay_s015 |
( |
s015 |
x, |
|
|
decay_t |
decay |
|
) |
| |
|
inlinestatic |
this method takes a s015 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)).
- Parameters
-
| [in] | x | the s015 value to decayed |
| [in] | decay | the amount to decay the value by |
- Returns
- the new decayed s015 value
Definition at line 78 of file decay.h.
◆ decay_u016()
| static u016 decay_u016 |
( |
u016 |
x, |
|
|
decay_t |
decay |
|
) |
| |
|
inlinestatic |
this method takes a s016 and decays it by a given amount (denoted by the decay) (to compensate for the valve behaviour of a synapse in biology (spike goes in, synapse opens, then closes slowly)).
- Parameters
-
| [in] | x | the s016 value to decayed |
| [in] | decay | the amount to decay the value by |
- Returns
- the new decayed s016 value
Definition at line 91 of file decay.h.