summaryrefslogtreecommitdiff
path: root/tools/dataProvider.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dataProvider.h')
-rw-r--r--tools/dataProvider.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/dataProvider.h b/tools/dataProvider.h
index bf47856..348d15c 100644
--- a/tools/dataProvider.h
+++ b/tools/dataProvider.h
@@ -61,6 +61,7 @@ private:
std::vector<DataEntry*> uniq;
std::vector<DataEntry*> other;
public:
+ static bool single;
void clear(){
uniq.clear();
other.clear();
@@ -98,6 +99,8 @@ public:
}
inline int getqSize()
{
+ if (single)
+ return (int)other.size();
return (int)(uniq.size()+other.size()-1);
}
inline int getuSize()
@@ -113,6 +116,8 @@ public:
a=x/n;
b=x%n;
Eigen::VectorXd vec;
+ if (single)
+ return (uniq[a]->feature-other[b]->feature).cwiseAbs();
if (b<a)
vec=uniq[a]->feature-uniq[b]->feature;
else
@@ -126,6 +131,12 @@ public:
int a,b,n=getqSize();
a=x/n;
b=x%n;
+ if (single)
+ {
+ if (std::fabs(other[b]->rank - a) < 1e-5)
+ return 1;
+ return -1;
+ }
if (b<uniq.size()-1)
return -1;
else