mathmaker  0.6(alpha)
Public Member Functions | Public Attributes | Properties
core.base_calculus.SquareRoot Class Reference

It's a Exponented under a square root The Exponented can be either numeric or literal. More...

Inheritance diagram for core.base_calculus.SquareRoot:
core.base_calculus.Function core.base_calculus.Item core.root_calculus.Exponented core.root_calculus.Signed core.root_calculus.Calculable core.root_calculus.Evaluable core.base.Printable core.base.NamedObject core.base.Clonable

List of all members.

Public Member Functions

def __init__
 Constructor.
def get_iteration_list
 Returns the list of elements to iter over.
def get_minus_signs_nb
 Gets the number of '-' signs of the SquareRoot.
def get_force_display_sign_once
 Gets force_display_sign_once field.
def set_force_display_sign_once
 Sets a True|False value to the "force_display_sign_once" field.
def into_str
 Creates a string of the given object in the given ML.
def calculate_next_step
 Returns None|an SquareRoot.
def expand_and_reduce_next_step
 Returns SquareRoot(self.object.expand_and_reduce_next_step())
def dbg_str
 Raw display of the SquareRoot (debugging method)
def __eq__
 Compares two SquareRoots.
def __len__
 Returns the SquareRoot's length.
def turn_into_fraction
 Turns the SquareRoot into the fraction item itself over item 1.
def multiply_symbol_is_required
 True if the usual writing rules require a × between two factors.
def requires_brackets
 True if the argument requires brackets in a product For instance, a Sum with several terms or a negative Item.
def requires_inner_brackets
 Always false for SquareRoots !
def contains_exactly
 Always False for a SquareRoot ?
def contains_a_rounded_number
 To check if this contains a rounded number...
def is_numeric
 True if it's a numeric SquareRoot.
def is_literal
 True if it's a literal SquareRoot.
def is_null
 True if it's the null SquareRoot.
def is_displ_as_a_single_1
 True if it's positive w/ radicand itself eq.
def is_displ_as_a_single_minus_1
 True if it's negative w/ radicand itself eq.
def is_displ_as_a_single_0
 True if self.is_null()
def is_displ_as_a_single_numeric_Item
 Should never be True (if it is, then self is not a SquareRoot...)
def is_displ_as_a_single_int
 True if the object can be displayed as a single int.
def is_displ_as_a_single_neutral
 True if the object can be considered as a neutral element.
def is_expandable
 Depends on the radicand.

Public Attributes

 radicand
 sign

Properties

 force_display_sign_once

Detailed Description

It's a Exponented under a square root The Exponented can be either numeric or literal.

Definition at line 1372 of file base_calculus.py.


Constructor & Destructor Documentation

def core.base_calculus.SquareRoot.__init__ (   self,
  arg,
  options 
)

Constructor.

Warning:
Might raise an UncompatibleType exception.
Parameters:
argExponented|(sign, Exponented) The given Exponented will be "embedded" in the SquareRoot
options: copy='yes' can be used to produce a copy of another SquareRoot. If not used, the other SquareRoot will get embedded in a new SquareRoot.
Returns:
One instance of SquareRoot

Definition at line 1388 of file base_calculus.py.

References core.base_calculus.Item._force_display_sign_once, core.base_calculus.Function._force_display_sign_once, core.base_calculus.SquareRoot._force_display_sign_once, core.base_calculus.Item._sign, core.base_calculus.Function._sign, core.base_calculus.SquareRoot._sign, core.base.Clonable.clone(), and core.base_calculus.SquareRoot.radicand.

Referenced by core.calculus.Equation.__init__(), and core.root_calculus.Value.substitute().


Member Function Documentation

def core.base_calculus.SquareRoot.__eq__ (   self,
  other_item 
)

Compares two SquareRoots.

Returns:
0 (i.e. they're equal) if sign, value & exponent are equal ?

Reimplemented from core.base_calculus.Item.

Definition at line 1628 of file base_calculus.py.

Returns the SquareRoot's length.

Returns:
1

Reimplemented from core.base_calculus.Item.

Definition at line 1640 of file base_calculus.py.

To check if this contains a rounded number...

Returns:
True or False depending on the Value inside

Reimplemented from core.base_calculus.Item.

Definition at line 1730 of file base_calculus.py.

Always False for a SquareRoot ?

Parameters:
objctThe object to search for
Returns:
False

Reimplemented from core.base_calculus.Item.

Definition at line 1718 of file base_calculus.py.

def core.base_calculus.SquareRoot.dbg_str (   self,
  options 
)

Gets force_display_sign_once field.

Returns:
Item's force_display_sign_once field

Reimplemented from core.base_calculus.Item.

Definition at line 1455 of file base_calculus.py.

References core.base_calculus.Item._force_display_sign_once, core.base_calculus.Function._force_display_sign_once, and core.base_calculus.SquareRoot._force_display_sign_once.

Gets the number of '-' signs of the SquareRoot.

Returns:
The number of '-' signs of the SquareRoot (either 0 or 1)

Reimplemented from core.base_calculus.Item.

Definition at line 1441 of file base_calculus.py.

References core.root_calculus.Signed.is_negative(), core.base_calculus.Monomial.is_negative(), core.base_calculus.Item.is_null(), and core.base_calculus.SquareRoot.is_null().

def core.base_calculus.SquareRoot.into_str (   self,
  options 
)

True if it's negative w/ radicand itself eq.

to a single 1

Reimplemented from core.base_calculus.Function.

Definition at line 1785 of file base_calculus.py.

References core.base_calculus.Item.sign, and core.base_calculus.SquareRoot.sign.

Referenced by core.base_calculus.Product.is_reducible(), and core.base_calculus.Sum.is_reducible().

Depends on the radicand.

Returns:
True/False

Reimplemented from core.base_calculus.Function.

Definition at line 1848 of file base_calculus.py.

def core.base_calculus.SquareRoot.multiply_symbol_is_required (   self,
  objct,
  position 
)

True if the usual writing rules require a × between two factors.

Parameters:
objctThe other one
positionThe position (integer) of self in the Product
Returns:
True if the writing rules require × between self & obj

Reimplemented from core.base_calculus.Item.

Definition at line 1663 of file base_calculus.py.

Referenced by core.base_calculus.Product.multiply_symbol_is_required(), and core.base_calculus.Sum.multiply_symbol_is_required().

def core.base_calculus.SquareRoot.requires_brackets (   self,
  position 
)

True if the argument requires brackets in a product For instance, a Sum with several terms or a negative Item.

Parameters:
positionThe position of the object in the Product
Returns:
True if the object requires brackets in a Product

Reimplemented from core.base_calculus.Item.

Definition at line 1685 of file base_calculus.py.

References core.base_calculus.Item.force_display_sign_once, core.base_calculus.SquareRoot.force_display_sign_once, core.base_calculus.Item.sign, and core.base_calculus.SquareRoot.sign.


Property Documentation

core::base_calculus.SquareRoot::force_display_sign_once [static]
Initial value:
property(get_force_display_sign_once,
                              doc = "Item's force_display_sign_once field")

Reimplemented from core.base_calculus.Item.

Definition at line 1462 of file base_calculus.py.

Referenced by core.base_calculus.SquareRoot.into_str(), and core.base_calculus.SquareRoot.requires_brackets().


The documentation for this class was generated from the following file: