コード例 #1
0
ファイル: bicgstab.hpp プロジェクト: inducer/pyublasext
      void apply(const OperandType &operand, ResultType result) const
      {
        super::apply(operand, result);

        ResultType iterand = result;
        iterand.clear();
        solve_bicgstab(
            m_matrix, 
            m_preconditioner, 
            iterand, 
            operand, 
            this->m_tolerance,
            this->m_maxIterations, 
            const_cast<unsigned *>(&this->m_lastIterationCount), 
            this->m_debugLevel);
        result.assign(iterand);
      }
コード例 #2
0
ファイル: matrix_operator.hpp プロジェクト: ajocksch/arpack
      void apply(const OperandType &operand, ResultType result) const
      {
        super::apply(operand, result);
        typedef typename real_operator::result_type::value_type real_t;
        typedef std::complex<real_t> complex_t;
        typename real_operator::operand_type 
          operand_real(real(operand)), operand_imag(imag(operand));
        typename real_operator::result_type 
          result_real_1(real(result)), result_imag_1(imag(result)),
          result_real_2(real(result)), result_imag_2(imag(result));

        m_real.apply(operand_real, result_real_1);
        m_imaginary.apply(operand_imag, result_real_2);
        result_real_2 *= -1;

        m_imaginary.apply(operand_real, result_imag_1);
        m_real.apply(operand_imag, result_imag_2);

        OperandType result_imag_12 = result_imag_1 + result_imag_2;

        result.assign(result_real_1 + result_real_2 + complex_t(0,1) * result_imag_12);
      }
コード例 #3
0
ファイル: matrix_operator.hpp プロジェクト: ajocksch/arpack
 void apply(const OperandType &operand, ResultType result) const
 {
   super::apply(operand, result);
   result.assign(m_factor * operand);
 }