Boost logo

Boost :

Subject: Re: [boost] [units] - learning to use, continued :)
From: Matthias Schabel (boost_at_[hidden])
Date: 2011-11-30 10:51:19


> first thing will be to figure out how to declare a type meter^-0.5
> maybe my previous try that didn't work with boost 1.42 will start to work with 1.48:
>
> typedef derived_dimension<length_base_dimension,root<2> >::type quantum_wavefunction_1D;

I tried to send a working version of your code yesterday, but the message was bounced because the attachments were too big; I will resend when I get to the office. For now, your problem here is twofold:

1) derived_dimension is a convenience typedef for integer powers; you need to use make_dimension_list<>
2) once you have defined the dimension, you also need to typedef a unit in the SI system corresponding to your desired length^(-1/2) dimension:

typedef unit<quantum_wavefunction_1D,si::system> quantum_wavefunction_1D_unit

Matthias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk