Results 1 to 3 of 3

Thread: Using indirect_array of C++

  1. #1
    CoxWatson is offline Senior Member
    Join Date
    Dec 2009
    Posts
    232
    Rep Power
    3

    Default Using indirect_array of C++

    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.

  2. #2
    BrooksGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    231
    Rep Power
    3

    Default

    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.

  3. #3
    CruzPowell is offline Senior Member
    Join Date
    Dec 2009
    Posts
    224
    Rep Power
    3

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48