hedge :: tools :: SubsettableCrossProduct :: Class SubsettableCrossProduct
[hide private]
[frames] | no frames]

Class SubsettableCrossProduct

source code

A cross product that can operate on an arbitrary subsets of its two operands and return an arbitrary subset of its result.

Instance Methods [hide private]
 
__init__(self, op1_subset=(True, True, True), op2_subset=(True, True, True), result_subset=(True, True, True))
Construct a subset-able cross product.
source code
 
__call__(self, x, y, three_mult=None)
Compute the subsetted cross product on the indexables x and y.
source code
Class Variables [hide private]
  full_subset = (True, True, True)
Method Details [hide private]

__init__(self, op1_subset=(True, True, True), op2_subset=(True, True, True), result_subset=(True, True, True))
(Constructor)

source code 

Construct a subset-able cross product.

Parameters:
  • op1_subset - The subset of indices of operand 1 to be taken into account. Given as a 3-sequence of bools.
  • op2_subset - The subset of indices of operand 2 to be taken into account. Given as a 3-sequence of bools.
  • result_subset - The subset of indices of the result that are calculated. Given as a 3-sequence of bools.

__call__(self, x, y, three_mult=None)
(Call operator)

source code 

Compute the subsetted cross product on the indexables x and y.

Parameters:
  • three_mult - a function of three arguments sign, xj, yk used in place of the product sign*xj*yk. Defaults to just this product if not given.