Previous Page Next Page Contents

_invert -- the reciprocal of an expression

Introduction

_invert(x) computes the reciprocal 1/x of x.

Call(s)


1/x _invert(x)

Parameters

x - an arithmetical expression or a set

Returns

an arithmetical expression or a set.

Overloadable:

x

Related Functions

_divide, _negate, ^, /, *, +, -

Details

Example 1

The reciprocal of an expression is the inverse with respect to *:

>> _invert(x), x * (1/x) = x * _invert(x)
                                 1
                                 -, 1 = 1
                                 x
>> 3 * y * x^2 / 27 / x
                                    x y
                                    ---
                                     9

Internally, a symbolic expression 1/x is represented as x^(-1) = _power(x, -1):

>> type(1/x), op(1/x, 0), op(1/x, 1), op(1/x, 2)
                          "_power", _power, x, -1

Example 2

For finite sets, 1/X is the set {1/x; x in X}:

>> 1/{a, b, c}
                                { 1  1  1 }
                                { -, -, - }
                                { a  b  c }

Example 3

Various library domains such as matrix domains or residue class domains overload _invert:

>> x := Dom::Matrix(Dom::IntegerMod(7))([[2, 3], [3, 4]]):
   x, 1/x, x * (1/x)
      +-                  -+  +-                  -+
      |  2 mod 7, 3 mod 7  |  |  3 mod 7, 3 mod 7  |
      |                    |, |                    |,
      |  3 mod 7, 4 mod 7  |  |  3 mod 7, 5 mod 7  |
      +-                  -+  +-                  -+
      
         +-                  -+
         |  1 mod 7, 0 mod 7  |
         |                    |
         |  0 mod 7, 1 mod 7  |
         +-                  -+
>> delete x:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000