siconos.kernel.BlockVector (Python class)

class siconos.kernel.BlockVector(*args)[source]

Bases: object

“Block” vector : container (list) of SiconosVector

A block vector is a stl vector that handles pointers to SiconosVector.

Insertion of NULL SP::SiconosVector is not allowed.

Generated class (swig), based on C++ header Program listing for file kernel/src/utils/SiconosAlgebra/BlockVector.hpp.

Constructors

BlockVector()

default contructor

BlockVector(BlockVector v)

copy contructor

Parameters:v – BlockVector&
BlockVector(array_like (np.float64, 1D) v1, array_like (np.float64, 1D) v2)

contructor with a 2 SiconosVectors

Parameters:
  • v1 – first vector
  • v2 – second vector
BlockVector(int numberOfBlocks, int dim)

contructor with a BlockVector of n (numberOfBlocks) blocks of the same size (dim) filled with a new vector

Parameters:
  • numberOfBlocks – number of blocks
  • dim – dimension of the vector
BlockVector(int numberOfBlocks)

contructor with a BlockVector of n (numberOfBlocks) blocks that point on NULL

Parameters:numberOfBlocks – number of blocks
begin(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

begin() → VectorOfVectors::iterator[source]

iterator equal to _vect.begin

Returns:a VectorOfVectors::iterator
begin() → VectorOfVectors::_iterator[source]

const iterator equal to _vect.begin

Returns:a VectorOfVectors::iterator
display(None) → None[source]

display data on standard output

end(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

end() → VectorOfVectors::iterator[source]

iterator equal to vect.end

Returns:a VectorOfVectors::iterator
end() → VectorOfVectors::_iterator[source]

const iterator equal to _vect.end

Returns:a VectorOfVectors::iterator
fill(double a) → None[source]

set all values of the vector component to value.

Parameters:a – double
getAllVect() → VectorOfVectors[source]

get _vect, ie all the vectors of the object

Returns:a VectorOfVectors
getNumVectorAtPos(int pos) → int[source]

get the number of the vector that handles element at position “pos”

Parameters:pos – unsigned int, position of the element
Returns:unsigned int number of the searched vector
getTabIndex() -> array_like (int, 1D)[source]

get the index tab

Returns:a standard vector of int
getValue(int i) → double[source]

return the element vector[i]

Parameters:i – an unsigned int
Returns:a double
insert(array_like (np.float64, 1D) v) → None[source]

Insert a subvector in this vector: allocation and copy.

Parameters:v – SiconosVector& v : the vector to be inserted
insertPtr(array_like (np.float64, 1D) v) → None[source]

Insert a pointer to a subvector in this vector: no reallocation nor copy.

Parameters:v – a SiconosVector
isComparableTo(BlockVector v1, BlockVector v2) → bool[source]
norm2() → double[source]
normInf() → double[source]

compute the infinite norm of the vector

Returns:a double
numberOfBlocks() → int[source]

get the number of Blocks

Returns:unsigned int
setAllVect(VectorOfVectors v) → None[source]

set the vector array of _vect

Parameters:v – a VectorOfVectors
setValue(int i, double value) → None[source]

set the element vector[i]

Parameters:
  • i – an unsigned int
  • value
setVector(int pos, array_like (np.float64, 1D) v) → None[source]

set i-eme SiconosVector of _vect (copy)

Parameters:
  • pos – block number
  • v – a SiconosVector
setVectorPtr(int pos, array_like (np.float64, 1D) v) → None[source]

set i-eme SiconosVector of _vect (pointer link)

Parameters:
  • pos – block number
  • v – a SiconosVector
size() → int[source]

get the vector size, ie the total number of (double) elements in the vector

Returns:unsigned int
tabIndex() -> array_like (int, 1D)[source]

get a pointer to the index tab

Returns:SP::Index
tabIndexBegin(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

tabIndexBegin() → array_like (int, 1D)::iterator[source]

get an iterator that points to the first element of tabIndex

Returns:an Index::iterator
tabIndexBegin() → array_like (int, 1D)::_iterator[source]

get an iterator that points to the first element of tabIndex

Returns:an Index::iterator
tabIndexEnd(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

tabIndexEnd() → array_like (int, 1D)::iterator[source]

get an iterator that points to tabIndex.end()

Returns:an Index::iterator
tabIndexEnd() → array_like (int, 1D)::_iterator[source]

get an iterator that points to tabIndex.end()

Returns:an Index::iterator
toString() → str[source]

put data of the vector into a std::string

Returns:std::string
vector(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

vector(int pos) -> array_like (np.float64, 1D)[source]

return i-eme SiconosVector of _vect

Parameters:pos – block number
Returns:a pointer to a SiconosVector
vector(int pos) -> SPC::array_like (np.float64, 1D)[source]

return i-eme SiconosVector of _vect

Parameters:pos – block number
Returns:a pointer to a SiconosVector
zero() → None[source]

sets all the values of the vector to 0.0