3.1.9. c3po.CollaborativeDataManager module
Contain the class CollaborativeDataManager.
- class c3po.CollaborativeDataManager.CollaborativeDataManager(dataManagers)
Bases:
DataManager,CollaborativeObjectCollaborativeDataManageris aDataManagerthat handles a set ofDataManageras a single one.- __add__(other)
Return
self + other.Use
"+"to call it. For examplea = b + c.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Returns:
A new (consistent with
self)CollaborativeDataManagerwhere the data are added.- Return type:
- Raises:
Exception – If
selfandotherare not consistent.
- __iadd__(other)
Add
otherinself(in place addition).Use
"+="to call it. For examplea += b.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Returns:
self.- Return type:
- Raises:
Exception – If
selfandotherare not consistent.
- __imul__(scalar)
Multiply
selfbyscalar(in place multiplication).Use
"*="to call it. For examplea *= b.- Parameters:
scalar – A scalar value.
- Returns:
self.- Return type:
- __init__(dataManagers)
Build a
CollaborativeDataManagerobject.- Parameters:
dataManagers (list[DataManager]) – A list of
DataManager.
- __isub__(other)
Substract
othertoself(in place subtraction).Use
"-="to call it. For examplea -= b.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Returns:
self.- Return type:
- Raises:
Exception – If
selfandotherare not consistent.
- __mul__(scalar)
Return
scalar * self.Use
"*"to call it. For examplea = b * c. The scalar first.- Parameters:
scalar – A scalar value.
- Returns:
A new (consistent with
self)CollaborativeDataManagerwhere the data are multiplied byscalar.- Return type:
- __sub__(other)
Return
self - other.Use
"-"to call it. For examplea = b - c.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Returns:
A new (consistent with
self)CollaborativeDataManagerwhere the data are substracted.- Return type:
- Raises:
Exception – If
selfandotherare not consistent.
- checkBeforeOperator(other)
INTERNAL Make basic checks before the call of an operator.
- clone()
Return a clone of
self.- Returns:
A clone of
self. Data are copied.- Return type:
- cloneEmpty()
Return a clone of
selfwithout copying the data.- Returns:
An empty clone of
self.- Return type:
- copy(other)
Copy data of other in
self.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Raises:
Exception – If
selfandotherare not consistent.
- dot(other)
Return the scalar product of
selfwithother.- Parameters:
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.- Return type:
The scalar product of
selfwithother.- Raises:
Exception – If
selfandotherare not consistent.
- ignoreForConstOperators(indexToIgnore)
INTERNAL
- imuladd(scalar, other)
Add in
selfscalar * other(in place operation).In order to do so,
other *= scalarandother *= 1./scalarare done.For example
a.imuladd(b, c).- Parameters:
scalar – A scalar value.
other (CollaborativeDataManager) – A
CollaborativeDataManagerwith the same list of data thanself.
- Returns:
self.- Return type:
- Raises:
Exception – If
selfandotherare not consistent.
- norm2()
Return the norm 2.
- Returns:
sqrt(sum_i(val[i] * val[i]))whereval[i]stands for each scalar and eachcomponent of the MED fields.
- normMax()
Return the infinite norm.
- Return type:
The max of the absolute values of the scalars and of the infinite norms of the MED fields.