- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the intel fortran compiler 11 on linux.
1 - ) Bit field
I want to create a long bit chain. Use the bits on Integer (Kind=8) is not enough. It must have the range 1-10000000.
The way I founded is create a array of logical
LOGICAL (KIND=1) :: gene( 10000 )
But it is very ugly because it allocated 10000 bytes instead bits. And I can't use the intrisic bit functions.
Is there a way of make true bit field?
2 - ) I tried to use the graphic library but it is just available for windows. Please make it work for linux.
tks
1 - ) Bit field
I want to create a long bit chain. Use the bits on Integer (Kind=8) is not enough. It must have the range 1-10000000.
The way I founded is create a array of logical
LOGICAL (KIND=1) :: gene( 10000 )
But it is very ugly because it allocated 10000 bytes instead bits. And I can't use the intrisic bit functions.
Is there a way of make true bit field?
2 - ) I tried to use the graphic library but it is just available for windows. Please make it work for linux.
tks
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - brunocalado
I'm using the intel fortran compiler 11 on linux.
1 - ) Bit field
I want to create a long bit chain. Use the bits on Integer (Kind=8) is not enough. It must have the range 1-10000000.
The way I founded is create a array of logical
LOGICAL (KIND=1) :: gene( 10000 )
But it is very ugly because it allocated 10000 bytes instead bits. And I can't use the intrisic bit functions.
Is there a way of make true bit field?
2 - ) I tried to use the graphic library but it is just available for windows. Please make it work for linux.
tks
1 - ) Bit field
I want to create a long bit chain. Use the bits on Integer (Kind=8) is not enough. It must have the range 1-10000000.
The way I founded is create a array of logical
LOGICAL (KIND=1) :: gene( 10000 )
But it is very ugly because it allocated 10000 bytes instead bits. And I can't use the intrisic bit functions.
Is there a way of make true bit field?
2 - ) I tried to use the graphic library but it is just available for windows. Please make it work for linux.
tks
2) not clear what library is "*the* graphics library" :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - eliosh
1) I am afraid you will have to allocate an array of integers and access the bits manually.
2) not clear what library is "*the* graphics library" :)
2) not clear what library is "*the* graphics library" :)
There's functions for graphical interface. like arc pixels But they are available only for windows
INTEGER :: Array(5,10)
INTEGER :: tmp(5)
Array = 1
tmp = 2
Array(:,10) = tmp
Why the last line doesn't work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How does it "not work"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
How does it "not work"?
But I did the same here. Look:
LOGICAL (KIND=1) :: gene(5, 10)
INTEGER :: Index(10)
gene(:,:) = gene(:,Index)
Output:
Index Gene before (gene(:,:) = gene(:,Index))
1 : T F F T T
2 : T T T T T
3 : T T T T T
4 : T T F T T
5 : F T F T T
6 : F F F T T
7 : T F T F F
8 : T F T T T
9 : F F T T F
10 : T T F T F
Index before -> new Index Gene after (gene(:,:) = gene(:,Index))
1 -> 5 F T F T T
2 -> 1 T F F T T
3 -> 2 T T T T T
4 -> 3 T T T T T
5 -> 6 F F F T T
6 -> 8 T F T T T
7 -> 9 F F T T F
8 -> 4 T T F T T
9 -> 10 T T F T F
10 -> 7 T F T F F
The genes must change. The second (T T T T T) should go to the first position. The third (T T T T T) to the second...
It is the same thing, no?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - brunocalado
But I did the same here. Look:
LOGICAL (KIND=1) :: gene(5, 10)
INTEGER :: Index(10)
gene(:,:) = gene(:,Index)
Output:
1 : T F F T T
2 : T T T T T
3 : T T T T T
4 : T T F T T
5 : F T F T T
6 : F F F T T
7 : T F T F F
8 : T F T T T
9 : F F T T F
10 : T T F T F
1 -> 5 F T F T T
2 -> 1 T F F T T
3 -> 2 T T T T T
4 -> 3 T T T T T
5 -> 6 F F F T T
6 -> 8 T F T T T
7 -> 9 F F T T F
8 -> 4 T T F T T
9 -> 10 T T F T F
10 -> 7 T F T F F
The genes must change. The second (T T T T T) should go to the first position. The third (T T T T T) to the second...
It is the same thing, no?
What can we see from this example ?????
Show the content of gene and Index before the permutation and after it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - brunocalado
updated
Note that the index change 1->5 means that the 5th element moves to the first position. Similarly, 2->4 means that the fourth element becomes the second.
For some reason you expect them to move in "reverse" direction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - eliosh
Your results look perfectly reasonable.
Note that the index change 1->5 means that the 5th element moves to the first position. Similarly, 2->4 means that the fourth element becomes the second.
For some reason you expect them to move in "reverse" direction.
Note that the index change 1->5 means that the 5th element moves to the first position. Similarly, 2->4 means that the fourth element becomes the second.
For some reason you expect them to move in "reverse" direction.
Thank you.
This is what I want.
gene(:,Index) = gene(:,:)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page