%d*%-methods            package:fields            R Documentation

_M_u_l_t_i_p_l_y_i_n_g _d_i_a_g_o_n_a_l _m_a_t_r_i_c_e_s  _i_n _P_a_c_k_a_g_e _f_i_e_l_d_s

_D_e_s_c_r_i_p_t_i_o_n:

     Recognizes a left vector as the elements of a diagonal matrix and 
     does the right multiplication efficiently (this is not rocket
     science!). This method is used in the  internal functions of Krig
     to make the code more readable. It avoids having  a branch in the
     source code to handle the diagonal or nondiagonal cases. Note that
     this operator is not symmetric: a vector in the left argument is
     interpreted as a diagonal matrix and a vector in the right
     argument is  kept as a column vector.

_M_e_t_h_o_d_s:


     _x = "_m_a_t_r_i_x", _y = "_m_a_t_r_i_x" computes x%*%y 

     _x = "_m_a_t_r_i_x", _y = "_n_u_m_e_r_i_c" computes x%*% diag(y)

     _x = "_n_u_m_e_r_i_c", _y = "_m_a_t_r_i_x" computes diag( x)%*% y

     _x = "_n_u_m_e_r_i_c", _y = "_n_u_m_e_r_i_c" computes  diag(x)%*% y,  the diagonal
          matrix x multiplied by a vector. 


