Abstract vector-multiplier type

Hi, thanks for your quick reply!
Sorry if I wasn’t clear, I was not referring to specific implementation, just any naïve implementation of CG method. It was just an example of situation. I have to admit that your answer covers the troubles I experienced so far. But as to the general question : there isn’t linear algebra interfaces ?