|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2004-01-09 19:30:47
"Matthias Schabel" <boost_at_[hidden]> wrote in message
news:4277226C-415D-11D8-8726-000393DC6706_at_schabel-family.org...
> template<class Y>
> dimensioned_quantity<Y,dimensioned_unit<si_model,quantity_type> >
> idealGasLaw(dimensioned_quantity<Y,dimensioned_unit<si_model,pressure_ty
> pe> > P,
>
> dimensioned_quantity<Y,dimensioned_unit<si_model,volume_type> > V,
>
> dimensioned_quantity<Y,dimensioned_unit<si_model,temperature_type> > T)
> {
> return (P*V/(8.314*(_joules/(_kelvin*_mole))*T));
> }
>
> // test ideal gas law
> SI<double>::temperature T = (273.+37.)*_kelvin;
> SI<double>::pressure P = 1.01325e5*_pascals;
> SI<double>::length r = 0.5e-6*_meters;
> SI<double>::volume V = (4.0/3.0)*3.141592*power<3>(r);
> SI<double>::quantity n(idealGasLaw(P,V,T));
But isnt this a bit runtime-slow Matt?
BTW I looked into your ct problems. VC 7.1 has some neat specialisations.
(Doesnt work on gcc)
have you tried masks?
Basically 7 dimensions --> 127 (I think) mask possibilities
If interested Will try to look out the code.
Results in a big header .... but gives fast compile.
regards
Andy Little
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk