Ejemplo n.º 1
0
        /* explicit */
        perspective::perspective(float a, viewport_type const& b, glm::vec2 const& c)
          : base(matrix_type(), b, c),
            fovy(*this, "fovy", a)
        {
          TRACE("hugh::scene::object::camera::perspective::perspective");

          viewport.touch(); // force 'projection_' update in 'do_changed'
        }
Ejemplo n.º 2
0
template <bool F> matrix_type BetheSalpeter<matrix_type, F>::solve_inversion()
{
    if (verbosity_ > 0) INFO_NONEWLINE("Running" << ((!fwd)?" inverse ":" ") << "matrix BS equation...");
    size_t size = vertex_.rows(); 
    matrix_type V4Chi = fwd ? matrix_type(matrix_type::Identity(size,size) - vertex_*bubble_) : matrix_type(matrix_type::Identity(size,size) + bubble_*vertex_);

    Eigen::PartialPivLU<matrix_type> Solver(V4Chi);
    det_ = Solver.determinant(); 

    assert(is_float_equal(det_, V4Chi.determinant(), 1e-6));

    if (std::abs(std::imag(det_))>1e-2 * std::abs(std::real(det_))) { ERROR("Determinant : " << det_); throw (std::logic_error("Complex determinant in BS. Exiting.")); };
    if ((std::real(det_))<1e-2) INFO3("Determinant : " << det_);

    if (std::real(det_) < std::numeric_limits<real_type>::epsilon()) {
        ERROR("Can't solve Bethe-Salpeter equation by inversion");
        return std::move(V4Chi);
    }

    V4Chi = fwd ? matrix_type(Solver.solve(vertex_)) : matrix_type(vertex_*Solver.inverse());
                //V4Chi=vertex_*Solver.inverse();
    if (verbosity_ > 0) INFO("done.");
    return std::move(V4Chi);
}
Ejemplo n.º 3
0
transform3_param_t::matrix_type transform3_param_t::matrix_at_frame( float frame, float aspect, int subsample) const
{
	Imath::V3f c = get_center_at_frame( frame) / subsample;
    Imath::V3f t = get_value_at_frame<Imath::V3f>( translate_param(), frame) / subsample;
    Imath::V3f s = get_value_at_frame<Imath::V3f>( scale_param(), frame);
    Imath::V3f r = get_value_at_frame<Imath::V3f>( rotate_param(), frame) * math::constants<float>::deg2rad();

	transform3_param_t::matrix_type m = matrix_type().setTranslation( -c) *
										matrix_type().setScale( Imath::V3f( aspect, 1.0f, 1.0f)) *
										matrix_type().setScale( s) *
										matrix_type().setEulerAngles( r) *
										matrix_type().setTranslation( t) *
										matrix_type().setScale( Imath::V3f( 1.0f / aspect, 1.0f, 1.0f)) *
										matrix_type().setTranslation( c);

    return m;
}
Ejemplo n.º 4
0
bare_expr_type::bare_expr_type(const matrix_type& x)
    : bare_type_(matrix_type(x.is_data_)) {}
Ejemplo n.º 5
0
bool bare_expr_type::is_matrix_type() const {
  return order_id() == matrix_type().oid();
}
Ejemplo n.º 6
0
	tensor (const matrix_expression_type<derived_type> &expr)
		: tensor(  matrix_type ( expr )  )
	{
	}
Ejemplo n.º 7
0
 matrix_type operator()(const word_type& word) const
 {
   return matrix_type(const_cast<parameter_type*>(mapped_.begin() + rows_ * vocab_[word]), rows_, 1);
 }
Ejemplo n.º 8
0
 matrix_type operator()() const { return matrix_type(const_cast<parameter_type*>(mapped_.begin()), rows_, cols_); }