snap-python
snap-python copied to clipboard
add interface for MotifCluster
- check if ARPACK installed (so far only on Linux, OSX)
- compile motifcluster.cpp, include motifcluster.h in snap.i
- ~~missing:
typedef WeightVH~~
To make this fully functional, two things are missing, and I would like to ask for your help:
- ~~Add
WeightVH: see below~~ - check for ARPACK on Windows: I don't have a Windows machine to test on.
I tried adding WeightVH in the following way:
swig/snap.i
%template(WeightVH) TVec<TIntH>;
%ignore TVec< THash<TInt, TInt, TDefaultHashFunc<TInt> > >::GetPrimHashCd;
%ignore TVec< THash<TInt, TInt, TDefaultHashFunc<TInt> > >::GetSecHashCd;
swig/tvec.i
WeightVH.__getitem__ = getitem_vec
WeightVH.__setitem__ = setitem_vec
WeightVH.__iter__ = itervec
WeightVH.__len__ = len_vec
WeightVH.__delitem__ = delitem_vec
But both with and without the %ignores, this lead to the compilation error:
swig/snap_wrap.cxx
error: no member 'GetPrimHashCd' in 'THash<TInt, TInt, TDefaultHashFunc<TInt> >'
error: no member 'GetSecHashCd' in 'THash<TInt, TInt, TDefaultHashFunc<TInt> >'
Is it necessary to add functions to the C++ library?
Works now!
The %ignore just needed the format from the %template declaration to fire.
swig/snap.i
%ignore TVec<TIntH>::GetPrimHashCd;
%ignore TVec<TIntH>::GetSecHashCd;