#ifndef __JMATRIX1S__ #define __JMATRIX1S__ #include #include #include "JMath/JMatrix1D.hh" #include "JLang/JException.hh" /** * \author mdejong */ namespace JMATH {} namespace JPP { using namespace JMATH; } namespace JMATH { using JLANG::JDivisionByZero; /** * 1 x 1 symmetric matrix */ class JMatrix1S : public JMatrix1D { public: /** * Default constructor. */ JMatrix1S() : JMatrix1D() {} /** * Contructor. * * \param A matrix */ JMatrix1S(const JMatrix1D& A) : JMatrix1D(A) {} /** * Contructor. * * \param __a00 (0,0) */ JMatrix1S(const double __a00) : JMatrix1D(__a00) {} /** * Invert matrix */ void invert() { if (a00 == 0) { throw JDivisionByZero("LDU decomposition zero pivot"); } a00 = 1.0 / a00; } }; } #endif