/*!\file Observation.c
 * \brief: implementation of the Observation object
 */

#include <stdlib.h>
#include "../classes.h"

/*Observation constructors and destructor*/
Observation::Observation(){/*{{{*/
	return;
}
/*}}}*/
Observation::Observation(double x_in,double y_in,int xi_in,int yi_in,int index_in,double value_in){/*{{{*/

	this->x      = x_in;
	this->y      = y_in;
	this->xi     = xi_in;
	this->yi     = yi_in;
	this->index  = index_in;
	this->value  = value_in;
	this->weight = 1.;

}
/*}}}*/
Observation::~Observation(){/*{{{*/
	return;
}
/*}}}*/

/*Object virtual functions definitions:*/
void Observation::Echo(void){/*{{{*/

	_printf_("Observation\n");
	_printf_("   index : " << this->index << "\n");
	_printf_("   x     : " << this->x << "\n");
	_printf_("   y     : " << this->y << "\n");
	_printf_("   xi    : \n"); printbinary(this->xi); _printf_("\n");
	_printf_("   yi    : \n"); printbinary(this->yi); _printf_("\n");
	_printf_("   weight: " << this->weight << "\n");
	_printf_("   value : " << this->value << "\n");
}
/*}}}*/
Object* Observation::copy(void){/*{{{*/

	Observation* observation = new Observation(this->x,this->y,this->xi,this->yi,this->index,this->value);

	observation->weight = this->weight;

	return (Object*) observation;

}
/*}}}*/

/*Observations functions*/
void Observation::WriteXYObs(double* px,double* py,double* pobs){/*{{{*/
	*px   = this->x;
	*py   = this->y;
	*pobs = this->value;
}
/*}}}*/
