TH functionality, INLINE  functions
Merge pull request #1 from fumieval/master

TH functionality, INLINE functions