Skip to content

Commit

Permalink
renaming objects->planets
Browse files Browse the repository at this point in the history
  • Loading branch information
j-faria committed Dec 15, 2017
1 parent b8685d4 commit ffbc792
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/RVmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ extern ContinuousDistribution *log_eta4_prior;

void RVmodel::from_prior(RNG& rng)
{
objects.from_prior(rng);
objects.consolidate_diff();
planets.from_prior(rng);
planets.consolidate_diff();

background = Cprior->rvs(rng);
extra_sigma = Jprior->rvs(rng);
Expand Down Expand Up @@ -153,12 +153,12 @@ void RVmodel::calculate_mu()
const vector<double>& t = Data::get_instance().get_t();

// Update or from scratch?
bool update = (objects.get_added().size() < objects.get_components().size()) &&
bool update = (planets.get_added().size() < planets.get_components().size()) &&
(staleness <= 10);

// Get the components
const vector< vector<double> >& components = (update)?(objects.get_added()):
(objects.get_components());
const vector< vector<double> >& components = (update)?(planets.get_added()):
(planets.get_components());
// at this point, components has:
// if updating: only the added planets' parameters
// if from scratch: all the planets' parameters
Expand Down Expand Up @@ -227,8 +227,8 @@ double RVmodel::perturb(RNG& rng)

if(rng.rand() <= 0.5)
{
logH += objects.perturb(rng);
objects.consolidate_diff();
logH += planets.perturb(rng);
planets.consolidate_diff();
calculate_mu();
}

Expand Down Expand Up @@ -442,7 +442,7 @@ void RVmodel::print(std::ostream& out) const
if(GP)
out<<eta1<<'\t'<<eta2<<'\t'<<eta3<<'\t'<<eta4<<'\t';

objects.print(out);
planets.print(out);

out<<' '<<staleness<<' ';
out<<background;
Expand All @@ -467,7 +467,7 @@ string RVmodel::description() const

desc += "Np\t";

if (objects.get_components().size()>0)
if (planets.get_components().size()>0)
desc += "P\tK\tphi\tecc\tchi\t";

desc += "staleness\tvsys";
Expand Down
2 changes: 1 addition & 1 deletion src/RVmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern const bool trend;
class RVmodel
{
private:
DNest4::RJObject<RVConditionalPrior> objects;
DNest4::RJObject<RVConditionalPrior> planets;

double background;
//std::vector<double> offsets;
Expand Down
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using namespace std;
using namespace DNest4;

/* edit from here on */

#include "default_priors.h"

const bool obs_after_HARPS_fibers = false;
Expand All @@ -16,7 +18,7 @@ const bool hyperpriors = false;
const bool trend = false;

RVmodel::RVmodel()
:objects(5, 1, true, RVConditionalPrior())
:planets(5, 0, true, RVConditionalPrior())
,mu(Data::get_instance().get_t().size())
,C(Data::get_instance().get_t().size(), Data::get_instance().get_t().size())
{
Expand Down

0 comments on commit ffbc792

Please sign in to comment.