예제 #1
0
	bool mat_sqrt(const complex_vec_t& matrix, complex_vec_t& result) {
		result.clear();
		for(complex_vec_t::const_iterator i = matrix.begin(); i != matrix.end(); ++ i) {
			result.push_back(sqrt(*i));
		} // for
		return true;
	} // mat_sqrt()
예제 #2
0
	bool mat_mul(complex_t scalar, const complex_vec_t& matrix, complex_vec_t& result) {
		result.clear();
		for(complex_vec_t::const_iterator i = matrix.begin(); i != matrix.end(); ++ i) {
			result.push_back((*i) * scalar);
		} // for
		return true;
	} // mat_mul()
예제 #3
0
 bool AnalyticFormFactor::mat_sinc(unsigned int x_size, unsigned int y_size, unsigned int z_size,
                   const complex_vec_t& matrix, complex_vec_t& result) {
   result.clear();
   for(std::vector<complex_t>::const_iterator i = matrix.begin(); i != matrix.end(); ++ i) {
     result.push_back(sinc(*i));
   } // for
   return true;
 } // AnalyticFormFactor::mat_sinc()
예제 #4
0
 bool AnalyticFormFactor::mat_fq_inv(unsigned int x_size, unsigned int y_size, unsigned int z_size,
                   const complex_vec_t& matrix, real_t y, complex_vec_t& result) {
   result.clear();
   for(complex_vec_t::const_iterator i = matrix.begin(); i != matrix.end(); ++ i) {
     result.push_back(fq_inv(*i, y));
   } // for
   return true;
 } // AnalyticFormFactor::mat_fq_inv()
예제 #5
0
	/**
	 * computes element-by-element division of two matrices (matrix1 / matrix2)	into result
	 */
	bool mat_dot_div(unsigned int nx1, unsigned int ny1, unsigned int nz1,
						const complex_vec_t& matrix1,
						unsigned int nx2, unsigned int ny2, unsigned int nz2,
						const complex_vec_t& matrix2,
						complex_vec_t& result) {
		if(nx1 != nx2 || ny1 != ny2 || nz1 != nz2 || matrix1.size() != matrix2.size()) {
			std::cerr << "error: matrix sizes are not the same for dot division operation"
						<< std::endl;
			return false;
		} // if
		result.clear();
		complex_vec_t::const_iterator i1 = matrix1.begin();
		complex_vec_t::const_iterator i2 = matrix2.begin();
		for(; i1 != matrix1.end(); ++ i1, ++ i2) {
			result.push_back((*i1) / (*i2));
		} // for
		return true;
	} // mat_dot_div()
예제 #6
0
	/**
	 * computes element-by-element product of two matrices into result
	 */
	bool mat_dot_prod(unsigned int x1_size, unsigned int y1_size, unsigned int z1_size,
						const complex_vec_t& matrix1,
						unsigned int x2_size, unsigned int y2_size, unsigned int z2_size,
						const complex_vec_t& matrix2,
						complex_vec_t& result) {
		if(x1_size != x2_size || y1_size != y2_size || z1_size != z2_size
				|| matrix1.size() != matrix2.size()) {
			std::cerr << "error: matrix sizes are not the same for dot product operation" << std::endl;
			return false;
		} // if
		result.clear();
		complex_vec_t::const_iterator i1 = matrix1.begin();
		complex_vec_t::const_iterator i2 = matrix2.begin();
		for(; i1 != matrix1.end(); ++ i1, ++ i2) {
			result.push_back((*i1) * (*i2));
		} // for
		return true;
	} // mat_dot_prod()
예제 #7
0
 bool AnalyticFormFactor::mat_fq_inv_in(unsigned int x_size,
                     unsigned int y_size,
                     unsigned int z_size,
                     complex_vec_t& matrix, real_t y) {
   for(complex_vec_t::iterator i = matrix.begin(); i != matrix.end(); ++ i) {
     *i = fq_inv(*i, y);
   } // for
   
   return true;
 } // AnalyticFormFactor::mat_fq_inv()
예제 #8
0
	bool mat_exp_in(complex_vec_t& matrix) {
		for(complex_vec_t::iterator i = matrix.begin(); i != matrix.end(); ++ i) *i = exp(*i);
	} // mat_exp_in()
예제 #9
0
	bool mat_exp(complex_vec_t& matrix, complex_vec_t& result) {
		result.clear();
		for(complex_vec_t::iterator i = matrix.begin(); i != matrix.end(); ++ i)
			result.push_back(exp(*i));
	} // mat_exp()
예제 #10
0
	bool mat_mul_in(complex_t scalar, complex_vec_t& matrix) {
		for(complex_vec_t::iterator i = matrix.begin(); i != matrix.end(); ++ i) {
			*i = (*i) * scalar;
		} // for
		return true;
	} // mat_mul()