3.1.15. c3po.DataManager module

Inheritance diagram of c3po.DataManager

Contain the class DataManager.

class c3po.DataManager.DataManager

Bases: object

DataManager is a class interface (to be implemented) which standardizes methods to handle data outside of codes.

They are mainly mathematical operators needed for some coupling algorithms.

__add__(other)

Return self + other.

Use "+" to call it. For example a = b + c.

Parameters:

other (DataManager) – A DataManager with the same list of data then self.

Returns:

A new (consistent with self) DataManager where the data are added.

Return type:

DataManager

Raises:

Exception – If self and other are not consistent.

__iadd__(other)

Add other in self (in place addition).

Use "+=" to call it. For example a += b.

Parameters:

other (DataManager) – A DataManager with the same list of data then self.

Returns:

self.

Return type:

DataManager

Raises:

Exception – If self and other are not consistent.

__imul__(scalar)

Multiply self by scalar (in place multiplication).

Use "*=" to call it. For example a *= b.

Parameters:

scalar – A scalar value.

Returns:

self.

Return type:

DataManager

__isub__(other)

Substract other to self (in place subtraction).

Use "-=" to call it. For example a -= b.

Parameters:

other (DataManager) – A DataManager with the same list of data then self.

Returns:

self.

Return type:

DataManager

Raises:

Exception – If self and other are not consistent.

__mul__(scalar)

Return scalar * self.

Use "*" to call it. For example a = b * c. The scalar first.

Parameters:

scalar – A scalar value.

Returns:

A new (consistent with self) DataManager where the data are multiplied by scalar.

Return type:

DataManager

__sub__(other)

Return self - other.

Use "-" to call it. For example a = b - c.

Parameters:

other (DataManager) – A DataManager with the same list of data then self.

Returns:

A new (consistent with self) DataManager where the data are substracted.

Return type:

DataManager

Raises:

Exception – If self and other are not consistent.

clone()

Return a clone of self.

Returns:

A clone of self. Data are copied.

Return type:

DataManager

cloneEmpty()

Return a clone of self without copying the data.

Returns:

An empty clone of self.

Return type:

DataManager

copy(other)

Copy data of other in self.

Parameters:

other (DataManager) – A DataManager with the same list of data than self.

Raises:

Exception – If self and other are not consistent.

dot(other)

Return the scalar product of self with other.

Parameters:

other (DataManager) – A DataManager with the same list of data then self.

Return type:

The scalar product of self with other.

Raises:

Exception – If self and other are not consistent.

imuladd(scalar, other)

Add in self scalar * other (in place operation).

In order to do so, other *= scalar and other *= 1./scalar are done.

For example a.imuladd(b, c).

Parameters:
Returns:

self.

Return type:

DataManager

Raises:

Exception – If self and other are not consistent.

norm2()

Return the norm 2.

Return type:

sqrt(sum_i(val[i] * val[i])) where val[i] stands for each scalar and each component of stored data.

normMax()

Return the infinite norm.

Return type:

The infinite norm of all data.