gccxml_gem 0.9-x86-cygwin
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +75 -0
- data/bin/gccxml.exe +0 -0
- data/bin/gccxml_cc1plus.exe +0 -0
- data/gccxml.rb +50 -0
- data/share/doc/gccxml-0.9/Copyright.txt +55 -0
- data/share/doc/gccxml-0.9/gccxml.html +168 -0
- data/share/doc/gccxml-0.9/gccxml.txt +293 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/algorithm +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/algorithm.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/bitset +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/bitset.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cfloat +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/climits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cmath +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/complex +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/complex.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstddef +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstdio +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstdlib +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstring +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstring.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ctime +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cwchar +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cwctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/deque +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/deque.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/exception +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/exception.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/fstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/fstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/function +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/function.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/functional +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/gccxml_typeinfo.h +146 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iomanip +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iomanip.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ios +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ios.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iosfwd +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iosfwd.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iostream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iostream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/istream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/istream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iterator +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iterator.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/limits +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/limits.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/list +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/list.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/locale +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/locale.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/map +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/map.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/memory +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/memory.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/new +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/new.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/numeric +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/numeric.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ostream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ostream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/queue +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/queue.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/codecvt +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/collate +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/ctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iosbase +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iotraits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iterator +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/lochelp +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/locimpl +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/locvector +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/messages +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/money +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/numbrw +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/numeral +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwdispatch.h +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwlocale +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwstderr_macros.h +64 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/string_ref +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/time +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/traits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/tree +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/usefacet +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/valimp +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/vendor +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/set +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/set.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/sstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/sstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stack +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stack.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stdexcept +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stdexcept.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/streambuf +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/streambuf.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/string +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/string.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/strstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/strstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/typeinfo +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/typeinfo.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/utility +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/utility.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/valarray +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/valarray.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/vector +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/vector.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/except.h +154 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_fstream.h +431 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_new.h +166 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_valarray.h +786 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_vector.h +1457 -0
- data/share/gccxml-0.9/Borland/5.5/io.h +352 -0
- data/share/gccxml-0.9/Borland/5.5/oaidl.h +7006 -0
- data/share/gccxml-0.9/Borland/5.5/propidl.h +1477 -0
- data/share/gccxml-0.9/Borland/5.5/rw/locimpl.h +477 -0
- data/share/gccxml-0.9/Borland/5.5/rw/rwlocale.h +619 -0
- data/share/gccxml-0.9/Borland/5.5/stdarg.h +55 -0
- data/share/gccxml-0.9/Borland/5.5/valarray.cc +2883 -0
- data/share/gccxml-0.9/GCC/2.95/algorithm +76 -0
- data/share/gccxml-0.9/GCC/2.95/bitset +17 -0
- data/share/gccxml-0.9/GCC/2.95/cctype +24 -0
- data/share/gccxml-0.9/GCC/2.95/clocale +14 -0
- data/share/gccxml-0.9/GCC/2.95/cmath +33 -0
- data/share/gccxml-0.9/GCC/2.95/complex +38 -0
- data/share/gccxml-0.9/GCC/2.95/csetjmp +13 -0
- data/share/gccxml-0.9/GCC/2.95/csignal +14 -0
- data/share/gccxml-0.9/GCC/2.95/cstdarg +12 -0
- data/share/gccxml-0.9/GCC/2.95/cstddef +13 -0
- data/share/gccxml-0.9/GCC/2.95/cstdio +55 -0
- data/share/gccxml-0.9/GCC/2.95/cstdlib +66 -0
- data/share/gccxml-0.9/GCC/2.95/cstring +34 -0
- data/share/gccxml-0.9/GCC/2.95/ctime +24 -0
- data/share/gccxml-0.9/GCC/2.95/cwchar +65 -0
- data/share/gccxml-0.9/GCC/2.95/cwctype +31 -0
- data/share/gccxml-0.9/GCC/2.95/deque +19 -0
- data/share/gccxml-0.9/GCC/2.95/exception +20 -0
- data/share/gccxml-0.9/GCC/2.95/fstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/functional +64 -0
- data/share/gccxml-0.9/GCC/2.95/gccxml_bitset +1066 -0
- data/share/gccxml-0.9/GCC/2.95/iomanip +20 -0
- data/share/gccxml-0.9/GCC/2.95/iosfwd +20 -0
- data/share/gccxml-0.9/GCC/2.95/iostream +27 -0
- data/share/gccxml-0.9/GCC/2.95/iterator +39 -0
- data/share/gccxml-0.9/GCC/2.95/list +19 -0
- data/share/gccxml-0.9/GCC/2.95/map +20 -0
- data/share/gccxml-0.9/GCC/2.95/memory +21 -0
- data/share/gccxml-0.9/GCC/2.95/new +13 -0
- data/share/gccxml-0.9/GCC/2.95/numeric +15 -0
- data/share/gccxml-0.9/GCC/2.95/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/2.95/queue +20 -0
- data/share/gccxml-0.9/GCC/2.95/set +20 -0
- data/share/gccxml-0.9/GCC/2.95/sstream +24 -0
- data/share/gccxml-0.9/GCC/2.95/stack +19 -0
- data/share/gccxml-0.9/GCC/2.95/std/bastring.cc +524 -0
- data/share/gccxml-0.9/GCC/2.95/std/complext.h +397 -0
- data/share/gccxml-0.9/GCC/2.95/std/dcomplex.h +92 -0
- data/share/gccxml-0.9/GCC/2.95/std/fcomplex.h +88 -0
- data/share/gccxml-0.9/GCC/2.95/std/gslice_array.h +170 -0
- data/share/gccxml-0.9/GCC/2.95/std/indirect_array.h +157 -0
- data/share/gccxml-0.9/GCC/2.95/std/ldcomplex.h +96 -0
- data/share/gccxml-0.9/GCC/2.95/std/mask_array.h +154 -0
- data/share/gccxml-0.9/GCC/2.95/std/slice_array.h +156 -0
- data/share/gccxml-0.9/GCC/2.95/std/std_valarray.h +728 -0
- data/share/gccxml-0.9/GCC/2.95/std/straits.h +162 -0
- data/share/gccxml-0.9/GCC/2.95/std/valarray_meta.h +1035 -0
- data/share/gccxml-0.9/GCC/2.95/stdexcept +17 -0
- data/share/gccxml-0.9/GCC/2.95/stl_alloc.h +1057 -0
- data/share/gccxml-0.9/GCC/2.95/stl_bvector.h +836 -0
- data/share/gccxml-0.9/GCC/2.95/stl_deque.h +1699 -0
- data/share/gccxml-0.9/GCC/2.95/stl_list.h +843 -0
- data/share/gccxml-0.9/GCC/2.95/stl_tree.h +1331 -0
- data/share/gccxml-0.9/GCC/2.95/stl_vector.h +828 -0
- data/share/gccxml-0.9/GCC/2.95/string +26 -0
- data/share/gccxml-0.9/GCC/2.95/strstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/typeinfo +11 -0
- data/share/gccxml-0.9/GCC/2.95/utility +25 -0
- data/share/gccxml-0.9/GCC/2.95/valarray +52 -0
- data/share/gccxml-0.9/GCC/2.95/vector +19 -0
- data/share/gccxml-0.9/GCC/2.96/sstream +305 -0
- data/share/gccxml-0.9/GCC/3.0/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.1/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/bits/fstream.tcc +500 -0
- data/share/gccxml-0.9/GCC/3.2/bits/istream.tcc +1207 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.h +1810 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.tcc +2397 -0
- data/share/gccxml-0.9/GCC/3.2/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.2/bits/ostream.tcc +713 -0
- data/share/gccxml-0.9/GCC/3.2/bits/sstream.tcc +241 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_deque.h +1682 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_list.h +989 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_vector.h +1085 -0
- data/share/gccxml-0.9/GCC/3.2/bits/valarray_meta.h +1063 -0
- data/share/gccxml-0.9/GCC/3.2/fstream +579 -0
- data/share/gccxml-0.9/GCC/3.2/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/sstream +384 -0
- data/share/gccxml-0.9/GCC/3.3/bits/fstream.tcc +530 -0
- data/share/gccxml-0.9/GCC/3.3/bits/list.tcc +378 -0
- data/share/gccxml-0.9/GCC/3.3/bits/locale_facets.h +2050 -0
- data/share/gccxml-0.9/GCC/3.3/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.3/bits/sstream.tcc +243 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_deque.h +1603 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_list.h +1167 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_vector.h +992 -0
- data/share/gccxml-0.9/GCC/3.3/bits/valarray_meta.h +1135 -0
- data/share/gccxml-0.9/GCC/3.3/fstream +842 -0
- data/share/gccxml-0.9/GCC/3.3/gccxml_builtins.h +22 -0
- data/share/gccxml-0.9/GCC/3.3/sstream +638 -0
- data/share/gccxml-0.9/GCC/3.4/gccxml_builtins.h +91 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_builtins.h +128 -0
- data/share/gccxml-0.9/GCC/4.1/bits/gthr-default.h +618 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/find_flags +105 -0
- data/share/gccxml-0.9/Intel/find_flags +56 -0
- data/share/gccxml-0.9/Intel/pthread.h +16 -0
- data/share/gccxml-0.9/MIPSpro/7.3/exception +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/gccxml_mpro_internals.h +21 -0
- data/share/gccxml-0.9/MIPSpro/7.3/iomanip +161 -0
- data/share/gccxml-0.9/MIPSpro/7.3/ostream +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stddef.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_config.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_locale.h +17 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_monetary.h +14 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_numeric_facets.h +13 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_threads.h +11 -0
- data/share/gccxml-0.9/MIPSpro/7.3/string +18 -0
- data/share/gccxml-0.9/MIPSpro/find_flags +137 -0
- data/share/gccxml-0.9/Sun/5.8/adaptation.patch +168 -0
- data/share/gccxml-0.9/Sun/README +8 -0
- data/share/gccxml-0.9/Sun/adapt_headers.sh +24 -0
- data/share/gccxml-0.9/Sun/find_flags +69 -0
- data/share/gccxml-0.9/gccxml_config +2 -0
- data/share/gccxml-0.9/gccxml_find_flags +93 -0
- data/share/man/man1/gccxml.1 +246 -0
- metadata +324 -0
@@ -0,0 +1,786 @@
|
|
1
|
+
#ifndef __VALARRAY_H
|
2
|
+
#define __VALARRAY_H
|
3
|
+
#pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
|
4
|
+
// -*- C++ -*-
|
5
|
+
#ifndef __RW_VALARRAY__
|
6
|
+
#define __RW_VALARRAY__
|
7
|
+
|
8
|
+
/***************************************************************************
|
9
|
+
*
|
10
|
+
* valaray - Declarations for the Standard Library valarray
|
11
|
+
*
|
12
|
+
***************************************************************************
|
13
|
+
*
|
14
|
+
* Copyright (c) 1994-1999 Rogue Wave Software, Inc. All Rights Reserved.
|
15
|
+
*
|
16
|
+
* This computer software is owned by Rogue Wave Software, Inc. and is
|
17
|
+
* protected by U.S. copyright laws and other laws and by international
|
18
|
+
* treaties. This computer software is furnished by Rogue Wave Software,
|
19
|
+
* Inc. pursuant to a written license agreement and may be used, copied,
|
20
|
+
* transmitted, and stored only in accordance with the terms of such
|
21
|
+
* license and with the inclusion of the above copyright notice. This
|
22
|
+
* computer software or any other copies thereof may not be provided or
|
23
|
+
* otherwise made available to any other person.
|
24
|
+
*
|
25
|
+
* U.S. Government Restricted Rights. This computer software is provided
|
26
|
+
* with Restricted Rights. Use, duplication, or disclosure by the
|
27
|
+
* Government is subject to restrictions as set forth in subparagraph (c)
|
28
|
+
* (1) (ii) of The Rights in Technical Data and Computer Software clause
|
29
|
+
* at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
|
30
|
+
* Commercial Computer Software � Restricted Rights at 48 CFR 52.227-19,
|
31
|
+
* as applicable. Manufacturer is Rogue Wave Software, Inc., 5500
|
32
|
+
* Flatiron Parkway, Boulder, Colorado 80301 USA.
|
33
|
+
*
|
34
|
+
**************************************************************************/
|
35
|
+
#include <rw/valimp>
|
36
|
+
|
37
|
+
#ifndef _RWSTD_NO_NAMESPACE
|
38
|
+
namespace std {
|
39
|
+
#endif
|
40
|
+
|
41
|
+
// forward declarations
|
42
|
+
class _RWSTDExport slice;
|
43
|
+
template <class T> class slice_array;
|
44
|
+
class _RWSTDExport gslice;
|
45
|
+
template <class T> class gslice_array;
|
46
|
+
template <class T> class mask_array;
|
47
|
+
template <class T> class indirect_array;
|
48
|
+
/*************************************************************
|
49
|
+
* CLASS VALARRAY *
|
50
|
+
*************************************************************/
|
51
|
+
|
52
|
+
template <class T> class valarray {
|
53
|
+
|
54
|
+
public:
|
55
|
+
|
56
|
+
typedef T value_type;
|
57
|
+
|
58
|
+
// constructors
|
59
|
+
|
60
|
+
valarray( ) {;}
|
61
|
+
|
62
|
+
_EXPLICIT valarray(size_t size)
|
63
|
+
{ memory_array._initial_size(size); }
|
64
|
+
|
65
|
+
valarray(const T& value, size_t size)
|
66
|
+
{ memory_array._initialize_with_value(value,size); }
|
67
|
+
|
68
|
+
valarray(const T* pointer, size_t size)
|
69
|
+
{ memory_array._initialize_with_array(pointer,size); }
|
70
|
+
|
71
|
+
valarray(const valarray<T>& array)
|
72
|
+
{ memory_array._copy_memory_array(array._RW_get_memory_array()); }
|
73
|
+
|
74
|
+
valarray(const slice_array<T>&);
|
75
|
+
valarray(const gslice_array<T>&);
|
76
|
+
valarray(const mask_array<T>&);
|
77
|
+
valarray(const indirect_array<T>&);
|
78
|
+
|
79
|
+
// operator =
|
80
|
+
|
81
|
+
valarray<T>& operator= (const valarray<T>& array)
|
82
|
+
{
|
83
|
+
if ( this != &array )
|
84
|
+
memory_array._copy_memory_array(array._RW_get_memory_array());
|
85
|
+
return *this;
|
86
|
+
}
|
87
|
+
|
88
|
+
valarray<T>& operator= (const T&);
|
89
|
+
valarray<T>& operator= (const slice_array<T>&);
|
90
|
+
valarray<T>& operator= (const gslice_array<T>&);
|
91
|
+
valarray<T>& operator= (const mask_array<T>&);
|
92
|
+
valarray<T>& operator= (const indirect_array<T>&);
|
93
|
+
|
94
|
+
// operator[]
|
95
|
+
|
96
|
+
T operator[] (size_t ind) const
|
97
|
+
{ return memory_array[ind]; }
|
98
|
+
|
99
|
+
T& operator[] (size_t ind)
|
100
|
+
{ return memory_array[ind]; }
|
101
|
+
|
102
|
+
valarray<T> operator[](slice) const;
|
103
|
+
inline slice_array<T> operator[](slice);
|
104
|
+
valarray<T> operator[](const gslice&) const;
|
105
|
+
inline gslice_array<T> operator[](const gslice&);
|
106
|
+
valarray<T> operator[](const valarray<bool>&) const;
|
107
|
+
inline mask_array<T> operator[](const valarray<bool>&);
|
108
|
+
valarray<T> operator[](const valarray<size_t>&) const;
|
109
|
+
inline indirect_array<T> operator[](const valarray<size_t>&);
|
110
|
+
|
111
|
+
// unary operators
|
112
|
+
|
113
|
+
valarray<T> operator+() const;
|
114
|
+
valarray<T> operator-() const;
|
115
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
116
|
+
valarray<T> operator~() const;
|
117
|
+
valarray<bool> operator!() const;
|
118
|
+
#endif
|
119
|
+
|
120
|
+
// computed assignment
|
121
|
+
|
122
|
+
valarray<T>& operator*= (const valarray<T>& array);
|
123
|
+
valarray<T>& operator/= (const valarray<T>& array);
|
124
|
+
valarray<T>& operator+= (const valarray<T>& array);
|
125
|
+
valarray<T>& operator-= (const valarray<T>& array);
|
126
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
127
|
+
valarray<T>& operator%= (const valarray<T>& array);
|
128
|
+
valarray<T>& operator^= (const valarray<T>& array);
|
129
|
+
valarray<T>& operator&= (const valarray<T>& array);
|
130
|
+
valarray<T>& operator|= (const valarray<T>& array);
|
131
|
+
valarray<T>& operator<<= (const valarray<T>& array);
|
132
|
+
valarray<T>& operator>>= (const valarray<T>& array);
|
133
|
+
#endif
|
134
|
+
valarray<T>& operator*= (const T& val);
|
135
|
+
valarray<T>& operator/= (const T& val);
|
136
|
+
valarray<T>& operator%= (const T& val);
|
137
|
+
valarray<T>& operator+= (const T& val);
|
138
|
+
valarray<T>& operator-= (const T& val);
|
139
|
+
valarray<T>& operator^= (const T& val);
|
140
|
+
valarray<T>& operator&= (const T& val);
|
141
|
+
valarray<T>& operator|= (const T& val);
|
142
|
+
valarray<T>& operator<<= (const T& val);
|
143
|
+
valarray<T>& operator>>= (const T& val);
|
144
|
+
// others
|
145
|
+
|
146
|
+
size_t size() const { return memory_array._get_length(); }
|
147
|
+
|
148
|
+
T sum() const;
|
149
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
150
|
+
T min() const;
|
151
|
+
T max() const;
|
152
|
+
#endif
|
153
|
+
|
154
|
+
valarray<T> shift(int sh) const;
|
155
|
+
valarray<T> cshift(int sh) const;
|
156
|
+
|
157
|
+
valarray<T> apply(T func(T)) const;
|
158
|
+
valarray<T> apply(T func(const T&)) const;
|
159
|
+
|
160
|
+
void free()
|
161
|
+
{ memory_array._RW_resize_without_copy(0); }
|
162
|
+
|
163
|
+
void resize(size_t sz, const T c= T() )
|
164
|
+
{
|
165
|
+
memory_array._RW_resize_without_copy(sz);
|
166
|
+
*this = c;
|
167
|
+
}
|
168
|
+
|
169
|
+
// implementation specific
|
170
|
+
|
171
|
+
const _RW_IMP_SPACE(_RW_array<T>)& _RW_get_memory_array( ) const
|
172
|
+
{ return memory_array; }
|
173
|
+
|
174
|
+
_RW_IMP_SPACE(_RW_array<T>)* _RW_get_memory_array_adr( )
|
175
|
+
{ return &memory_array; }
|
176
|
+
|
177
|
+
valarray(_RW_IMP_SPACE(_RW_temporary<T>)* tmp)
|
178
|
+
{
|
179
|
+
memory_array._replace(tmp->store_adr,tmp->length);
|
180
|
+
delete tmp;
|
181
|
+
}
|
182
|
+
|
183
|
+
private:
|
184
|
+
|
185
|
+
_RW_IMP_SPACE(_RW_array<T>) memory_array;
|
186
|
+
|
187
|
+
};
|
188
|
+
|
189
|
+
/*
|
190
|
+
*
|
191
|
+
* VALARRAY NON MEMBER FUNCTIONS
|
192
|
+
*
|
193
|
+
*/
|
194
|
+
|
195
|
+
// binary operators
|
196
|
+
|
197
|
+
template<class T>
|
198
|
+
valarray<T> operator* (const valarray<T>& , const valarray<T>& );
|
199
|
+
|
200
|
+
template<class T>
|
201
|
+
valarray<T> operator/ (const valarray<T>& , const valarray<T>& );
|
202
|
+
|
203
|
+
template<class T>
|
204
|
+
valarray<T> operator% (const valarray<T>&, const valarray<T>&);
|
205
|
+
|
206
|
+
template<class T>
|
207
|
+
valarray<T> operator+ (const valarray<T>& , const valarray<T>& );
|
208
|
+
|
209
|
+
template<class T>
|
210
|
+
valarray<T> operator- (const valarray<T>& , const valarray<T>& );
|
211
|
+
|
212
|
+
template<class T>
|
213
|
+
valarray<T> operator^ (const valarray<T>&, const valarray<T>&);
|
214
|
+
|
215
|
+
template<class T>
|
216
|
+
valarray<T> operator& (const valarray<T>&, const valarray<T>&);
|
217
|
+
|
218
|
+
template<class T>
|
219
|
+
valarray<T> operator| (const valarray<T>&, const valarray<T>&);
|
220
|
+
|
221
|
+
template<class T>
|
222
|
+
valarray<T> operator<< (const valarray<T>&, const valarray<T>&);
|
223
|
+
|
224
|
+
template<class T>
|
225
|
+
valarray<T> operator>> (const valarray<T>&, const valarray<T>&);
|
226
|
+
|
227
|
+
template<class T>
|
228
|
+
valarray<bool> operator&& (const valarray<T>&, const valarray<T>&);
|
229
|
+
|
230
|
+
template<class T>
|
231
|
+
valarray<bool> operator|| (const valarray<T>&, const valarray<T>&);
|
232
|
+
|
233
|
+
// with non array second param
|
234
|
+
|
235
|
+
template<class T>
|
236
|
+
valarray<T> operator* (const valarray<T>& , const T& );
|
237
|
+
|
238
|
+
template<class T>
|
239
|
+
valarray<T> operator/ (const valarray<T>& , const T& );
|
240
|
+
|
241
|
+
template<class T>
|
242
|
+
valarray<T> operator% (const valarray<T>&, const T&);
|
243
|
+
|
244
|
+
template<class T>
|
245
|
+
valarray<T> operator+ (const valarray<T>& , const T& );
|
246
|
+
|
247
|
+
template<class T>
|
248
|
+
valarray<T> operator- (const valarray<T>& , const T& );
|
249
|
+
|
250
|
+
template<class T>
|
251
|
+
valarray<T> operator^ (const valarray<T>&, const T&);
|
252
|
+
|
253
|
+
template<class T>
|
254
|
+
valarray<T> operator& (const valarray<T>&, const T&);
|
255
|
+
|
256
|
+
template<class T>
|
257
|
+
valarray<T> operator| (const valarray<T>&, const T&);
|
258
|
+
|
259
|
+
template<class T>
|
260
|
+
valarray<T> operator<< (const valarray<T>&, const T&);
|
261
|
+
|
262
|
+
template<class T>
|
263
|
+
valarray<T> operator>> (const valarray<T>&, const T&);
|
264
|
+
|
265
|
+
template<class T>
|
266
|
+
valarray<bool> operator&& (const valarray<T>&, const T&);
|
267
|
+
|
268
|
+
template<class T>
|
269
|
+
valarray<bool> operator|| (const valarray<T>&, const T&);
|
270
|
+
// with non array first param
|
271
|
+
|
272
|
+
template<class T>
|
273
|
+
valarray<T> operator* (const T& , const valarray<T>& );
|
274
|
+
|
275
|
+
template<class T>
|
276
|
+
valarray<T> operator/ (const T& , const valarray<T>& );
|
277
|
+
|
278
|
+
template<class T>
|
279
|
+
valarray<T> operator% (const T&, const valarray<T>&);
|
280
|
+
|
281
|
+
template<class T>
|
282
|
+
valarray<T> operator+ (const T& , const valarray<T>& );
|
283
|
+
|
284
|
+
template<class T>
|
285
|
+
valarray<T> operator- (const T& , const valarray<T>& );
|
286
|
+
|
287
|
+
template<class T>
|
288
|
+
valarray<T> operator^ (const T&, const valarray<T>&);
|
289
|
+
|
290
|
+
template<class T>
|
291
|
+
valarray<T> operator& (const T&, const valarray<T>&);
|
292
|
+
|
293
|
+
template<class T>
|
294
|
+
valarray<T> operator| (const T&, const valarray<T>&);
|
295
|
+
|
296
|
+
template<class T>
|
297
|
+
valarray<T> operator<< (const T&, const valarray<T>&);
|
298
|
+
|
299
|
+
template<class T>
|
300
|
+
valarray<T> operator>> (const T&, const valarray<T>&);
|
301
|
+
|
302
|
+
template<class T>
|
303
|
+
valarray<bool> operator&& (const T&, const valarray<T>&);
|
304
|
+
|
305
|
+
template<class T>
|
306
|
+
valarray<bool> operator|| (const T&, const valarray<T>&);
|
307
|
+
|
308
|
+
// comparison operators
|
309
|
+
|
310
|
+
template<class T>
|
311
|
+
valarray<bool> operator== (const valarray<T>& , const valarray<T>& );
|
312
|
+
|
313
|
+
template<class T>
|
314
|
+
valarray<bool> operator!= (const valarray<T>& , const valarray<T>& );
|
315
|
+
|
316
|
+
template<class T>
|
317
|
+
valarray<bool> operator< (const valarray<T>& , const valarray<T>& );
|
318
|
+
|
319
|
+
template<class T>
|
320
|
+
valarray<bool> operator> (const valarray<T>& , const valarray<T>& );
|
321
|
+
|
322
|
+
template<class T>
|
323
|
+
valarray<bool> operator<= (const valarray<T>& , const valarray<T>& );
|
324
|
+
|
325
|
+
template<class T>
|
326
|
+
valarray<bool> operator>= (const valarray<T>& , const valarray<T>& );
|
327
|
+
|
328
|
+
// comparison operators, non valarray second param
|
329
|
+
|
330
|
+
template<class T>
|
331
|
+
valarray<bool> operator== (const valarray<T>& , const T& );
|
332
|
+
|
333
|
+
template<class T>
|
334
|
+
valarray<bool> operator!= (const valarray<T>& , const T& );
|
335
|
+
|
336
|
+
template<class T>
|
337
|
+
valarray<bool> operator< (const valarray<T>& , const T& );
|
338
|
+
|
339
|
+
template<class T>
|
340
|
+
valarray<bool> operator> (const valarray<T>& , const T& );
|
341
|
+
|
342
|
+
template<class T>
|
343
|
+
valarray<bool> operator<= (const valarray<T>& , const T& );
|
344
|
+
|
345
|
+
template<class T>
|
346
|
+
valarray<bool> operator>= (const valarray<T>& , const T& );
|
347
|
+
|
348
|
+
// comparison operators, non valarray first param
|
349
|
+
|
350
|
+
template<class T>
|
351
|
+
valarray<bool> operator== (const T& , const valarray<T>& );
|
352
|
+
|
353
|
+
template<class T>
|
354
|
+
valarray<bool> operator!= (const T& , const valarray<T>& );
|
355
|
+
|
356
|
+
template<class T>
|
357
|
+
valarray<bool> operator< (const T& , const valarray<T>& );
|
358
|
+
|
359
|
+
template<class T>
|
360
|
+
valarray<bool> operator> (const T& , const valarray<T>& );
|
361
|
+
|
362
|
+
template<class T>
|
363
|
+
valarray<bool> operator<= (const T& , const valarray<T>& );
|
364
|
+
|
365
|
+
template<class T>
|
366
|
+
valarray<bool> operator>= (const T& , const valarray<T>& );
|
367
|
+
|
368
|
+
|
369
|
+
// transcendentals
|
370
|
+
|
371
|
+
template<class T>
|
372
|
+
valarray<T> abs(const valarray<T>& );
|
373
|
+
|
374
|
+
template<class T>
|
375
|
+
valarray<T> acos(const valarray<T>& );
|
376
|
+
|
377
|
+
template<class T>
|
378
|
+
valarray<T> asin(const valarray<T>& );
|
379
|
+
|
380
|
+
template<class T>
|
381
|
+
valarray<T> atan(const valarray<T>& );
|
382
|
+
|
383
|
+
template<class T>
|
384
|
+
valarray<T> cos(const valarray<T>& );
|
385
|
+
|
386
|
+
template<class T>
|
387
|
+
valarray<T> cosh(const valarray<T>& );
|
388
|
+
|
389
|
+
template<class T>
|
390
|
+
valarray<T> exp(const valarray<T>& );
|
391
|
+
|
392
|
+
template<class T>
|
393
|
+
valarray<T> log(const valarray<T>& );
|
394
|
+
|
395
|
+
template<class T>
|
396
|
+
valarray<T> log10(const valarray<T>& );
|
397
|
+
|
398
|
+
template<class T>
|
399
|
+
valarray<T> sinh(const valarray<T>& );
|
400
|
+
|
401
|
+
template<class T>
|
402
|
+
valarray<T> sin(const valarray<T>& );
|
403
|
+
|
404
|
+
template<class T>
|
405
|
+
valarray<T> sqrt(const valarray<T>& );
|
406
|
+
|
407
|
+
template<class T>
|
408
|
+
valarray<T> tan(const valarray<T>& );
|
409
|
+
|
410
|
+
template<class T>
|
411
|
+
valarray<T> tanh(const valarray<T>& );
|
412
|
+
|
413
|
+
template<class T>
|
414
|
+
valarray<T> atan2(const valarray<T>& , const valarray<T>& );
|
415
|
+
|
416
|
+
template<class T>
|
417
|
+
valarray<T> atan2(const valarray<T>& , const T& );
|
418
|
+
|
419
|
+
template<class T>
|
420
|
+
valarray<T> atan2(const T& , const valarray<T>& );
|
421
|
+
|
422
|
+
template<class T>
|
423
|
+
valarray<T> pow(const valarray<T>& , const valarray<T>& );
|
424
|
+
|
425
|
+
template<class T>
|
426
|
+
valarray<T> pow(const valarray<T>& , const T& );
|
427
|
+
|
428
|
+
template<class T>
|
429
|
+
valarray<T> pow(const T& , const valarray<T>& );
|
430
|
+
|
431
|
+
// Global min and max template fonction
|
432
|
+
// for compiler that try to instantiate all the member function
|
433
|
+
|
434
|
+
#ifdef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
435
|
+
template <class T> T max(const valarray<T>&);
|
436
|
+
template <class T> T min(const valarray<T>&);
|
437
|
+
#endif
|
438
|
+
|
439
|
+
/****************************************************************
|
440
|
+
* SLICE AND SLICE_ARRAY *
|
441
|
+
****************************************************************/
|
442
|
+
|
443
|
+
class _RWSTDExport slice {
|
444
|
+
|
445
|
+
public:
|
446
|
+
|
447
|
+
slice()
|
448
|
+
: start_(0), length_(0), stride_(0)
|
449
|
+
{;}
|
450
|
+
slice(size_t start, size_t length, size_t stride)
|
451
|
+
: start_(start)
|
452
|
+
, length_(length)
|
453
|
+
, stride_(stride)
|
454
|
+
{;}
|
455
|
+
|
456
|
+
slice(const slice& sl)
|
457
|
+
:start_(sl.start())
|
458
|
+
,length_(sl.size())
|
459
|
+
,stride_(sl.stride())
|
460
|
+
{;}
|
461
|
+
|
462
|
+
size_t start() const { return start_; }
|
463
|
+
size_t size() const { return length_; }
|
464
|
+
size_t stride() const { return stride_; }
|
465
|
+
|
466
|
+
private:
|
467
|
+
|
468
|
+
size_t start_;
|
469
|
+
size_t length_;
|
470
|
+
size_t stride_;
|
471
|
+
|
472
|
+
};
|
473
|
+
|
474
|
+
template <class T> class slice_array {
|
475
|
+
|
476
|
+
public:
|
477
|
+
|
478
|
+
typedef T value_type;
|
479
|
+
|
480
|
+
slice_array( _RW_IMP_SPACE(_RW_array<T>)* pt,const slice& a )
|
481
|
+
:ref_mem_array(pt)
|
482
|
+
,slice_(a)
|
483
|
+
{;}
|
484
|
+
|
485
|
+
slice_array(const slice_array<T>& sl)
|
486
|
+
:ref_mem_array(sl.get_ref_mem_array())
|
487
|
+
,slice_(sl.get_slice())
|
488
|
+
{;}
|
489
|
+
|
490
|
+
_RW_IMP_SPACE(_RW_array<T>)* get_ref_mem_array() const { return ref_mem_array; }
|
491
|
+
slice get_slice() const { return slice_; }
|
492
|
+
|
493
|
+
// assignment
|
494
|
+
|
495
|
+
void operator= (const valarray<T>& ) const;
|
496
|
+
void operator= (const T&) const;
|
497
|
+
|
498
|
+
// computed assignment
|
499
|
+
|
500
|
+
void operator*= (const valarray<T>& ) const;
|
501
|
+
void operator/= (const valarray<T>& ) const;
|
502
|
+
void operator+= (const valarray<T>& ) const;
|
503
|
+
void operator-= (const valarray<T>& ) const;
|
504
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
505
|
+
void operator%= (const valarray<T>& ) const;
|
506
|
+
void operator^= (const valarray<T>& ) const;
|
507
|
+
void operator&= (const valarray<T>& ) const;
|
508
|
+
void operator|= (const valarray<T>& ) const;
|
509
|
+
void operator<<= (const valarray<T>& ) const;
|
510
|
+
void operator>>= (const valarray<T>& ) const;
|
511
|
+
#endif
|
512
|
+
|
513
|
+
private:
|
514
|
+
|
515
|
+
slice_array();
|
516
|
+
slice_array<T>& operator= (const slice_array<T>&);
|
517
|
+
|
518
|
+
_RW_IMP_SPACE(_RW_array<T>)* ref_mem_array;
|
519
|
+
slice slice_;
|
520
|
+
|
521
|
+
};
|
522
|
+
/****************************************************************
|
523
|
+
* GSLICE AND GSLICE_ARRAY *
|
524
|
+
****************************************************************/
|
525
|
+
|
526
|
+
class _RWSTDExport gslice {
|
527
|
+
|
528
|
+
public:
|
529
|
+
|
530
|
+
gslice()
|
531
|
+
: start_(0)
|
532
|
+
, reset_(true)
|
533
|
+
{;}
|
534
|
+
|
535
|
+
|
536
|
+
gslice(size_t s, const valarray<size_t>& l, const valarray<size_t>& d)
|
537
|
+
: start_(s)
|
538
|
+
, length_(l)
|
539
|
+
, stride_(d)
|
540
|
+
, reset_(true)
|
541
|
+
, r_length_((size_t)0,l.size())
|
542
|
+
{;}
|
543
|
+
|
544
|
+
gslice(const gslice& sl)
|
545
|
+
: start_(sl.start())
|
546
|
+
, length_(sl.size())
|
547
|
+
, stride_(sl.stride())
|
548
|
+
, reset_(true)
|
549
|
+
, r_length_((size_t)0,sl.size().size())
|
550
|
+
{;}
|
551
|
+
|
552
|
+
size_t start() const { return start_; }
|
553
|
+
valarray<size_t> size() const { return length_; }
|
554
|
+
valarray<size_t> stride() const { return stride_; }
|
555
|
+
|
556
|
+
size_t next_ind();
|
557
|
+
inline size_t is_reseted() const { return reset_; }
|
558
|
+
size_t ind_max() const;
|
559
|
+
size_t ind_numb() const;
|
560
|
+
|
561
|
+
private:
|
562
|
+
|
563
|
+
size_t start_;
|
564
|
+
valarray<size_t> length_;
|
565
|
+
valarray<size_t> stride_;
|
566
|
+
|
567
|
+
bool reset_;
|
568
|
+
valarray<size_t> r_length_;
|
569
|
+
|
570
|
+
};
|
571
|
+
// class gslice_array
|
572
|
+
|
573
|
+
template <class T> class gslice_array {
|
574
|
+
public:
|
575
|
+
|
576
|
+
typedef T value_type;
|
577
|
+
|
578
|
+
gslice_array( _RW_IMP_SPACE(_RW_array<T>)* pt,const gslice& a )
|
579
|
+
:ref_mem_array(pt)
|
580
|
+
,slice_(a)
|
581
|
+
{;}
|
582
|
+
|
583
|
+
gslice_array(const gslice_array<T>& sl)
|
584
|
+
:ref_mem_array(sl.get_ref_mem_array())
|
585
|
+
,slice_(sl.get_slice())
|
586
|
+
{;}
|
587
|
+
|
588
|
+
_RW_IMP_SPACE(_RW_array<T>)* get_ref_mem_array() const { return ref_mem_array; }
|
589
|
+
gslice get_slice() const { return slice_; }
|
590
|
+
|
591
|
+
// assignment
|
592
|
+
|
593
|
+
void operator= (const valarray<T>& ) const;
|
594
|
+
void operator= (const T&) const;
|
595
|
+
|
596
|
+
// computed assignment
|
597
|
+
|
598
|
+
void operator*= (const valarray<T>& ) const;
|
599
|
+
void operator/= (const valarray<T>& ) const;
|
600
|
+
void operator+= (const valarray<T>& ) const;
|
601
|
+
void operator-= (const valarray<T>& ) const;
|
602
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
603
|
+
void operator%= (const valarray<T>& ) const;
|
604
|
+
void operator^= (const valarray<T>& ) const;
|
605
|
+
void operator&= (const valarray<T>& ) const;
|
606
|
+
void operator|= (const valarray<T>& ) const;
|
607
|
+
void operator<<= (const valarray<T>& ) const;
|
608
|
+
void operator>>= (const valarray<T>& ) const;
|
609
|
+
#endif
|
610
|
+
|
611
|
+
private:
|
612
|
+
|
613
|
+
gslice_array();
|
614
|
+
gslice_array<T>& operator= (const gslice_array<T>&);
|
615
|
+
|
616
|
+
_RW_IMP_SPACE(_RW_array<T>)* ref_mem_array;
|
617
|
+
gslice slice_;
|
618
|
+
|
619
|
+
};
|
620
|
+
|
621
|
+
|
622
|
+
/****************************************************************
|
623
|
+
* MASK_ARRAY *
|
624
|
+
****************************************************************/
|
625
|
+
// class mask_array
|
626
|
+
|
627
|
+
template <class T> class mask_array {
|
628
|
+
public:
|
629
|
+
|
630
|
+
typedef T value_type;
|
631
|
+
|
632
|
+
mask_array( _RW_IMP_SPACE(_RW_array<T>)* pt,const valarray<bool>& a )
|
633
|
+
:ref_mem_array(pt)
|
634
|
+
,array(a)
|
635
|
+
{;}
|
636
|
+
|
637
|
+
mask_array(const mask_array<T>& sl)
|
638
|
+
:ref_mem_array(sl.get_ref_mem_array())
|
639
|
+
,array(sl.get_array())
|
640
|
+
{;}
|
641
|
+
|
642
|
+
_RW_IMP_SPACE(_RW_array<T>)* get_ref_mem_array() const { return ref_mem_array; }
|
643
|
+
valarray<bool> get_array() const { return array; }
|
644
|
+
valarray<bool>* get_array_pt() { return &array; }
|
645
|
+
|
646
|
+
// assignment
|
647
|
+
|
648
|
+
void operator= (const valarray<T>& ) const;
|
649
|
+
void operator= (const T&) const;
|
650
|
+
|
651
|
+
// computed assignment
|
652
|
+
|
653
|
+
void operator*= (const valarray<T>& ) const;
|
654
|
+
void operator/= (const valarray<T>& ) const;
|
655
|
+
void operator+= (const valarray<T>& ) const;
|
656
|
+
void operator-= (const valarray<T>& ) const;
|
657
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
658
|
+
void operator%= (const valarray<T>& ) const;
|
659
|
+
void operator^= (const valarray<T>& ) const;
|
660
|
+
void operator&= (const valarray<T>& ) const;
|
661
|
+
void operator|= (const valarray<T>& ) const;
|
662
|
+
void operator<<= (const valarray<T>& ) const;
|
663
|
+
void operator>>= (const valarray<T>& ) const;
|
664
|
+
#endif
|
665
|
+
|
666
|
+
private:
|
667
|
+
|
668
|
+
mask_array();
|
669
|
+
mask_array<T>& operator= (const mask_array<T>&);
|
670
|
+
|
671
|
+
_RW_IMP_SPACE(_RW_array<T>)* ref_mem_array;
|
672
|
+
valarray<bool> array;
|
673
|
+
|
674
|
+
};
|
675
|
+
|
676
|
+
|
677
|
+
/****************************************************************
|
678
|
+
* INDIRECT_ARRAY *
|
679
|
+
****************************************************************/
|
680
|
+
// class indirect_array
|
681
|
+
|
682
|
+
template <class T> class indirect_array {
|
683
|
+
public:
|
684
|
+
|
685
|
+
typedef T value_type;
|
686
|
+
|
687
|
+
indirect_array( _RW_IMP_SPACE(_RW_array<T>)* pt,const valarray<size_t>& a )
|
688
|
+
:ref_mem_array(pt)
|
689
|
+
,array(a)
|
690
|
+
{;}
|
691
|
+
|
692
|
+
indirect_array(const indirect_array<T>& sl)
|
693
|
+
:ref_mem_array(sl.get_ref_mem_array())
|
694
|
+
,array(sl.get_array())
|
695
|
+
{;}
|
696
|
+
|
697
|
+
_RW_IMP_SPACE(_RW_array<T>)* get_ref_mem_array() const { return ref_mem_array; }
|
698
|
+
valarray<size_t> get_array() const { return array; }
|
699
|
+
valarray<size_t>* get_array_pt() { return &array; }
|
700
|
+
|
701
|
+
// assignment
|
702
|
+
|
703
|
+
void operator= (const valarray<T>& ) const;
|
704
|
+
void operator= (const T& ) const;
|
705
|
+
|
706
|
+
// computed assignment
|
707
|
+
|
708
|
+
void operator*= (const valarray<T>& ) const;
|
709
|
+
void operator/= (const valarray<T>& ) const;
|
710
|
+
void operator+= (const valarray<T>& ) const;
|
711
|
+
void operator-= (const valarray<T>& ) const;
|
712
|
+
#ifndef _RWSTD_NO_ONLY_NEEDED_INSTANTIATION
|
713
|
+
void operator%= (const valarray<T>& ) const;
|
714
|
+
void operator^= (const valarray<T>& ) const;
|
715
|
+
void operator&= (const valarray<T>& ) const;
|
716
|
+
void operator|= (const valarray<T>& ) const;
|
717
|
+
void operator<<= (const valarray<T>& ) const;
|
718
|
+
void operator>>= (const valarray<T>& ) const;
|
719
|
+
#endif
|
720
|
+
|
721
|
+
private:
|
722
|
+
|
723
|
+
indirect_array();
|
724
|
+
indirect_array<T>& operator= (const indirect_array<T>&);
|
725
|
+
|
726
|
+
_RW_IMP_SPACE(_RW_array<T>)* ref_mem_array;
|
727
|
+
valarray<size_t> array;
|
728
|
+
|
729
|
+
};
|
730
|
+
|
731
|
+
/*
|
732
|
+
* VALARRAY INLINE MEMBER FUNCTIONS
|
733
|
+
*/
|
734
|
+
template <class T>
|
735
|
+
inline valarray<T>& valarray<T>::operator=(const T& value)
|
736
|
+
{
|
737
|
+
memory_array._initialize_with_value(value, size());
|
738
|
+
return *this;
|
739
|
+
}
|
740
|
+
|
741
|
+
// operator[] for slice
|
742
|
+
|
743
|
+
template <class T>
|
744
|
+
inline slice_array<T> valarray<T>::operator[](slice sl)
|
745
|
+
{
|
746
|
+
return slice_array<T>(&memory_array, sl);
|
747
|
+
}
|
748
|
+
|
749
|
+
// operator[] for gslice
|
750
|
+
|
751
|
+
|
752
|
+
template <class T>
|
753
|
+
inline gslice_array<T> valarray<T>::operator[](const gslice& sl)
|
754
|
+
{
|
755
|
+
return gslice_array<T>(&memory_array, sl);
|
756
|
+
}
|
757
|
+
// operator[] for valarray[valarray<bool>] used with mask_array
|
758
|
+
|
759
|
+
|
760
|
+
template <class T>
|
761
|
+
inline mask_array<T> valarray<T>::operator[](const valarray<bool>& array)
|
762
|
+
{
|
763
|
+
return mask_array<T>(&memory_array, array);
|
764
|
+
}
|
765
|
+
// operator[] for valarray[valarray<size_t>] used with indirect_array
|
766
|
+
template <class T>
|
767
|
+
inline indirect_array<T> valarray<T>::operator[](const valarray<size_t>& array)
|
768
|
+
{
|
769
|
+
return indirect_array<T>(&memory_array, array);
|
770
|
+
}
|
771
|
+
|
772
|
+
#ifndef _RWSTD_NO_NAMESPACE
|
773
|
+
}
|
774
|
+
#endif
|
775
|
+
|
776
|
+
#ifdef _RWSTD_NO_TEMPLATE_REPOSITORY
|
777
|
+
#include <valarray.cc>
|
778
|
+
#endif
|
779
|
+
#endif /* __VALARRAY__ */
|
780
|
+
|
781
|
+
#ifndef __USING_STD_NAMES__
|
782
|
+
using namespace std;
|
783
|
+
#endif
|
784
|
+
|
785
|
+
#pragma option pop
|
786
|
+
#endif /* __VALARRAY_H */
|