diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-05-13 19:58:53 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-05-13 19:58:53 +0800 |
commit | 47296445b3c5cbea101a5961ef784eb05c84f854 (patch) | |
tree | 2495539d095be74134c3ac1ed66a16ee7b79778f /tools | |
parent | 52ca742e14e36cd37010bae9a7678dd5b1a7eaf5 (diff) | |
download | ranksvm-47296445b3c5cbea101a5961ef784eb05c84f854.tar.gz ranksvm-47296445b3c5cbea101a5961ef784eb05c84f854.tar.bz2 ranksvm-47296445b3c5cbea101a5961ef784eb05c84f854.zip |
mem tested
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dataProvider.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/dataProvider.h b/tools/dataProvider.h index a3f3d34..b8c14b2 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -66,7 +66,7 @@ public: other.clear(); } void setfSize(int fsize){n=fsize;} - int getfSize(){return n;} + inline int getfSize(){return n;} void addEntry(DataEntry* d){ int ext=false; for (int i=0;i<uniq.size();++i) @@ -80,19 +80,19 @@ public: else uniq.push_back(d); } - int getqSize() + inline int getqSize() { return (int)(uniq.size()+other.size()-1); } - int getuSize() + inline int getuSize() { return (int)uniq.size(); } - int getSize() + inline int getSize() { return getuSize()*getqSize(); } - Eigen::VectorXd getVec(int x){ + inline Eigen::VectorXd getVec(int x){ int a,b,n=getqSize(); a=x/n; b=x%n; @@ -106,8 +106,8 @@ public: vec=vec-other[b-uniq.size()+1]->feature; return vec.cwiseAbs(); }; - double getL(int x){ - int a,b,n=(int)(uniq.size()+other.size()-1); + inline double getL(int x){ + int a,b,n=getqSize(); a=x/n; b=x%n; if (b<uniq.size()-1) |