Boost logo

Ublas :

From: Andrew Rieck (arieck_at_[hidden])
Date: 2005-07-11 03:34:17


ublas-bounces_at_[hidden] wrote on 11/07/2005 05:22:50 PM:
> > #include <limits>
> > #include <boost/call_traits.hpp>
>
> Your email got me thinking. I certainly dislike the ublas type_traits,
and
> using a boost/call_traits would be nice. Sadly the norms are always a
> sticking point. We need some way to define these.

> I think there is a logical reason to include abs etc, but not
> because they are
> 'needed'. I think the logic goes as follows:
> We need a definition of the norms. There is no generic solution
tothis, it
> requires some type specific information. We therefore have a traits
class.
> Since we must have this class, we can provide and interface so the user
can
> specify specific implementations for all higher functions.
>
> Interestingly for interval types there is the definition
> real_type abs (const_reference t) {
> return boost::numeric::abs (t);
> }
>
> to make sure the abs of the interval is used.

Function templates would naturally solve this issue and stop you having to
duplicate calls. In this way, the compiler is doing all the hard work.
A traits class should not have any member functions which do actual work.

Kind regards,
Andrew

Please consider our environment before printing this email.

WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments.

This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision.

Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency.

Westpac Banking Corporation ABN 33 007 457 141.