// TrfVector_nvec.h #ifndef TrfVector_nvec_H #define TrfVector_nvec_H // Header for using nvector, matrix and smatrix classes. // Contains headers for underlying TrfVector, TrfMatrix and TrfSMatrix // classes and corresponding typedefs. #include "trfutil/nvector.h" #include "trfutil/smatrix.h" #include "trfutil/matrix.h" namespace trf { //********************************************************************** typedef nvector TrfVector; //********************************************************************** typedef matrix TrfMatrix; //********************************************************************** class TrfSMatrix : public smatrix { public: // methods // Constructor. explicit TrfSMatrix(int dim) : smatrix(dim) { } // Constructor from base. TrfSMatrix(const smatrix& rhs) : smatrix(rhs) { } // Xform M * S * MT TrfSMatrix xform(const TrfMatrix& mtx) const { assert( nrow() == mtx.ncol() ); const smatrix& rsma = *this; const matrix& rmtx = mtx; return rmtx % rsma; } }; } // end namespace trf //********************************************************************** // Chi-square difference. inline double chisq_diff(const TrfVector& vecdiff, const TrfSMatrix& inverr) { return inverr % vecdiff; } //********************************************************************** #endif