FunctionObjectConcept

AlgebraicStructureTraits::IsSquare

Definition

AdaptableBinaryFunction that computes whether the first argument is a square. If the first argument is a square the second argument, which is taken by reference, contains the square root. Otherwise, the content of the second argument is undefined.

A ring element x is said to be a square iff there exists a ring element y such that x= y*y. In case the ring is a UniqueFactorizationDomain, y is uniquely defined up to multiplication by units.

Refines

AdaptableBinaryFunction

Types

AlgebraicStructureTraits::IsSquare::result_type
Is AlgebraicStructureTraits::Boolean.

AlgebraicStructureTraits::IsSquare::first_argument
Is AlgebraicStructureTraits::Type.

AlgebraicStructureTraits::IsSquare::second_argument
Is AlgebraicStructureTraits::Type&.

Operations

result_type is_square ( first_argument_type x , second_argument_type y )
returns true in case x is a square, i.e. x = y*y.
Postcondition: unit_part(y) == 1.

result_type is_square ( first_argument_type x )
returns true in case x is a square.

See Also

AlgebraicStructureTraits