QuadRingElement

QuadRingElement

Elements of the form a + b sqrt(d) where d is defined at the level of the QuadRing

Constructor

new QuadRingElement(ring, a, b)

Source:

Constructor.

Parameters:
Name Type Default Description
ring QuadRing

the underlying quadratic ring

a number 0

an integer

b number 0

an integer

Classes

QuadRingElement

Members

ring :QuadRing

Source:

The underlying quadratic ring

Type:

Methods

add(elt) → {QuadRingElement}

Source:

Addition

Parameters:
Name Type Description
elt QuadRingElement
Returns:

the current element

Type
QuadRingElement

addProduct() → {QuadRingElement}

Source:

Add the product of the given element to the current elements

Returns:

the current element

Type
QuadRingElement

clone() → {QuadRingElement}

Source:

Return a copy of the current element

Returns:
Type
QuadRingElement

copy(elt) → {QuadRingElement}

Source:

Set the current element to the given one

Parameters:
Name Type Description
elt QuadRingElement
Returns:

the current element

Type
QuadRingElement

equals(elt) → {boolean}

Source:

Check if the two element are equal

Parameters:
Name Type Description
elt QuadRingElement
Returns:
Type
boolean

isZero() → {boolean}

Source:

Test if the element is zero.

Returns:
Type
boolean

multiply(elt) → {QuadRingElement}

Source:

Multiplication

Parameters:
Name Type Description
elt QuadRingElement
Returns:

the current element

Type
QuadRingElement

negate() → {QuadRingElement}

Source:

Replace the element by its opposite

Returns:

the current element

Type
QuadRingElement

product() → {QuadRingElement}

Source:

Set the current element of the product of the given arguments

Returns:

the current element

Type
QuadRingElement

reduce() → {QuadRingElement}

Source:

Make the that gcd(a,b,c) = 1

Returns:

the current element

Type
QuadRingElement

sub(elt) → {QuadRingElement}

Source:

Subtraction

Parameters:
Name Type Description
elt QuadRingElement
Returns:

the current element

Type
QuadRingElement

subProduct() → {QuadRingElement}

Source:

Subtract the product of the given element to the current elements

Returns:

the current element

Type
QuadRingElement

sum() → {QuadRingElement}

Source:

Set the current element to the sum of the given arguments

Returns:

the current element

Type
QuadRingElement

toNumber()

Source:

Convert the element to a number