Beispiel #1
0
    void forward_eval_loop(const TT& const_first_eval, const UU& const_second_eval, boost::mpl::false_)
    {	
	vampir_trace<6001> tracer;
	// hope there is a more elegant way; copying the arguments causes errors due to double destructor evaluation
	TT& first_eval= const_cast<TT&>(const_first_eval);  
	UU& second_eval= const_cast<UU&>(const_second_eval);
	MTL_DEBUG_THROW_IF(mtl::size(first_eval) != mtl::size(second_eval), incompatible_size());	

	for (std::size_t i= 0, s= size(first_eval); i < s; i++) {
	    first_eval(i); second_eval(i);
	}	
    }
Beispiel #2
0
    void backward_eval_loop(const TT& const_first_eval, const UU& const_second_eval, boost::mpl::false_)
    {	
	vampir_trace<6003> tracer;
	// hope there is a more elegant way; copying the arguments causes errors due to double destructor evaluation
	TT& first_eval= const_cast<TT&>(const_first_eval);  
	UU& second_eval= const_cast<UU&>(const_second_eval);
	MTL_DEBUG_THROW_IF(mtl::vector::size(first_eval) != mtl::vector::size(second_eval), incompatible_size());	

	for (std::size_t i= size(first_eval); i-- > 0; ) {
	    // std::cout << "i is " << i << "\n";
	    first_eval(i); second_eval(i);
	}
    }
Beispiel #3
0
    void forward_eval_loop(const TT& const_first_eval, const UU& const_second_eval, boost::mpl::true_)
    {	
	vampir_trace<6002> tracer;
	// hope there is a more elegant way; copying the arguments causes errors due to double destructor evaluation
	TT& first_eval= const_cast<TT&>(const_first_eval);  
	UU& second_eval= const_cast<UU&>(const_second_eval);
	MTL_DEBUG_THROW_IF(mtl::vec::size(first_eval) != mtl::vec::size(second_eval), incompatible_size());	

	const std::size_t s= size(first_eval), sb= s >> 2 << 2;

	for (std::size_t i= 0; i < sb; i+= 4) {
	    first_eval.template at<0>(i); second_eval.template at<0>(i);
	    first_eval.template at<1>(i); second_eval.template at<1>(i);
	    first_eval.template at<2>(i); second_eval.template at<2>(i);
	    first_eval.template at<3>(i); second_eval.template at<3>(i);
	}

	for (std::size_t i= sb; i < s; i++) {
	    first_eval(i); second_eval(i);
	}
    }
Beispiel #4
0
    void backward_eval_loop(const TT& const_first_eval, const UU& const_second_eval, boost::mpl::true_)
    {	
	vampir_trace<6004> tracer;
	// hope there is a more elegant way; copying the arguments causes errors due to double destructor evaluation
	TT& first_eval= const_cast<TT&>(const_first_eval);  
	UU& second_eval= const_cast<UU&>(const_second_eval);
	MTL_DEBUG_THROW_IF(mtl::size(first_eval) != mtl::size(second_eval), incompatible_size());	

	std::size_t s= size(first_eval), i= s-1, m= s % 4;
	for (; m; m--) {
	    // std::cout << "i is " << i << "\n";
	    first_eval(i); second_eval(i--);
	}
	for(long j= i - 3; j >= 0; j-= 4) {
	    // std::cout << "i is " << j+3 << ".." << j << "\n";
	    first_eval.template at<3>(j); second_eval.template at<3>(j);
	    first_eval.template at<2>(j); second_eval.template at<2>(j);
	    first_eval.template at<1>(j); second_eval.template at<1>(j);
	    first_eval.template at<0>(j); second_eval.template at<0>(j);
	}
    }