quantity-devel Mailing List for Quantities (Page 2)
Brought to you by:
berndspeiser
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(28) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(4) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ber...@t-...> - 2004-07-06 21:45:45
|
Kai Ludwig wrote: >>The new constructors for Variables and Constants from a number and a >>unit (either as std::string or char *) have been uploaded to the cvs >>server. Have fun! > > > > Bernd, > > are you sure that you've uploaded the modified version? > I've done a fresh checkout but could not find the > Constructors. > Also I've tried > > Concentration cc(0.5,"molL^-1"); > > to the test program and it did not compile: > > e.h: In constructor > `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, > UTail>, DU, DT>, U>::Variable(DT, const NU&) [with NU = char[8], GT > = Quantities::ConcentrationGroup, Head = > Quantities::ConcentrationUnits::MolePerLitre, Tail = > Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, > Loki::NullType>, DU = Quantities::ConcentrationUnits::MolePerLitre, U > = Quantities::ConcentrationUnits::MolePerLitre, DT = double]': > modelParametersDialog.cpp:339: instantiated from here > /home/kl/software/src/quantity/Quantities/Quantity/Variable.h:125: no > method ` Units::UnitError<true>::Standard' I thought I did. But in the meantime some further changes have been made and uploaded (around 23:30, Tuesday). The above should work. If it doesn't you can not have the most rectn version, and something is wrong. Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Kai L. <kai...@un...> - 2004-07-06 20:10:36
|
Bernd, just implemented a combo box for temperature units. As we discussed yesterday, I check the available units with the allsymbols() method: YK ZK EK PK TK GK MK kK hK daK K dK cK mK muK nK pK fK aK zK yK oC oR oF well, maybe also a function, say 'commonsymbols()' that returns only oC,K,oF would be adequate. Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: Kai L. <kai...@un...> - 2004-07-06 20:04:32
|
> The new constructors for Variables and Constants from a number and a > unit (either as std::string or char *) have been uploaded to the cvs > server. Have fun! Bernd, are you sure that you've uploaded the modified version? I've done a fresh checkout but could not find the Constructors. Also I've tried Concentration cc(0.5,"molL^-1"); to the test program and it did not compile: e.h: In constructor `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>, DU, DT>, U>::Variable(DT, const NU&) [with NU =3D char[8], G= T =3D Quantities::ConcentrationGroup, Head =3D Quantities::ConcentrationUnits::MolePerLitre, Tail =3D Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, Loki::NullType>, DU =3D Quantities::ConcentrationUnits::MolePerLitre, = U =3D Quantities::ConcentrationUnits::MolePerLitre, DT =3D double]': modelParametersDialog.cpp:339: instantiated from here /home/kl/software/src/quantity/Quantities/Quantity/Variable.h:125: no method ` Units::UnitError<true>::Standard' ??Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: <ber...@t-...> - 2004-07-06 18:00:43
|
The new constructors for Variables and Constants from a number and a unit (either as std::string or char *) have been uploaded to the cvs server. Have fun! Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Bernd S. <ber...@un...> - 2004-07-06 15:38:02
|
I'm sending this to quantity-devel only, since this is technical stuff. The problem Kai detected is difficult to solve. In fact, regrettably, I hadn't even really tested the constructor Variable (value, unit) in the situation where unit is generated by lookup of the unit string. the lookup function AllUnits::unit (std::string) returns a pointer the the base class of the unit found, i.e. TimeUnit if a Minute is found. That's ok if we just need one of the virtual functions of this object, e.g. standard () (see, method read_value in Variable.h). If we want to use the constructor above, it relies on the correctness of the type of the unit object passed, since it does check (at compile time) whether this type occurs in the list of units of the quantity in question. Of course, the base class is not in the list!! On the other hand, I think, we can not know at compile time the string of the unit symbol anyway, can we? It might be supplied by the user through a GUI for example. Thus, there is no way to compile time check the correctness of the unit object anyway. I suggest to have another constructor Variable (value, std::string) which generates the corresponding unit object at run time through AllUnits::unit (), does the necessary computation and the throws away this object. Note, that a statement like Time t (1.0, Minute ()) generates a Time object which stores its value in seconds, the Minute just indicates that the value 1.0 is to be interpreted as a minute! An object which stores in minutes would be MinuteTime! This would also solve the problem of having the caller require to delete the generated object. It could be done hidden inside the constructor. Maybe AllUnits::unit should then be made private. Would that help? Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Kai L. <kai...@un...> - 2004-07-06 12:52:13
|
> in principle, this should work, as we already discussed. > Could you make one more test: > check: > > Unit *unitpointer =3D Concentration::AllUnits::unit (unit); results in error: error: use of class template `template<class GT, class DT> class Units::Unit' as expression > ConcentrationUnit *unitpointer =3D ... (and as above) results in (old) error: antity/Variable.h: In constructor ` Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>= , DU, DT>, U>::Variable(DT, const NU&) [with NU =3D Units::Unit<Quantities::ConcentrationGroup, double>, GT =3D Quantities::ConcentrationGroup, Head =3D Quantities::ConcentrationUnits::MolePerLitre, Tail =3D Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, Loki::NullType>, DU =3D Quantities::ConcentrationUnits::MolePerLitre, = U =3D Quantities::ConcentrationUnits::MolePerLitre, DT =3D double]': PhysicalQuantitiesTest.cc:1399: instantiated from here ../../Quantity/Variable.h:125: error: incomplete type 'Units::UnitError<true>' cannot be used to name a scope Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: <ber...@t-...> - 2004-07-06 12:35:47
|
Kai Ludwig wrote: > more details... > > >>Ok - works fine. But how can one generate the Unit of a physical >>quantity with a string? >>I tried the following, e.g. >> >>using namespace Quantities >> >>... >> >>Concentration(0.01,*(Concentration::AllUnits::unit(unit))) > Kai, in principle, this should work, as we already discussed. Could you make one more test: check: Unit *unitpointer = Concentration::AllUnits::unit (unit); Concentration c(0.01, *unitpointer); or ConcentrationUnit *unitpointer = ... (and as above) Does any of these work? Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Kai L. <kai...@un...> - 2004-07-06 07:11:46
|
more details... > Ok - works fine. But how can one generate the Unit of a physical > quantity with a string? > I tried the following, e.g. > > using namespace Quantities > > ... > > Concentration(0.01,*(Concentration::AllUnits::unit(unit))) the argument 'unit' is a string, dynamically acquired by a GUI. > > ... > > and got the error message: y/Variable.h: In constructor `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>, DU, DT>, U>::Variable(DT, const NU&) [with NU =3D Units::Unit<Quantities::ConcentrationGroup, double>, GT =3D Quantities::ConcentrationGroup, Head =3D Quantities::ConcentrationUnits::MolePerLitre, Tail =3D Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, Loki::NullType>, DU =3D Quantities::ConcentrationUnits::MolePerLitre, U =3D Quantities::ConcentrationUnits::MolePerLitre, DT =3D double]':modelParame= tersDialog.cpp:328: instantiated from here > antity/Variable.h:125: error: incomplete type 'Units::UnitError<true>' > cannot be used to name a scope Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: Kai L. <kai...@un...> - 2004-07-06 07:06:10
|
> The AllUnits template now contains a new member function `allsymbols > ()'. This returns a std::vector<std::string> of the unit symbols which > are listed for a certain quantity. > Could be used as > > std::vector<std::string> timeunit_symbols Time::AllUnits::allsymbols > (); Ok - works fine. But how can one generate the Unit of a physical quantity with a string? I tried the following, e.g. using namespace Quantities ... Concentration(0.01,*(Concentration::AllUnits::unit(unit))) ... and got the error message: antity/Variable.h:125: error: incomplete type 'Units::UnitError<true>' cannot be used to name a scope Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: Kai L. <kai...@un...> - 2004-07-05 21:34:09
|
> Kai, > I don't find any function corresponding to a replacing operator[] in > the STL. Do you have some reference? > Bernd well, there has to be one. std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); v[1] =3D 7; works fine. Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: <ber...@t-...> - 2004-07-05 15:11:23
|
Kai found earlier a problem with gcc 3.2 compilation of Quantities, and suggested that some compiler flags were the reason. Yes, indeed that's true. In particular, the -W flag produced many warnings, as regards missing initializers, unused variables of function calls, and non-initialized dummy variables. All these things have been corrected in the most recent cvs version of the code. I have also changed all compiler flags to include the -W flag. Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: <ber...@t-...> - 2004-07-05 13:11:00
|
Kai, I don't find any function corresponding to a replacing operator[] in the STL. Do you have some reference? Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: <ber...@t-...> - 2004-07-05 13:06:12
|
Kai Ludwig wrote:
> Bernd,
>
> I am working with the following (simple)
> implementation of a clear method within
> the VariableVector class:
>
> void clear()
> {
> values.clear();
> }
Has just been included into cvs.
Bernd
--
=======================================================================
Bernd Speiser
Institut f"ur Organische Chemie
Auf der Morgenstelle 18
D-72076 T"ubingen
Germany
phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory)
fax: +49-7071-295518
e-mail: ber...@un...
Internet: http://www.uni-tuebingen.de/speiser
=======================================================================
|
|
From: Kai L. <kai...@un...> - 2004-07-05 12:04:30
|
Bernd,
I am working with the following (simple)
implementation of a clear method within
the VariableVector class:
void clear()
{
values.clear();
}
--=20
http://echempp.sourceforge.net
Kai Ludwig
Institut f=FCr Organische Chemie
Auf der Morgenstelle 18
72076 T=FCbingen
Tel.: 07071/29-73049
Mail: kai...@un...
|
|
From: Bernd S. <ber...@un...> - 2004-07-05 11:41:27
|
The AllUnits template now contains a new member function `allsymbols ()'. This returns a std::vector<std::string> of the unit symbols which are listed for a certain quantity. Could be used as std::vector<std::string> timeunit_symbols Time::AllUnits::allsymbols (); This example is included in QuantityTest.cc. Please check under realistic conditions ... Bernd -- =================================================================== Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser =================================================================== |
|
From: Kai L. <kai...@un...> - 2004-07-05 08:50:40
|
> Kai Ludwig wrote: >> Hi, >> >> tested the following: >> >> std::vector<Concentration> >> >> got several warning from g++-3.2 ... >> /Quantity/Variable.h: In copy constructor >> `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, >> UTail>, DU, DT>, U>::Variable(const >> ies/Quantity/Unit.h:928: warning: `double dummy' might be used >> uninitialized in this function > > Kai, > I can't reproduce this error with gcc 3.2 on my notebook, > when I try > std::vector<Concentration> c_vec; > Is this really 3.2 and not 3.4??? no - it was g++-3.2 with the flags: -pipe -Wall -W -pedantic -Wno-long-long -O2 Kai --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: <ber...@t-...> - 2004-07-05 08:14:42
|
Kai Ludwig wrote: > Hi, > > tested the following: > > std::vector<Concentration> > > got several warning from g++-3.2 > > /Quantity/Variable.h: In copy constructor > `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>, > DU, DT>, U>::Variable(const Quantities::Variable<Quantities::Quantity<GT, > Loki::Typelist<U, UTail>, DU, DT>, U>&) [with GT = > Quantities::ConcentrationGroup, Head = > Quantities::ConcentrationUnits::MolePerLitre, Tail = > Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, > Loki::NullType>, DU = Quantities::ConcentrationUnits::MolePerLitre, U = > Quantities::ConcentrationUnits::MolePerLitre, DT = double]':modelParametersDialog.cpp:93: instantiated from `void > std::_Construct(_T1*, const _T2&) [with _T1 = Quantities::Concentration, > _T2 = Quantities::Variable<Quantities::ConcentrationQuantities, > Quantities::ConcentrationUnits::MolePerLitre>]'modelParametersDialog.cpp:492: instantiated from `void std::vector<_Tp, > _Alloc>::push_back(const _Tp&) [with _Tp = Quantities::Concentration, > _Alloc = std::allocator<Quantities::Concentration>]'modelParametersDialog.cpp:319: instantiated from here > /home/kl/software/src/quantity/Quantities/Quantity/Variable.h:132: > warning: base class `struct > Quantities::Quantity<Quantities::ConcentrationGroup, > Quantities::ConcentrationUnits::ConcentrationUnits, > Quantities::ConcentrationUnits::MolePerLitre, double>' should be > explicitly initialized in the copy constructor > and also > > ies/Quantity/Unit.h:928: warning: `double dummy' might be used > uninitialized in this function Kai, I can't reproduce this error with gcc 3.2 on my notebook, when I try std::vector<Concentration> c_vec; Is this really 3.2 and not 3.4??? Also, did you write a variable name, such as c_vec above? Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Kai L. <km...@us...> - 2004-07-03 17:17:35
|
Bernd,
I propose the following function in the
VariableVector class:
//! replace the element at position index
template<template<class, class> class Q1, class GT1, class Head1,
class Tail1, class DU1, class U1, class DT1>
void replace (const int index, const Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1> &new_quantity)
{
if (index >=3D 0 && index < length ())
{
values[index] =3D
Unit::Reverse(CheckAgainstAllUnits<typename Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1>::Unit,
typename TL::Append<Typelist<Head, Tail>,
NonPrefixable<typename Q1<Quantity<GT1,
Typelist<Head1, Tail1>, DU1, DT1>, U1>::Type,
GenericUnit, DT>
>::Result >::RET::Standard
(new_quantity.raw_value()));
}
else
{throw QuantityVectorOutOfBounds();}
}
Kai
--=20
http://echempp.sourceforge.net
Kai Ludwig
Institut f=FCr Organische Chemie
Auf der Morgenstelle 18
72076 T=FCbingen
Tel.: 07071/29-73049
Mail: kai...@un...
|
|
From: Kai L. <km...@us...> - 2004-07-03 14:18:40
|
Hi, tested the following: std::vector<Concentration> got several warning from g++-3.2 /Quantity/Variable.h: In copy constructor `Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>, DU, DT>, U>::Variable(const Quantities::Variable<Quantities::Quantity<GT, Loki::Typelist<U, UTail>, DU, DT>, U>&) [with GT =3D Quantities::ConcentrationGroup, Head =3D Quantities::ConcentrationUnits::MolePerLitre, Tail =3D Loki::Typelist<Quantities::ConcentrationUnits::MilliMolePerLitre, Loki::NullType>, DU =3D Quantities::ConcentrationUnits::MolePerLitre, U =3D Quantities::ConcentrationUnits::MolePerLitre, DT =3D double]':modelParame= tersDialog.cpp:93: instantiated from `void std::_Construct(_T1*, const _T2&) [with _T1 =3D Quantities::Concentration= , _T2 =3D Quantities::Variable<Quantities::ConcentrationQuantities, Quantities::ConcentrationUnits::MolePerLitre>]'modelParametersDialog.cpp:= 492: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp =3D Quantities::Concentration, _Alloc =3D std::allocator<Quantities::Concentration>]'modelParametersDial= og.cpp:319: instantiated from here /home/kl/software/src/quantity/Quantities/Quantity/Variable.h:132: warning: base class `struct Quantities::Quantity<Quantities::ConcentrationGroup, Quantities::ConcentrationUnits::ConcentrationUnits, Quantities::ConcentrationUnits::MolePerLitre, double>' should be explicitly initialized in the copy constructor and also ies/Quantity/Unit.h:928: warning: `double dummy' might be used uninitialized in this function --=20 http://echempp.sourceforge.net Kai Ludwig Institut f=FCr Organische Chemie Auf der Morgenstelle 18 72076 T=FCbingen Tel.: 07071/29-73049 Mail: kai...@un... |
|
From: <ber...@t-...> - 2004-07-01 17:38:14
|
Kai, in the PhysicalQuantitiesTest program you could use PureNumber ratio; cout << ratio (c1/cref) << std::endl; to get rid of the annoying (unknown unit). Alternatively, you can say: Fraction ratio = c1/cref; cout << ratio << std::endl; Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |
|
From: Bernd S. <ber...@un...> - 2004-07-01 10:49:15
|
Kai Ludwig wrote: > hi, > > I am working with a cvs working copy of the > new Quantities/BSUtilities tree. > (daily updated) want to multiply two > quantities and get the right unit, e.g. > > Concentration c1,c2; // MolePerLitre > GenericQuantity cc = c1*c2; > > should give a MolePerLitre^2 or something like > that. Seems to me that this is not supported > by now? > You are absolutely right. It is on my to-do list though. Regards Bernd -- =================================================================== Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser =================================================================== |
|
From: Kai L. <km...@us...> - 2004-07-01 08:18:44
|
hi, I am working with a cvs working copy of the new Quantities/BSUtilities tree. (daily updated) want to multiply two quantities and get the right unit, e.g. Concentration c1,c2; // MolePerLitre GenericQuantity cc = c1*c2; should give a MolePerLitre^2 or something like that. Seems to me that this is not supported by now? Kai |