add a null model for comparison
parent
22cce59f2c
commit
e9504bd470
|
@ -490,6 +490,12 @@ void Base::reweight(Matrix &A1, Matrix &A2, Matrix &A3, Vector &error) const {
|
|||
}
|
||||
}
|
||||
|
||||
void Null::print(const std::string &s) const
|
||||
{ cout << s << ": null ()" << endl; }
|
||||
|
||||
Null::shared_ptr Null::Create()
|
||||
{ return shared_ptr(new Null()); }
|
||||
|
||||
Fair::Fair(const double c, const ReweightScheme reweight)
|
||||
: Base(reweight), c_(c) {
|
||||
if ( c_ <= 0 ) {
|
||||
|
|
|
@ -526,6 +526,17 @@ namespace gtsam {
|
|||
void reweight(Matrix &A1, Matrix &A2, Matrix &A3, Vector &error) const;
|
||||
};
|
||||
|
||||
class Null : public Base {
|
||||
public:
|
||||
typedef boost::shared_ptr<Null> shared_ptr;
|
||||
Null(const ReweightScheme reweight = Block) : Base(reweight) {}
|
||||
virtual ~Null() {}
|
||||
virtual double weight(const double &error) const { return 1.0; }
|
||||
virtual void print(const std::string &s) const ;
|
||||
virtual bool equals(const Base& expected, const double tol=1e-8) const { return true; }
|
||||
static shared_ptr Create() ;
|
||||
};
|
||||
|
||||
class Fair : public Base {
|
||||
public:
|
||||
typedef boost::shared_ptr<Fair> shared_ptr;
|
||||
|
|
Loading…
Reference in New Issue