00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef LASS_GUARDIAN_OF_INCLUSION_NUM_VECTOR_INL
00046 #define LASS_GUARDIAN_OF_INCLUSION_NUM_VECTOR_INL
00047
00048 #include "num_common.h"
00049 #include "vector.h"
00050 #include "../meta/is_integral.h"
00051
00052 #define LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(a, b)\
00053 LASS_UTIL_IMPL_MAKE_ENFORCER(\
00054 ::lass::util::impl::EqualPredicate,\
00055 ::lass::util::impl::DefaultRaiser,\
00056 (a).size(), \
00057 (b).size(), \
00058 "Vectors '" LASS_STRINGIFY(a) "' and '" LASS_STRINGIFY(b) "' have different dimensions in '" LASS_HERE "'.")
00059
00060 namespace lass
00061 {
00062 namespace num
00063 {
00064
00065
00066
00067
00068
00069
00070
00071
00072 template <typename T, typename S>
00073 Vector<T, S>::Vector():
00074 storage_()
00075 {
00076 LASS_ASSERT(size() == 0);
00077 }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 template <typename T, typename S>
00093 Vector<T, S>::Vector(TSize iDimension, TParam iInitialValue):
00094 storage_(iDimension, iInitialValue)
00095 {
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 template <typename T, typename S>
00109 Vector<T, S>::Vector(const TStorage& iStorage):
00110 storage_(iStorage)
00111 {
00112 }
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 template <typename T, typename S>
00126 template <typename VectorType>
00127 Vector<T, S>::Vector(const VectorType& iVector)
00128 {
00129 init(iVector, meta::Wrap<typename meta::IsIntegral<VectorType>::Type>());
00130 }
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 template <typename T, typename S>
00145 template <typename T2, typename S2>
00146 Vector<T, S>::Vector(const Vector<T2, S2>& iOther)
00147 {
00148 TSize n = iOther.storage_.size();
00149 storage_.resize(n);
00150 for (TSize i = 0; i < n; ++i)
00151 {
00152 storage_[i] = iOther.storage_[i];
00153 }
00154 }
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 template <typename T, typename S>
00169 template <typename T2, typename S2>
00170 Vector<T, S>& Vector<T, S>::operator=(const Vector<T2, S2>& iOther)
00171 {
00172 TSize n = iOther.storage_.size();
00173 storage_.resize(n);
00174 for (TSize i = 0; i < n; ++i)
00175 {
00176 storage_[i] = iOther.storage_[i];
00177 }
00178 return *this;
00179 }
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 template <typename T, typename S> inline
00190 const typename Vector<T, S>::TSize
00191 Vector<T, S>::size() const
00192 {
00193 return storage_.size();
00194 }
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205 template <typename T, typename S> inline
00206 const typename Vector<T, S>::TValue
00207 Vector<T, S>::operator[](TSize iIndex) const
00208 {
00209 LASS_ASSERT(iIndex < size());
00210 return storage_[iIndex];
00211 }
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224 template <typename T, typename S> inline
00225 typename util::CallTraits<T>::TReference
00226 Vector<T, S>::operator[](TSize iIndex)
00227 {
00228 LASS_ASSERT(iIndex < size());
00229 return storage_[iIndex];
00230 }
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240 template <typename T, typename S> inline
00241 const typename Vector<T, S>::TValue
00242 Vector<T, S>::at(TSize iIndex) const
00243 {
00244 return storage_[mod(iIndex, storage_.size())];
00245 }
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258 template <typename T, typename S> inline
00259 typename util::CallTraits<T>::TReference
00260 Vector<T, S>::at(TSize iIndex)
00261 {
00262 return storage_[num::mod(iIndex, storage_.size())];
00263 }
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275 template <typename T, typename S> inline
00276 const Vector<T, S>&
00277 Vector<T, S>::operator+() const
00278 {
00279 return *this;
00280 }
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 template <typename T, typename S>
00294 const Vector<T, impl::VNeg<T, S> >
00295 Vector<T, S>::operator-() const
00296 {
00297 typedef impl::VNeg<T, S> TExpression;
00298 return Vector<T, TExpression>(TExpression(storage_));
00299 }
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 template <typename T, typename S>
00316 template <typename T2, typename S2>
00317 Vector<T, S>& Vector<T, S>::operator+=(const Vector<T2, S2>& iB)
00318 {
00319 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(*this, iB);
00320 const TSize n = storage_.size();
00321 for (TSize i = 0; i < n; ++i)
00322 {
00323 storage_[i] += iB[i];
00324 }
00325 return *this;
00326 }
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 template <typename T, typename S>
00343 template <typename T2, typename S2>
00344 Vector<T, S>& Vector<T, S>::operator-=(const Vector<T2, S2>& iB)
00345 {
00346 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(*this, iB);
00347 const TSize n = storage_.size();
00348 for (TSize i = 0; i < n; ++i)
00349 {
00350 storage_[i] -= iB[i];
00351 }
00352 return *this;
00353 }
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369 template <typename T, typename S>
00370 template <typename T2, typename S2>
00371 Vector<T, S>& Vector<T, S>::operator*=(const Vector<T2, S2>& iB)
00372 {
00373 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(*this, iB);
00374 const TSize n = storage_.size();
00375 for (TSize i = 0; i < n; ++i)
00376 {
00377 storage_[i] *= iB[i];
00378 }
00379 return *this;
00380 }
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396 template <typename T, typename S>
00397 template <typename T2, typename S2>
00398 Vector<T, S>& Vector<T, S>::operator/=(const Vector<T2, S2>& iB)
00399 {
00400 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(*this, iB);
00401 const TSize n = storage_.size();
00402 for (TSize i = 0; i < n; ++i)
00403 {
00404 storage_[i] /= iB[i];
00405 }
00406 return *this;
00407 }
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418 template <typename T, typename S>
00419 template <typename T2>
00420 Vector<T, S>& Vector<T, S>::operator+=(const T2& iB)
00421 {
00422 const TSize n = storage_.size();
00423 for (TSize i = 0; i < n; ++i)
00424 {
00425 storage_[i] += iB;
00426 }
00427 return *this;
00428 }
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439 template <typename T, typename S>
00440 template <typename T2>
00441 Vector<T, S>& Vector<T, S>::operator-=(const T2& iB)
00442 {
00443 const TSize n = storage_.size();
00444 for (TSize i = 0; i < n; ++i)
00445 {
00446 storage_[i] -= iB;
00447 }
00448 return *this;
00449 }
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460 template <typename T, typename S>
00461 template <typename T2>
00462 Vector<T, S>& Vector<T, S>::operator*=(const T2& iB)
00463 {
00464 const TSize n = storage_.size();
00465 for (TSize i = 0; i < n; ++i)
00466 {
00467 storage_[i] *= iB;
00468 }
00469 return *this;
00470 }
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481 template <typename T, typename S>
00482 template <typename T2>
00483 Vector<T, S>& Vector<T, S>::operator/=(const T2& iB)
00484 {
00485 const TSize n = storage_.size();
00486 for (TSize i = 0; i < n; ++i)
00487 {
00488 storage_[i] /= iB;
00489 }
00490 return *this;
00491 }
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502 template <typename T, typename S> inline
00503 const bool Vector<T, S>::isEmpty() const
00504 {
00505 return storage_.size() == 0;
00506 }
00507
00508
00509
00510
00511
00512
00513
00514
00515 template <typename T, typename S>
00516 const bool Vector<T, S>::isZero() const
00517 {
00518 const TSize n = storage_.size();
00519 for (TSize i = 0; i < n; ++i)
00520 {
00521
00522
00523 if (storage_[i] != TNumTraits::zero)
00524 {
00525 return false;
00526 }
00527 }
00528 return true;
00529 }
00530
00531
00532
00533
00534
00535
00536
00537
00538 template <typename T, typename S>
00539 const typename Vector<T, S>::TValue
00540 Vector<T, S>::sum() const
00541 {
00542 const TSize n = storage_.size();
00543 TValue result = TNumTraits::zero;
00544 for (TSize i = 0; i < n; ++i)
00545 {
00546 result += storage_[i];
00547 }
00548 return result;
00549 }
00550
00551
00552
00553
00554
00555
00556
00557
00558 template <typename T, typename S>
00559 const typename Vector<T, S>::TValue
00560 Vector<T, S>::min() const
00561 {
00562 const TSize n = storage_.size();
00563 if (n == 0)
00564 {
00565 return TNumTraits::zero;
00566 }
00567 TValue result = storage_[0];
00568 for (TSize i = 1; i < n; ++i)
00569 {
00570 result = std::min(result, storage_[i]);
00571 }
00572 return result;
00573 }
00574
00575
00576
00577
00578
00579
00580
00581
00582 template <typename T, typename S>
00583 const typename Vector<T, S>::TValue
00584 Vector<T, S>::max() const
00585 {
00586 const TSize n = storage_.size();
00587 if (n == 0)
00588 {
00589 return TNumTraits::zero;
00590 }
00591 TValue result = storage_[0];
00592 for (TSize i = 1; i < n; ++i)
00593 {
00594 result = std::max(result, storage_[i]);
00595 }
00596 return result;
00597 }
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 template <typename T, typename S>
00608 const typename Vector<T, S>::TValue
00609 Vector<T, S>::squaredNorm() const
00610 {
00611 const TSize n = storage_.size();
00612 TValue result = TNumTraits::zero;
00613 for (TSize i = 0; i < n; ++i)
00614 {
00615 result += num::sqr(storage_[i]);
00616 }
00617 return result;
00618 }
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628 template <typename T, typename S>
00629 const typename Vector<T, S>::TValue
00630 Vector<T, S>::norm() const
00631 {
00632 return num::sqrt(squaredNorm());
00633 }
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 template <typename T, typename S>
00649 const Vector<T, impl::VMul<T, S, impl::VScalar<T> > >
00650 Vector<T, S>::normal() const
00651 {
00652 const TValue scale = TNumTraits::one / norm();
00653 typedef impl::VMul<T, S, impl::VScalar<T> > TExpression;
00654 return Vector<T, TExpression>(TExpression(storage_, impl::VScalar<T>(storage_.size(), scale)));
00655 }
00656
00657
00658
00659
00660
00661
00662
00663
00664 template <typename T, typename S>
00665 const Vector<T, impl::VRec<T, S> >
00666 Vector<T, S>::reciprocal() const
00667 {
00668 typedef impl::VRec<T, S> TExpression;
00669 return Vector<T, TExpression>(TExpression(storage_));
00670 }
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681 template <typename T, typename S>
00682 template <typename S2>
00683 const Vector<T, impl::VMul<T, S, impl::VScalar<T> > >
00684 Vector<T, S>::project(const Vector<T, S2>& iB) const
00685 {
00686 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(*this, iB);
00687 const TValue scale = dot(iB, *this) / squaredNorm();
00688 typedef impl::VMul<T, S, impl::VScalar<T> > TExpression;
00689 return Vector<T, TExpression>(TExpression(storage_, impl::VScalar<T>(storage_.size(), scale)));
00690 }
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701 template <typename T, typename S>
00702 template <typename S2>
00703 const Vector<T, impl::VSub<T, S2, impl::VMul<T, S, impl::VScalar<T> > > >
00704 Vector<T, S>::reject(const Vector<T, S2>& iB) const
00705 {
00706 return iB - project(iB);
00707 }
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718 template <typename T, typename S>
00719 void Vector<T, S>::normalize()
00720 {
00721 *this /= norm();
00722 }
00723
00724
00725
00726 template <typename T, typename S> inline
00727 const typename Vector<T, S>::TStorage&
00728 Vector<T, S>::storage() const
00729 {
00730 return storage_;
00731 }
00732
00733
00734
00735 template <typename T, typename S> inline
00736 typename Vector<T, S>::TStorage&
00737 Vector<T, S>::storage()
00738 {
00739 return storage_;
00740 }
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754 template <typename T, typename S>
00755 void Vector<T, S>::swap(Vector<T, S>& iOther)
00756 {
00757 storage_.swap(iOther.storage_);
00758 }
00759
00760
00761
00762
00763
00764 template <typename T, typename S>
00765 template <typename IntegralType>
00766 void Vector<T, S>::init(IntegralType iDimension, meta::Wrap<meta::True>)
00767 {
00768 TStorage temp(iDimension, T());
00769 storage_.swap(temp);
00770 }
00771
00772
00773
00774 template <typename T, typename S>
00775 template <typename VectorType>
00776 void Vector<T, S>::init(const VectorType& iVector, meta::Wrap<meta::False>)
00777 {
00778 TSize n = iVector.size();
00779 TStorage temp(n, T());
00780 for (TSize i = 0; i < n; ++i)
00781 {
00782 temp[i] = iVector[i];
00783 }
00784 storage_.swap(temp);
00785 }
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798 template <typename T, typename S1, typename S2>
00799 bool operator==(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00800 {
00801 typedef typename Vector<T, S1>::TSize TSize;
00802 const TSize n = iA.size();
00803
00804 if (n != iB.size())
00805 {
00806 return false;
00807 }
00808 for (TSize i = 0; i < n; ++i)
00809 {
00810 if (iA[i] != iB[i])
00811 {
00812 return false;
00813 }
00814 }
00815 return true;
00816 }
00817
00818
00819
00820
00821
00822
00823
00824
00825 template <typename T, typename S1, typename S2>
00826 bool operator!=(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00827 {
00828 return !(iA == iB);
00829 }
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841 template <typename T, typename S1, typename S2>
00842 const T dot(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00843 {
00844 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(iA, iB);
00845 typedef typename Vector<T, S1>::TSize TSize;
00846 const TSize n = iA.size();
00847
00848 T result = NumTraits<T>::zero;
00849 for (TSize i = 0; i < n; ++i)
00850 {
00851 result += iA[i] * iB[i];
00852 }
00853 return result;
00854 }
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866 template <typename T, typename S1, typename S2>
00867 const Vector<T, impl::VAdd<T, S1, S2> >
00868 operator+(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00869 {
00870 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(iA, iB);
00871 typedef impl::VAdd<T, S1, S2> TExpression;
00872 return Vector<T, TExpression>(TExpression(iA.storage(), iB.storage()));
00873 }
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885 template <typename T, typename S1, typename S2>
00886 const Vector<T, impl::VSub<T, S1, S2> >
00887 operator-(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00888 {
00889 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(iA, iB);
00890 typedef impl::VSub<T, S1, S2> TExpression;
00891 return Vector<T, TExpression>(TExpression(iA.storage(), iB.storage()));
00892 }
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904 template <typename T, typename S1, typename S2>
00905 const Vector<T, impl::VMul<T, S1, S2> >
00906 operator*(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00907 {
00908 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(iA, iB);
00909 typedef impl::VMul<T, S1, S2> TExpression;
00910 return Vector<T, TExpression>(TExpression(iA.storage(), iB.storage()));
00911 }
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923 template <typename T, typename S1, typename S2>
00924 const Vector<T, impl::VDiv<T, S1, S2> >
00925 operator/(const Vector<T, S1>& iA, const Vector<T, S2>& iB)
00926 {
00927 LASS_NUM_VECTOR_ENFORCE_EQUAL_DIMENSION(iA, iB);
00928 typedef impl::VDiv<T, S1, S2> TExpression;
00929 return Vector<T, TExpression>(TExpression(iA.storage(), iB.storage()));
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940 template <typename T, typename S>
00941 const Vector<T, impl::VAdd<T, impl::VScalar<T>, S> >
00942 operator+(const T& iA, const Vector<T, S>& iB)
00943 {
00944 typedef impl::VAdd<T, impl::VScalar<T>, S> TExpression;
00945 return Vector<T, TExpression>(TExpression(impl::VScalar<T>(iB.size(), iA), iB.storage()));
00946 }
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956 template <typename T, typename S>
00957 const Vector<T, impl::VSub<T, impl::VScalar<T>, S> >
00958 operator-(const T& iA, const Vector<T, S>& iB)
00959 {
00960 typedef impl::VSub<T, impl::VScalar<T>, S> TExpression;
00961 return Vector<T, TExpression>(TExpression(impl::VScalar<T>(iB.size(), iA), iB.storage()));
00962 }
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972 template <typename T, typename S>
00973 const Vector<T, impl::VMul<T, impl::VScalar<T>, S> >
00974 operator*(const T& iA, const Vector<T, S>& iB)
00975 {
00976 typedef impl::VMul<T, impl::VScalar<T>, S> TExpression;
00977 return Vector<T, TExpression>(TExpression(impl::VScalar<T>(iB.size(), iA), iB.storage()));
00978 }
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988 template <typename T, typename S>
00989 const Vector<T, impl::VDiv<T, impl::VScalar<T>, S> >
00990 operator/(const T& iA, const Vector<T, S>& iB)
00991 {
00992 typedef impl::VDiv<T, impl::VScalar<T>, S> TExpression;
00993 return Vector<T, TExpression>(TExpression(impl::VScalar<T>(iB.size(), iA), iB.storage()));
00994 }
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004 template <typename T, typename S>
01005 const Vector<T, impl::VAdd<T, S, impl::VScalar<T> > >
01006 operator+(const Vector<T, S>& iA, const T& iB)
01007 {
01008 typedef impl::VAdd<T, S, impl::VScalar<T> > TExpression;
01009 return Vector<T, TExpression>(TExpression(iA.storage(), impl::VScalar<T>(iA.size(), iB)));
01010 }
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020 template <typename T, typename S>
01021 const Vector<T, impl::VSub<T, S, impl::VScalar<T> > >
01022 operator-(const Vector<T, S>& iA, const T& iB)
01023 {
01024 typedef impl::VSub<T, S, impl::VScalar<T> > TExpression;
01025 return Vector<T, TExpression>(TExpression(iA.storage(), impl::VScalar<T>(iA.size(), iB)));
01026 }
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036 template <typename T, typename S>
01037 const Vector<T, impl::VMul<T, S, impl::VScalar<T> > >
01038 operator*(const Vector<T, S>& iA, const T& iB)
01039 {
01040 typedef impl::VMul<T, S, impl::VScalar<T> > TExpression;
01041 return Vector<T, TExpression>(TExpression(iA.storage(), impl::VScalar<T>(iA.size(), iB)));
01042 }
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052 template <typename T, typename S>
01053 const Vector<T, impl::VDiv<T, S, impl::VScalar<T> > >
01054 operator/(const Vector<T, S>& iA, const T& iB)
01055 {
01056 typedef impl::VDiv<T, S, impl::VScalar<T> > TExpression;
01057 return Vector<T, TExpression>(TExpression(iA.storage(), impl::VScalar<T>(iA.size(), iB)));
01058 }
01059
01060
01061
01062
01063
01064
01065
01066
01067 template <typename T, typename S, typename Char, typename Traits>
01068 std::basic_ostream<Char, Traits>&
01069 operator<<(std::basic_ostream<Char, Traits>& oOStream, const Vector<T, S>& iB)
01070 {
01071 typedef typename Vector<T, S>::TSize TSize;
01072 const TSize n = iB.size();
01073
01074 LASS_ENFORCE_STREAM(oOStream) << "(";
01075 if (n > 0)
01076 {
01077 LASS_ENFORCE_STREAM(oOStream) << iB[0];
01078 }
01079 for (TSize i = 1; i < n; ++i)
01080 {
01081 LASS_ENFORCE_STREAM(oOStream) << ", " << iB[i];
01082 }
01083 LASS_ENFORCE_STREAM(oOStream) << ")";
01084 return oOStream;
01085 }
01086
01087
01088
01089
01090
01091 template <typename T, typename Char, typename Traits>
01092 std::basic_istream<Char, Traits>&
01093 operator>>(std::basic_istream<Char, Traits>& ioIStream, Vector<T>& oB)
01094 {
01095 typedef typename Vector<T>::TValue TValue;
01096 typedef typename Vector<T>::TSize TSize;
01097 typedef typename Vector<T>::TStorage TStorage;
01098
01099 TStorage buffer;
01100 TValue value;
01101 TSize size = 0;
01102
01103 char c = 0;
01104 LASS_ENFORCE_STREAM(ioIStream) >> c;
01105 if (c != '(')
01106 {
01107 ioIStream.clear(std::ios::failbit);
01108 return ioIStream;
01109 }
01110
01111
01112
01113
01114 do
01115 {
01116 c = 0;
01117 LASS_ENFORCE_STREAM(ioIStream) >> value >> c;
01118 buffer.push_back(value);
01119 ++size;
01120 if (c != ',' && c != ')')
01121 {
01122 ioIStream.clear(std::ios::failbit);
01123 return ioIStream;
01124 }
01125 }
01126 while (c != ')');
01127
01128 oB.storage().swap(buffer);
01129 return ioIStream;
01130 }
01131
01132
01133
01134 }
01135
01136 }
01137
01138 #endif
01139
01140