idempotent

(redirected from Indempotency)
Also found in: Dictionary, Thesaurus.

idempotent

[¦i‚dem¦pōt·ənt]
(mathematics)
An element x of an algebraic system satisfying the equation x 2= x.
An algebraic system in which every element x satisfies x 2= x.

idempotent

(1)
A function f : D -> D is idempotent if

f (f x) = f x for all x in D.

I.e. repeated applications have the same effect as one. This can be extended to functions of more than one argument, e.g. Boolean & has x & x = x. Any value in the image of an idempotent function is a fixed point of the function.

idempotent

(2)
This term can be used to describe C header files, which contain common definitions and declarations to be included by several source files. If a header file is ever included twice during the same compilation (perhaps due to nested #include files), compilation errors can result unless the header file has protected itself against multiple inclusion; a header file so protected is said to be idempotent.

idempotent

(3)
The term can also be used to describe an initialisation subroutine that is arranged to perform some critical action exactly once, even if the routine is called several times.

idempotent

An operation that produces the same results no matter how many times it is performed. For example, a database query that does not change any data in the database is idempotent.

Functions can be designed as idempotent if all that is desired is to ensure a certain operation has been completed. For example, with an idempotent delete function, if a request to delete a file is successfully completed for one program, all subsequent requests to delete that file from other programs would return the same success confirmation message. In a non-idempotent delete function, an error would be returned for the second and subsequent requests indicating that the file was not there.