write doubles to bams for double types

This commit is contained in:
David Rose 2003-10-25 15:17:39 +00:00
parent 474209d9d1
commit f6689fe2bd
3 changed files with 36 additions and 0 deletions

View File

@ -577,8 +577,13 @@ generate_hash(ChecksumHashGenerator &hashgen, FLOATTYPE threshold) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase2)::
write_datagram(Datagram &destination) const {
#if FLOATTOKEN == 'f'
destination.add_float32(_v.v._0);
destination.add_float32(_v.v._1);
#else
destination.add_float64(_v.v._0);
destination.add_float64(_v.v._1);
#endif
}
////////////////////////////////////////////////////////////////////
@ -588,7 +593,12 @@ write_datagram(Datagram &destination) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase2)::
read_datagram(DatagramIterator &source) {
#if FLOATTOKEN == 'f'
_v.v._0 = source.get_float32();
_v.v._1 = source.get_float32();
#else
_v.v._0 = source.get_float64();
_v.v._1 = source.get_float64();
#endif
}

View File

@ -659,9 +659,15 @@ generate_hash(ChecksumHashGenerator &hashgen, FLOATTYPE threshold) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase3)::
write_datagram(Datagram &destination) const {
#if FLOATTOKEN == 'f'
destination.add_float32(_v.v._0);
destination.add_float32(_v.v._1);
destination.add_float32(_v.v._2);
#else
destination.add_float64(_v.v._0);
destination.add_float64(_v.v._1);
destination.add_float64(_v.v._2);
#endif
}
////////////////////////////////////////////////////////////////////
@ -671,7 +677,13 @@ write_datagram(Datagram &destination) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase3)::
read_datagram(DatagramIterator &source) {
#if FLOATTOKEN == 'f'
_v.v._0 = source.get_float32();
_v.v._1 = source.get_float32();
_v.v._2 = source.get_float32();
#else
_v.v._0 = source.get_float64();
_v.v._1 = source.get_float64();
_v.v._2 = source.get_float64();
#endif
}

View File

@ -699,10 +699,17 @@ generate_hash(ChecksumHashGenerator &hashgen, FLOATTYPE threshold) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase4)::
write_datagram(Datagram &destination) const {
#if FLOATTOKEN == 'f'
destination.add_float32(_v.v._0);
destination.add_float32(_v.v._1);
destination.add_float32(_v.v._2);
destination.add_float32(_v.v._3);
#else
destination.add_float64(_v.v._0);
destination.add_float64(_v.v._1);
destination.add_float64(_v.v._2);
destination.add_float64(_v.v._3);
#endif
}
////////////////////////////////////////////////////////////////////
@ -712,8 +719,15 @@ write_datagram(Datagram &destination) const {
////////////////////////////////////////////////////////////////////
INLINE_LINMATH void FLOATNAME(LVecBase4)::
read_datagram(DatagramIterator &source) {
#if FLOATTOKEN == 'f'
_v.v._0 = source.get_float32();
_v.v._1 = source.get_float32();
_v.v._2 = source.get_float32();
_v.v._3 = source.get_float32();
#else
_v.v._0 = source.get_float64();
_v.v._1 = source.get_float64();
_v.v._2 = source.get_float64();
_v.v._3 = source.get_float64();
#endif
}