From: Roy Stogner <roystgnr@ic...>  20081105 22:18:09

On Wed, 5 Nov 2008, Derek Gaston wrote: > Anyone have a good piece of code for computing a norm of just the > piece of a NumericVector that corresponds to a specific variable > number? My problem is that I have multiple > variables in my system... but I need to get the norm of the residual > for each one individually. > > Should we maybe extend the l2_norm(), l1_norm(), linfty_norm() > functions to take an option variable number? Does the NumericVector class even have enough information to know which variable a coefficient belongs to? I'd hope it doesn't; I like modular code. I think what you want to modify is the SystemNorm class. Currently it assumes that you either want a weighted combination of Sobolev norms of different variables or a discrete norm of the entire vector. Extending it (and the classes that use it) to provide weighted discrete norms of particular combinations of variables within a vector should be straightforward.  Roy 