00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_DATATYPE_REGULARDATA1D_H
00008 #define BALL_DATATYPE_REGULARDATA1D_H
00009
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013
00014 #ifndef BALL_SYSTEM_FILE_H
00015 # include <BALL/SYSTEM/file.h>
00016 #endif
00017
00018 #include <vector>
00019 #include <iostream>
00020 #include <fstream>
00021 #include <iterator>
00022 #include <algorithm>
00023
00024 namespace BALL
00025 {
00037 template <typename ValueType>
00038 class TRegularData1D
00039 {
00040 public:
00041
00042 BALL_CREATE(TRegularData1D<ValueType>)
00043
00044
00047
00049 typedef Position IndexType;
00051 typedef std::vector<ValueType> VectorType;
00053 typedef double CoordinateType;
00055 typedef typename std::vector<ValueType>::iterator Iterator;
00057 typedef typename std::vector<ValueType>::const_iterator ConstIterator;
00059
00060
00061
00062 typedef ValueType value_type;
00063 typedef typename std::vector<ValueType>::iterator iterator;
00064 typedef typename std::vector<ValueType>::const_iterator const_iterator;
00065 typedef typename std::vector<ValueType>::reference reference;
00066 typedef typename std::vector<ValueType>::const_reference const_reference;
00067 typedef typename std::vector<ValueType>::pointer pointer;
00068 typedef typename std::vector<ValueType>::difference_type difference_type;
00069 typedef typename std::vector<ValueType>::size_type size_type;
00070
00074
00076 TRegularData1D();
00077
00079 TRegularData1D(const TRegularData1D& data)
00080 throw(Exception::OutOfMemory);
00081
00083 TRegularData1D(const CoordinateType& origin, const CoordinateType& dimension, const CoordinateType& spacing)
00084 throw(Exception::OutOfMemory);
00085
00087 TRegularData1D(const IndexType& size)
00088 throw(Exception::OutOfMemory);
00089
00091 TRegularData1D(const VectorType& data, const CoordinateType& origin = 0.0, const CoordinateType& dimension = 1.0)
00092 throw(Exception::OutOfMemory);
00093
00095 virtual ~TRegularData1D();
00096
00098 virtual void clear();
00100
00101
00105
00109 TRegularData1D& operator = (const TRegularData1D<ValueType>& data)
00110 throw(Exception::OutOfMemory);
00111
00115 TRegularData1D& operator = (const VectorType& data)
00116 throw(Exception::OutOfMemory);
00117
00119
00123
00124 bool operator == (const TRegularData1D& data) const;
00125
00127 BALL_INLINE bool operator != (const TRegularData1D& data) const { return !this->operator == (data); }
00128
00130 BALL_INLINE bool empty() const { return data_.empty(); }
00131
00133 bool isInside(const CoordinateType& x) const;
00135
00139
00140 BALL_INLINE ConstIterator begin() const { return data_.begin(); }
00142 BALL_INLINE ConstIterator end() const { return data_.end(); }
00144 BALL_INLINE Iterator begin() { return data_.begin(); }
00146 BALL_INLINE Iterator end() { return data_.end(); }
00148
00152
00153
00154 BALL_INLINE size_type size() const { return data_.size(); }
00155 BALL_INLINE size_type max_size() const { return data_.max_size(); }
00156 BALL_INLINE void swap(TRegularData1D<ValueType>& data) { std::swap(*this, data); }
00157
00161 const ValueType& getData(const IndexType& index) const
00162 throw(Exception::OutOfGrid);
00163
00167 ValueType& getData(const IndexType& index)
00168 throw(Exception::OutOfGrid);
00169
00174 const ValueType& operator [] (const IndexType& index) const { return data_[index]; }
00175
00180 ValueType& operator [] (const IndexType& index) { return data_[index]; }
00181
00190 ValueType operator () (const CoordinateType& x) const;
00191
00197 ValueType getInterpolatedValue(const CoordinateType& x) const
00198 throw(Exception::OutOfGrid);
00199
00206 void getEnclosingIndices(const CoordinateType& x, Position& lower, Position& upper) const
00207 throw(Exception::OutOfGrid);
00208
00209
00213 void getEnclosingValues(const CoordinateType& x, ValueType& lower, ValueType& upper) const
00214 throw(Exception::OutOfGrid);
00215
00220 CoordinateType getCoordinates(const IndexType& index) const
00221 throw(Exception::OutOfGrid);
00222
00228 IndexType getClosestIndex(const CoordinateType& x) const
00229 throw(Exception::OutOfGrid);
00230
00236 IndexType getLowerIndex(const CoordinateType& x) const
00237 throw(Exception::OutOfGrid);
00238
00244 const ValueType& getClosestValue(const CoordinateType& x) const
00245 throw(Exception::OutOfGrid);
00246
00252 ValueType& getClosestValue(const CoordinateType& x)
00253 throw(Exception::OutOfGrid);
00254
00256 BALL_INLINE IndexType getSize() const { return (IndexType)data_.size(); }
00257
00262 BALL_INLINE const CoordinateType& getOrigin() const { return origin_; }
00263
00268 BALL_INLINE const CoordinateType& getSpacing() const { return spacing_; }
00269
00272 BALL_INLINE void setOrigin(const CoordinateType& origin) { origin_ = origin; }
00273
00279 BALL_INLINE const CoordinateType& getDimension() const { return dimension_; }
00280
00286 BALL_INLINE void setDimension(const CoordinateType& dimension) { dimension_ = dimension; }
00287
00299 void resize(const IndexType& size)
00300 throw(Exception::OutOfMemory);
00301
00310 void rescale(const IndexType& new_size)
00311 throw(Exception::OutOfMemory);
00312
00316 ValueType calculateMean() const;
00317
00321 ValueType calculateSD() const;
00322
00326 void binaryWrite(const String& filename) const
00327 throw(Exception::FileNotFound);
00328
00332 void binaryRead(const String& filename)
00333 throw(Exception::FileNotFound);
00335
00336
00337 protected:
00339 CoordinateType origin_;
00340
00342 CoordinateType dimension_;
00343
00345 CoordinateType spacing_;
00346
00348 VectorType data_;
00349
00351 typedef struct { ValueType bt[1024]; } BlockValueType;
00352 };
00353
00356 typedef TRegularData1D<float> RegularData1D;
00357
00358 template <typename ValueType>
00359 TRegularData1D<ValueType>::TRegularData1D()
00360 : origin_(0.0),
00361 dimension_(0.0),
00362 spacing_(1.0),
00363 data_()
00364 {
00365 }
00366
00367 template <typename ValueType>
00368 TRegularData1D<ValueType>::~TRegularData1D()
00369 {
00370 }
00371
00372 template <typename ValueType>
00373 TRegularData1D<ValueType>::TRegularData1D(const TRegularData1D<ValueType>& data)
00374 throw(Exception::OutOfMemory)
00375 : origin_(data.origin_),
00376 dimension_(data.dimension_),
00377 spacing_(data.spacing_),
00378 data_()
00379 {
00380
00381 try
00382 {
00383 data_ = data.data_;
00384 }
00385 catch (std::bad_alloc&)
00386 {
00387 throw Exception::OutOfMemory(__FILE__, __LINE__, data.size() * sizeof(ValueType));
00388 }
00389 }
00390
00391 template <typename ValueType>
00392 TRegularData1D<ValueType>::TRegularData1D
00393 (const typename TRegularData1D<ValueType>::CoordinateType& origin,
00394 const typename TRegularData1D<ValueType>::CoordinateType& dimension,
00395 const typename TRegularData1D<ValueType>::CoordinateType& spacing)
00396 throw(Exception::OutOfMemory)
00397 : origin_(origin),
00398 dimension_(dimension),
00399 spacing_(spacing),
00400 data_()
00401 {
00402
00403 size_type size = (size_type)(dimension_ / spacing_ + 1.0);
00404
00405
00406 try
00407 {
00408 data_.resize(size);
00409 }
00410 catch (std::bad_alloc&)
00411 {
00412 throw Exception::OutOfMemory(__FILE__, __LINE__, size * sizeof(ValueType));
00413 }
00414 }
00415
00416 template <typename ValueType>
00417 TRegularData1D<ValueType>::TRegularData1D
00418 (const typename TRegularData1D<ValueType>::VectorType& data,
00419 const typename TRegularData1D<ValueType>::CoordinateType& origin,
00420 const typename TRegularData1D<ValueType>::CoordinateType& dimension)
00421 throw(Exception::OutOfMemory)
00422 : origin_(origin),
00423 dimension_(dimension),
00424 spacing_(dimension / ((double)data.size()-1)),
00425 data_()
00426 {
00427
00428 try
00429 {
00430 data_ = data;
00431 }
00432 catch (std::bad_alloc&)
00433 {
00434 throw Exception::OutOfMemory(__FILE__, __LINE__, data.size() * sizeof(ValueType));
00435 }
00436 }
00437
00438
00439 template <class ValueType>
00440 TRegularData1D<ValueType>::TRegularData1D
00441 (const typename TRegularData1D<ValueType>::IndexType& size)
00442 throw(Exception::OutOfMemory)
00443 : origin_(0.0),
00444 dimension_(1.0),
00445 data_()
00446 {
00447
00448 spacing_ = dimension_ / (double)(size - 1);
00449
00450 try
00451 {
00452 data_.resize(size);
00453 }
00454 catch (std::bad_alloc&)
00455 {
00456 data_.resize(0);
00457 throw Exception::OutOfMemory(__FILE__, __LINE__, size * sizeof(ValueType));
00458 }
00459 }
00460
00461 template <typename ValueType>
00462 void TRegularData1D<ValueType>::clear()
00463 {
00464
00465
00466 static ValueType default_value = ValueType();
00467 std::fill(data_.begin(), data_.end(), default_value);
00468 }
00469
00470 template <typename ValueType>
00471 TRegularData1D<ValueType>& TRegularData1D<ValueType>::operator = (const TRegularData1D<ValueType>& rhs)
00472 throw(Exception::OutOfMemory)
00473 {
00474
00475 origin_ = rhs.origin_;
00476 dimension_ = rhs.dimension_;
00477 spacing_ = rhs.spacing_;
00478 try
00479 {
00480 data_ = rhs.data_;
00481 }
00482 catch (std::bad_alloc&)
00483 {
00484 data_.resize(0);
00485 throw Exception::OutOfMemory(__FILE__, __LINE__, rhs.size() * sizeof(ValueType));
00486 }
00487
00488 return *this;
00489 }
00490
00491 template <typename ValueType>
00492 TRegularData1D<ValueType>& TRegularData1D<ValueType>::operator = (const VectorType& rhs)
00493 throw(Exception::OutOfMemory)
00494 {
00495
00496 try
00497 {
00498 data_ = rhs;
00499 }
00500 catch (std::bad_alloc&)
00501 {
00502 data_.resize(0);
00503 throw Exception::OutOfMemory(__FILE__, __LINE__, rhs.size() * sizeof(ValueType));
00504 }
00505
00506 return *this;
00507 }
00508
00509 template <typename ValueType>
00510 bool TRegularData1D<ValueType>::operator == (const TRegularData1D<ValueType>& data) const
00511 {
00512 return (origin_ == data.origin_
00513 && dimension_ == data.dimension_
00514 && data_ == data.data_);
00515 }
00516
00517 template <class ValueType>
00518 BALL_INLINE
00519 bool TRegularData1D<ValueType>::isInside(const typename TRegularData1D<ValueType>::CoordinateType& r) const
00520 {
00521 return ((r >= origin_) && (r <= (origin_ + dimension_)));
00522 }
00523
00524 template <typename ValueType>
00525 BALL_INLINE
00526 const ValueType& TRegularData1D<ValueType>::getData(const IndexType& index) const
00527 throw(Exception::OutOfGrid)
00528 {
00529 if (index >= data_.size())
00530 {
00531 throw Exception::OutOfGrid(__FILE__, __LINE__);
00532 }
00533 return data_[index];
00534 }
00535
00536 template <typename ValueType>
00537 BALL_INLINE
00538 ValueType& TRegularData1D<ValueType>::getData(const IndexType& index)
00539 throw(Exception::OutOfGrid)
00540 {
00541 if (index >= data_.size())
00542 {
00543 throw Exception::OutOfGrid(__FILE__, __LINE__);
00544 }
00545 return data_[index];
00546 }
00547
00548 template <typename ValueType>
00549 void TRegularData1D<ValueType>::getEnclosingIndices
00550 (const typename TRegularData1D<ValueType>::CoordinateType& x,
00551 Position& lower, Position& upper) const
00552 throw(Exception::OutOfGrid)
00553 {
00554 if (!isInside(x) || (data_.size() < 2))
00555 {
00556 throw Exception::OutOfGrid(__FILE__, __LINE__);
00557 }
00558 lower = (Position)floor((x - origin_) / spacing_);
00559 if (lower == data_.size() - 1)
00560 {
00561
00562 lower = data_.size() - 2;
00563 }
00564 upper = lower + 1;
00565 }
00566
00567 template <typename ValueType>
00568 void TRegularData1D<ValueType>::getEnclosingValues
00569 (const typename TRegularData1D<ValueType>::CoordinateType& x,
00570 ValueType& lower, ValueType& upper) const
00571 throw(Exception::OutOfGrid)
00572 {
00573 Position lower_index;
00574 Position upper_index;
00575 getEnclosingIndices(x, lower_index, upper_index);
00576 lower = data_[lower_index];
00577 upper = data_[upper_index];
00578 }
00579
00580 template <typename ValueType>
00581 BALL_INLINE
00582 ValueType TRegularData1D<ValueType>::getInterpolatedValue(const CoordinateType& x) const
00583 throw(Exception::OutOfGrid)
00584 {
00585 if (!isInside(x))
00586 {
00587 throw Exception::OutOfGrid(__FILE__, __LINE__);
00588 }
00589 return operator () (x);
00590 }
00591
00592 template <typename ValueType>
00593 BALL_INLINE
00594 typename TRegularData1D<ValueType>::CoordinateType TRegularData1D<ValueType>::getCoordinates
00595 (const typename TRegularData1D<ValueType>::IndexType& index) const
00596 throw(Exception::OutOfGrid)
00597 {
00598 if ((index >= data_.size()) || (data_.size() == 0))
00599 {
00600 throw Exception::OutOfGrid(__FILE__, __LINE__);
00601 }
00602
00603 return (CoordinateType)(origin_ + (double)index / ((double)data_.size()-1) * dimension_);
00604 }
00605
00606 template <typename ValueType>
00607 BALL_INLINE
00608 typename TRegularData1D<ValueType>::IndexType TRegularData1D<ValueType>::getClosestIndex(const CoordinateType& x) const
00609 throw(Exception::OutOfGrid)
00610 {
00611 if ((x < origin_) || (x > (origin_ + dimension_)))
00612 {
00613 throw Exception::OutOfGrid(__FILE__, __LINE__);
00614 }
00615
00616 return (IndexType)(size_type)floor((x - origin_) / spacing_ + 0.5);
00617 }
00618
00619 template <typename ValueType>
00620 BALL_INLINE
00621 typename TRegularData1D<ValueType>::IndexType TRegularData1D<ValueType>::getLowerIndex(const CoordinateType& x) const
00622 throw(Exception::OutOfGrid)
00623 {
00624 if ((x < origin_) || (x > (origin_ + dimension_)))
00625 {
00626 throw Exception::OutOfGrid(__FILE__, __LINE__);
00627 }
00628
00629 return (IndexType)(size_type)floor((x - origin_) / spacing_);
00630 }
00631
00632 template <typename ValueType>
00633 BALL_INLINE
00634 const ValueType& TRegularData1D<ValueType>::getClosestValue(const CoordinateType& x) const
00635 throw(Exception::OutOfGrid)
00636 {
00637 if ((x < origin_) || (x > (origin_ + dimension_)))
00638 {
00639 throw Exception::OutOfGrid(__FILE__, __LINE__);
00640 }
00641
00642
00643 size_type index = (size_type)floor((x - origin_) / spacing_ + 0.5);
00644 return data_[index];
00645 }
00646
00647 template <typename ValueType>
00648 BALL_INLINE
00649 ValueType& TRegularData1D<ValueType>::getClosestValue(const CoordinateType& x)
00650 throw(Exception::OutOfGrid)
00651 {
00652 if ((x < origin_) || (x > (origin_ + dimension_)))
00653 {
00654 throw Exception::OutOfGrid(__FILE__, __LINE__);
00655 }
00656
00657
00658 size_type index = (size_type)floor((x - origin_) / spacing_ + 0.5);
00659 return data_[index];
00660 }
00661
00662 template <typename ValueType>
00663 BALL_INLINE
00664 ValueType TRegularData1D<ValueType>::calculateMean() const
00665 {
00666 IndexType data_points = this->getSize();
00667 ValueType mean = 0;
00668 for (IndexType i = 0; i < data_points; i++)
00669 {
00670 mean += data_[i];
00671 }
00672 mean /= data_points;
00673 return mean;
00674 }
00675
00676 template <typename ValueType>
00677 BALL_INLINE
00678 ValueType TRegularData1D<ValueType>::calculateSD() const
00679 {
00680 IndexType data_points = this->getSize();
00681 ValueType stddev = 0;
00682 ValueType mean = this->calculateMean();
00683 for (IndexType i = 0; i < data_points; i++)
00684 {
00685 stddev += (pow(data_[i]-mean,2));
00686 }
00687 stddev /= (data_points-1);
00688 stddev = sqrt(stddev);
00689 return stddev;
00690 }
00691
00692 template <typename ValueType>
00693 BALL_INLINE
00694 ValueType TRegularData1D<ValueType>::operator () (const CoordinateType& x) const
00695 {
00696 size_type left_index = (size_type)floor((x - origin_) / spacing_);
00697 if (left_index == data_.size() - 1)
00698 {
00699
00700 return data_[data_.size() - 1];
00701 }
00702
00703
00704 double d = 1.0 - (((x - origin_) - (double)left_index * spacing_) / spacing_);
00705 return data_[left_index] * d + (1.0 - d) * data_[left_index + 1];
00706 }
00707
00708 template <typename ValueType>
00709 void TRegularData1D<ValueType>::resize
00710 (const typename TRegularData1D<ValueType>::IndexType& new_size)
00711 throw(Exception::OutOfMemory)
00712 {
00713
00714 if (data_.size() > 0)
00715 {
00716 dimension_ *= (double)new_size / (double)data_.size();
00717 }
00718
00719
00720 try
00721 {
00722 data_.resize(new_size);
00723 }
00724 catch (std::bad_alloc&)
00725 {
00726
00727 data_.resize(0);
00728 throw Exception::OutOfMemory(__FILE__, __LINE__, new_size * sizeof(ValueType));
00729 }
00730 }
00731
00732 template <typename ValueType>
00733 void TRegularData1D<ValueType>::rescale
00734 (const typename TRegularData1D<ValueType>::IndexType& new_size)
00735 throw(Exception::OutOfMemory)
00736 {
00737
00738 if (new_size == (IndexType)data_.size())
00739 {
00740 return;
00741 }
00742
00743
00744 try
00745 {
00746
00747 if (data_.size() == 0)
00748 {
00749
00750 data_.resize(new_size);
00751 return;
00752 }
00753
00754
00755
00756 if ((data_.size() == 1) && (new_size > 1))
00757 {
00758 ValueType old_value = data_[0];
00759 data_.resize(new_size);
00760 for (IndexType i = 1; i < new_size; i++)
00761 {
00762 data_[i] = old_value;
00763 }
00764
00765 return;
00766 }
00767
00768
00769
00770 VectorType new_data(new_size);
00771 CoordinateType factor1 = (CoordinateType)data_.size() / (CoordinateType)new_size;
00772 CoordinateType factor2 = (CoordinateType)(data_.size() - 1) / (new_size - 1);
00773
00774 for (Size i = 0; i < new_size; i++)
00775 {
00776
00777
00778 IndexType old_idx = (IndexType)((CoordinateType)i * factor1);
00779
00780
00781 if (old_idx >= (data_.size() - 1))
00782 {
00783 old_idx = data_.size() - 2;
00784 }
00785 CoordinateType factor3 = (CoordinateType)i * factor2 - (CoordinateType)old_idx;
00786 new_data[i] = data_[old_idx] * (1 - factor3) + factor3 * data_[old_idx + 1];
00787 }
00788
00789
00790 data_ = new_data;
00791 }
00792 catch (std::bad_alloc&)
00793 {
00794
00795 data_.resize(0);
00796 throw Exception::OutOfMemory(__FILE__, __LINE__, new_size * sizeof(ValueType));
00797 }
00798 }
00799
00802
00803 template <typename ValueType>
00804 std::ostream& operator << (std::ostream& os, const TRegularData1D<ValueType>& data)
00805 {
00806
00807 os << data.getOrigin() << std::endl
00808 << data.getOrigin() + data.getDimension() << std::endl
00809 << data.getSize() - 1 << std::endl;
00810
00811
00812 std::copy(data.begin(), data.end(), std::ostream_iterator<ValueType>(os, "\n"));
00813 return os;
00814 }
00815
00817 template <typename ValueType>
00818 std::istream& operator >> (std::istream& is, TRegularData1D<ValueType>& grid)
00819 {
00820 typename TRegularData1D<ValueType>::CoordinateType origin;
00821 typename TRegularData1D<ValueType>::CoordinateType dimension;
00822 typename TRegularData1D<ValueType>::IndexType size;
00823
00824 is >> origin;
00825 is >> dimension;
00826 is >> size;
00827
00828 dimension -= origin;
00829 size++;
00830
00831 grid.resize(size);
00832 grid.setOrigin(origin);
00833 grid.setDimension(dimension);
00834
00835 std::copy(std::istream_iterator<ValueType>(is),
00836 std::istream_iterator<ValueType>(),
00837 grid.begin());
00838
00839
00840 return is;
00841 }
00842
00843 template <typename ValueType>
00844 void TRegularData1D<ValueType>::binaryWrite(const String& filename) const
00845 throw(Exception::FileNotFound)
00846 {
00847 File outfile(filename, std::ios::out|std::ios::binary);
00848 if (!outfile.isValid())
00849 {
00850 throw Exception::FileNotFound(__FILE__, __LINE__, filename);
00851 }
00852
00853 BinaryFileAdaptor<BlockValueType> adapt_block;
00854 BinaryFileAdaptor<ValueType> adapt_single;
00855
00856
00857 BinaryFileAdaptor<CoordinateType> adapt_coordinate;
00858 BinaryFileAdaptor<Size> adapt_size;
00859
00860 adapt_size.setData(data_.size());
00861 outfile << adapt_size;
00862
00863 adapt_coordinate.setData(origin_);
00864 outfile << adapt_coordinate;
00865
00866 adapt_coordinate.setData(dimension_);
00867 outfile << adapt_coordinate;
00868
00869 adapt_coordinate.setData(spacing_);
00870 outfile << adapt_coordinate;
00871
00872
00873 Index window_pos = 0;
00874 while (((int)data_.size() - (1024 + window_pos)) >= 0 )
00875 {
00876 adapt_block.setData(*(BlockValueType*)&(data_[window_pos]));
00877 outfile << adapt_block;
00878 window_pos += 1024;
00879 }
00880
00881
00882 for (Size i = window_pos; i < data_.size(); i++)
00883 {
00884 adapt_single.setData(data_[i]);
00885 outfile << adapt_single;
00886 }
00887
00888
00889 outfile.close();
00890 }
00891
00892 template <typename ValueType>
00893 void TRegularData1D<ValueType>::binaryRead(const String& filename)
00894 throw(Exception::FileNotFound)
00895 {
00896 File infile(filename, std::ios::in|std::ios::binary);
00897 if (!infile.isValid()) throw Exception::FileNotFound(__FILE__, __LINE__, filename);
00898
00899 BinaryFileAdaptor<BlockValueType> adapt_block;
00900 BinaryFileAdaptor<ValueType> adapt_single;
00901
00902
00903 BinaryFileAdaptor<CoordinateType> adapt_coordinate;
00904 BinaryFileAdaptor<Size> adapt_size;
00905
00906 infile >> adapt_size;
00907 Size new_size = adapt_size.getData();
00908
00909 infile >> adapt_coordinate;
00910 origin_ = adapt_coordinate.getData();
00911
00912 infile >> adapt_coordinate;
00913 dimension_ = adapt_coordinate.getData();
00914
00915 infile >> adapt_coordinate;
00916 spacing_ = adapt_coordinate.getData();
00917
00918 data_.resize(new_size);
00919
00920
00921 Index window_pos = 0;
00922
00923 while ( ((int)data_.size() - (1024 + window_pos)) >= 0 )
00924 {
00925 infile >> adapt_block;
00926 *(BlockValueType*)(&(data_[window_pos])) = adapt_block.getData();
00927
00928
00929
00930
00931
00932
00933 window_pos+=1024;
00934 }
00935
00936
00937 for (Size i=window_pos; i<data_.size(); i++)
00938 {
00939 infile >> adapt_single;
00940 data_[i] = adapt_single.getData();
00941 }
00942
00943
00944 infile.close();
00945 }
00946 }
00947
00948 #endif // BALL_DATATYPE_REGULARDATA1D_H