%newobject ParaMEDMEM::DataArrayInt::buildExplicitArrByRanges;
%newobject ParaMEDMEM::DataArrayInt::buildPermutationArr;
%newobject ParaMEDMEM::DataArrayInt::buildPermArrPerLevel;
-%newobject ParaMEDMEM::DataArrayInt::__getitem__;
%newobject ParaMEDMEM::DataArrayInt::__neg__;
%newobject ParaMEDMEM::DataArrayInt::__add__;
%newobject ParaMEDMEM::DataArrayInt::__radd__;
%newobject ParaMEDMEM::DataArrayDouble::fromCylToCart;
%newobject ParaMEDMEM::DataArrayDouble::fromSpherToCart;
%newobject ParaMEDMEM::DataArrayDouble::getDifferentValues;
-%newobject ParaMEDMEM::DataArrayDouble::__getitem__;
%newobject ParaMEDMEM::DataArrayDouble::__neg__;
%newobject ParaMEDMEM::DataArrayDouble::__add__;
%newobject ParaMEDMEM::DataArrayDouble::__radd__;
return self->selectByTupleRanges(ranges);
}
- DataArrayDouble *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- const char msg[]="Unexpected situation in __getitem__ !";
+ const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
self->checkAllocated();
int nbOfTuples=self->getNumberOfTuples();
int nbOfComponents=self->getNumberOfComponents();
switch(sw)
{
case 1:
- return self->selectByTupleIdSafe(&it1,&it1+1);
+ if(nbOfComponents==1)
+ return PyFloat_FromDouble(self->getIJSafe(it1,0));
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 2:
- return self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 3:
- return self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 4:
- return self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
case 5:
- {
- ret=self->selectByTupleIdSafe(&it1,&it1+1);
- std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
- }
+ return PyFloat_FromDouble(self->getIJSafe(it1,ic1));
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 7:
{
ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 8:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 9:
{
ret=self->selectByTupleIdSafe(&it1,&it1+1);
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 10:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 11:
{
ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 12:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 13:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 14:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 15:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
case 16:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayDouble, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);
return ret;
}
- DataArrayInt *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
+ PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
{
- const char msg[]="Unexpected situation in __getitem__ !";
+ const char msg[]="Unexpected situation in DataArrayInt::__getitem__ !";
self->checkAllocated();
int nbOfTuples=self->getNumberOfTuples();
int nbOfComponents=self->getNumberOfComponents();
switch(sw)
{
case 1:
- return self->selectByTupleIdSafe(&it1,&it1+1);
+ {
+ if(nbOfComponents==1)
+ return PyInt_FromLong(self->getIJSafe(it1,0));
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
+ }
case 2:
- return self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 3:
- return self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 4:
- return self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
+ return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
case 5:
- {
- ret=self->selectByTupleIdSafe(&it1,&it1+1);
- std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
- }
+ return PyInt_FromLong(self->getIJSafe(it1,ic1));
case 6:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 7:
{
ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 8:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
std::vector<int> v2(1,ic1);
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 9:
{
ret=self->selectByTupleIdSafe(&it1,&it1+1);
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 10:
{
ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 11:
{
ret=self->selectByTupleId2(pt1.first,pt1.second.first,pt1.second.second);
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 12:
{
ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
- return ret->keepSelectedComponents(vc1);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(vc1)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 13:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 14:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 15:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
case 16:
{
std::vector<int> v2(nbOfComp);
for(int i=0;i<nbOfComp;i++)
v2[i]=pc1.first+i*pc1.second.second;
- return ret->keepSelectedComponents(v2);
+ return SWIG_NewPointerObj(SWIG_as_voidptr(ret->keepSelectedComponents(v2)),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 );
}
default:
throw INTERP_KERNEL::Exception(msg);