コード例 #1
0
IMPISD_BEGIN_NAMESPACE

MultivariateFNormalSufficientSparse::MultivariateFNormalSufficientSparse(
        const MatrixXd& FX, double JF, const VectorXd& FM,
        const SparseMatrix<double>& Sigma, cholmod_common *c, double cutoff) :
    Object("Multivariate Normal distribution %1%")
{
        c_ = c;
        W_=nullptr;
        Sigma_=nullptr;
        P_=nullptr;
        PW_=nullptr;
        epsilon_=nullptr;
        L_=nullptr;
        N_=FX.rows();
        M_=FX.cols();
        IMP_LOG(TERSE, "MVNsparse: direct init with N=" << N_
                << " and M=" << M_ << std::endl);
        IMP_USAGE_CHECK( N_ > 0,
            "please provide at least one observation per dimension");
        IMP_USAGE_CHECK( M_ > 0,
            "please provide at least one variable");
        FM_=FM;
        set_FX(FX,cutoff); //also computes W, Fbar and epsilon.
        set_JF(JF);
        set_Sigma(Sigma); //computes the Cholesky decomp.
}
コード例 #2
0
MultivariateFNormalSufficient::MultivariateFNormalSufficient(
        const MatrixXd& FX, double JF, const VectorXd& FM,
        const MatrixXd& Sigma, double factor)
{
        //O(1)
        reset_flags();
        N_=FX.rows();
        M_=FX.cols();
        LOG( "MVN: direct init with N=" << N_
                << " and M=" << M_ << std::endl);
        CHECK( N_ > 0,
            "please provide at least one observation per dimension");
        CHECK( M_ > 0,
            "please provide at least one variable");
        set_factor(factor);
        set_FM(FM);
        set_FX(FX);
        set_jacobian(JF);
        set_Sigma(Sigma);
}
コード例 #3
0
MultivariateFNormalSufficient::MultivariateFNormalSufficient(
        const MatrixXd& FX, double JF, const VectorXd& FM,
        const MatrixXd& Sigma, double factor) :
  base::Object("Multivariate Normal distribution %1%")
{
        //O(1)
        reset_flags();
        N_=FX.rows();
        M_=FX.cols();
        IMP_LOG_TERSE( "MVN: direct init with N=" << N_
                << " and M=" << M_ << std::endl);
        IMP_USAGE_CHECK( N_ > 0,
            "please provide at least one observation per dimension");
        IMP_USAGE_CHECK( M_ > 0,
            "please provide at least one variable");
        set_factor(factor);
        set_FM(FM);
        set_FX(FX);
        set_jacobian(JF);
        set_Sigma(Sigma);
        use_cg_=false;
}