Commit 9b38e68d authored by Miroslav Shaltev's avatar Miroslav Shaltev
Browse files

hybridsearch allsky bug fixes

parent f742e180
......@@ -627,7 +627,7 @@ int main(int argc, char *argv[]) {
MFCSearch->TimeStart(XLALGetTimeOfDay());
}
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,FALSE);
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,FALSE,use_segList);
if (MFCSearch->outputTiming()) {
MFCSearch->TimeEnd(XLALGetTimeOfDay());
......@@ -644,7 +644,7 @@ int main(int argc, char *argv[]) {
}
}
MFCSearch->UpdateDirections(&epv.at(max_pos));
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,TRUE);
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,TRUE,use_segList);
}
......@@ -765,7 +765,7 @@ int main(int argc, char *argv[]) {
}
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,FALSE);
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,FALSE,MFCSearch->singleSegment());
if (MFCSearch->outputTiming()) {
......@@ -783,7 +783,7 @@ int main(int argc, char *argv[]) {
}
}
MFCSearch->UpdateDirections(&epv.at(max_pos));
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,TRUE);
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,TRUE,MFCSearch->singleSegment());
}
......@@ -929,7 +929,7 @@ int main(int argc, char *argv[]) {
#ifdef DEBUG
MFCSearch->DoDisplayMetric(MFCSearch->Semicohmetric());
#endif
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,FALSE);
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,FALSE,use_segList);
if (MFCSearch->outputTiming()) {
......@@ -947,7 +947,7 @@ int main(int argc, char *argv[]) {
}
}
MFCSearch->UpdateDirections(&epv.at(max_pos));
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,TRUE);
MFCSearch->DoSearch(out,epv,SCSEARCH,searchtype,stcounter,TRUE,use_segList);
}
......@@ -1140,7 +1140,7 @@ int main(int argc, char *argv[]) {
MFCSearch->UpdateStartstep();
MFCSearch->PrintDirections();
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,FALSE);
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,FALSE,MFCSearch->singleSegment());
if (MFCSearch->outputTiming()) {
......@@ -1158,7 +1158,7 @@ int main(int argc, char *argv[]) {
}
}
MFCSearch->UpdateDirections(&epv.at(max_pos));
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,TRUE);
MFCSearch->DoSearch(out,epv,FCSEARCH,searchtype,stcounter,TRUE,MFCSearch->singleSegment());
}
......@@ -1870,6 +1870,8 @@ INT4 FCSearch::XLALInitUserVars ( int argc, char *argv[] )
uvar->metricType = MTPHASE;
}
MetricType(uvar->metricType);
if (BinarySearch() && (uvar->metricType == MTAVFSTAT)){
LogPrintf(LOG_NORMAL, "For a BNS search metricType must be 0!\n");
return ( FSTATFCNOMAD_EBAD );
......
......@@ -2835,7 +2835,7 @@ gsl_vector* FStatNomad::RandomPointInside(gsl_matrix *g, Point start_point,Point
return c;
}
INT4 FStatNomad::DoSearch(Display out,vector<ExPoint> &epv,INT4 fstatsearchtype,vector<INT4> searchtype, INT4 &stcounter, BOOLEAN randomstartpoint) {
INT4 FStatNomad::DoSearch(Display out,vector<ExPoint> &epv,INT4 fstatsearchtype,vector<INT4> searchtype, INT4 &stcounter, BOOLEAN randomstartpoint, LALSegList *segList) {
for (INT4 s=0; s<numsteps; s++) {
bFirstPoint.push_back(true);
......@@ -2991,16 +2991,22 @@ INT4 FStatNomad::DoSearch(Display out,vector<ExPoint> &epv,INT4 fstatsearchtype,
// user search:
if (HybridSearch()){
gsl_matrix *hsemig = gsl_matrix_calloc(DimMetric(SType(),USETYPE_EXTENDS),DimMetric(SType(),USETYPE_EXTENDS));
ExPoint xp;
SetPoint(&xp);
compute_metric(hsemig,segList,SType(),&xp,USETYPE_EXTENDS,metricType);
SCHybridSearch *hybrid_search = new SCHybridSearch ( p );
hybrid_search->Tiling(tiling);
hybrid_search->NumberPoints(var_HybridSearchPoints);
hybrid_search->Directions(directions);
hybrid_search->Lattice(HybridSearchLattice());
hybrid_search->M(HybridSearchMismatch());
hybrid_search->G(Semicohmetric());
hybrid_search->MDim(DimMetric(SType(),USETYPE_SEARCH));
gsl_vector* minext = gsl_vector_alloc(DimMetric(SType(),USETYPE_SEARCH));
compute_min_extent(minext,Semicohmetric());
hybrid_search->G(hsemig);
hybrid_search->MDim(DimMetric(SType(),USETYPE_EXTENDS));
gsl_vector* minext = gsl_vector_alloc(DimMetric(SType(),USETYPE_EXTENDS));
compute_min_extent(minext,hsemig);
hybrid_search->MinExt(minext);
if (HybridSearchLatticeAtOnce()){
hybrid_search->PartialLattice(FALSE);
......@@ -3051,17 +3057,22 @@ INT4 FStatNomad::DoSearch(Display out,vector<ExPoint> &epv,INT4 fstatsearchtype,
trials_init();
if (FinalHybridSearch()){
gsl_matrix *hg = gsl_matrix_calloc(DimMetric(SType(),USETYPE_EXTENDS),DimMetric(SType(),USETYPE_EXTENDS));
ExPoint xp;
SetPoint(&xp);
compute_metric(hg,segList,SType(),&xp,USETYPE_EXTENDS,metricType);
FCHybridSearch *hybrid_search = new FCHybridSearch ( p );
hybrid_search->Tiling(tiling);
hybrid_search->NumberPoints(var_FinalHybridSearchPoints);
hybrid_search->Directions(directions);
hybrid_search->Lattice(FinalHybridSearchLattice());
hybrid_search->M(FinalHybridSearchMismatch());
hybrid_search->G(Cohmetric());
hybrid_search->MDim(DimMetric(SType(),USETYPE_SEARCH));
hybrid_search->MDim(DimMetric(SType(),USETYPE_SEARCH));
gsl_vector* minext = gsl_vector_alloc(DimMetric(SType(),USETYPE_SEARCH));
compute_min_extent(minext,Cohmetric());
hybrid_search->G(hg);
hybrid_search->MDim(DimMetric(SType(),USETYPE_EXTENDS));
hybrid_search->MDim(DimMetric(SType(),USETYPE_EXTENDS));
gsl_vector* minext = gsl_vector_alloc(DimMetric(SType(),USETYPE_EXTENDS));
compute_min_extent(minext,hg);
hybrid_search->MinExt(minext);
if (FinalHybridSearchLatticeAtOnce()){
hybrid_search->PartialLattice(FALSE);
......@@ -3311,7 +3322,6 @@ FStatNomad::~FStatNomad() {};
void FStatNomad::HybridSearchCreateLattice(gsl_matrix *g, REAL4 m,CHAR *lattice) {
tiling = NULL;
tiling = XLALCreateLatticeTiling(DimMetric(SType(),USETYPE_SEARCH));
......@@ -3473,7 +3483,7 @@ void SCHybridSearch::search( Mads & mads, int &nb_search_pts, bool &stop, stop_t
const size_t ln = XLALTotalLatticeTilingDimensions(ptiling);
// Set lattice and metric
// printf("g dimensions [%d,%d]\n",g->size1,g->size2);
XLAL_CHECK_MAIN(XLALSetTilingLatticeAndMetric(ptiling, lattice, g, m) == XLAL_SUCCESS, XLAL_EFUNC);
......
......@@ -507,7 +507,7 @@ public:
void SetUpSFTs( LALStatus *status, FstatInputVector** p_Fstat_in_vec, UsefulStageVariables *in, LALSegList *segList);
REAL8 Randomize(REAL8 s, REAL8 u, REAL8 l, INT4 p);
gsl_vector* RandomPointInside(gsl_matrix *g, NOMAD::Point start_point,NOMAD::Point upper_bound, NOMAD::Point lower_bound, NOMAD::Point scale_point, INT4 p);
INT4 DoSearch(NOMAD::Display out,std::vector<ExPoint> &epv,INT4 fstatsearchtype,std::vector<INT4> searchtype, INT4 &stcounter, BOOLEAN randomstartpoint);
INT4 DoSearch(NOMAD::Display out,std::vector<ExPoint> &epv,INT4 fstatsearchtype,std::vector<INT4> searchtype, INT4 &stcounter, BOOLEAN randomstartpoint,LALSegList *segList);
REAL4 get_max_F(REAL4 *data,INT4 len) {
REAL4 max_F = 0;
......@@ -2237,8 +2237,15 @@ protected:
void CopyFstatVector(FstatInputVector **local_Fstat_in_vec, FstatInputVector *Fstat_in_vec);
void MetricType(INT4 v){
metricType = v;
}
private:
INT4 metricType;
INT4 var_Ndet;
LALSegList *org_segList;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment