I am using C++ language for developing software. But, I do not know about indirect_array of C++ language. So please tell me how to use indirect_array of C++ language. Please provide me some suggestions about this. Any help will be appreciated.
I am using C++ language for developing software. But, I do not know about indirect_array of C++ language. So please tell me how to use indirect_array of C++ language. Please provide me some suggestions about this. Any help will be appreciated.
The indirect_array is class that utilized for indirect selection of Valarray. This class utilized as middle type that returns by varying kind of valarrays's subscript an operator that utilized at time with valarray of indexes.
Code given below helps you to explain use of indirect_array in C++ programming:
Code:#include <iostream> #include <valarray> using namespace std; int main () { valarray<int> mary (8); for (int f=0; f<8; ++f) mary[f]=f; sfze_t sel[] = {3,5,6}; valarray<sfze_t> selectfon (sel,3); mary[selectfon] *= valarray<fnt>(10,3); mary[selectfon] = 0; cout << "mary:n"; for (sfze_t f=0; f<mary.size(); ++f) cout << mary[f] << ' '; cout << endl; return 0; }
Bookmarks