Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #4K
~2K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Sandhya212

Hi, I need to find the 'length' of union between 2 vectors. The code I have is[CODE] vector<int> v1,v2; vector<int> unionsetv; vector<int>::iterator it; v1.push_back(1);v1.push_back(2);v1.push_back(3); v2.push_back(3);v2.push_back(2);v2.push_back(4); it = set_union(v1.begin(),v1.end(),v2.begin(),v2.end(),back_inserter(unionsetv)); cout << unionsetv.size()<< " "; cout << int(it - unionsetv.begin())<< " " ; [/CODE] I could not get this to work and …

Member Avatar for Sandhya212
0
227
Member Avatar for Sandhya212

Hi, My requirement is to identify '-' in string1 and delete those corresponding locations in string2. The logic I am implementing is that 1. find the locations in string1 where '-' occurs 2. At these locations, insert spaces in string2 and then 3. have string2 without spaces. I managed to …

Member Avatar for TrustyTony
0
120
Member Avatar for Sandhya212

Dear all. I have a file with lines like this.[CODE] query 210 ACTTGGACTC 219 query 311 ACTTGGACTC 320 ....[/CODE] From every line, I need to extract the number coming right after 'query' and then the DNA sequence. I currently read each line as a list but was only able to …

Member Avatar for Sandhya212
0
161
Member Avatar for God Coder123

If i had an Array as seen below, is it possible to use the rand function to randomly select an element within that particular array; if so how can this be done. The Value of the element will be outputted. Any help much appreciated...:) [CODE]int Array[14]={10,10,10,10,11,6,9,2,3,15,11,15,16,15};[/CODE]

Member Avatar for God Coder123
0
103
Member Avatar for Sandhya212

Hi, I am using Sparselib++ in this C++ program. [code]#include <iostream> #include <cstdlib> #include "comprow_double.h" using namespace std; int main() { cout << "Sparse example" << endl; // prints Sparse example double val[12]={1,2,3,4,5,6,7,8,9,10,11,12}; int colind[12]={0,1,4,0,1,2,1,2,4,3,0,4}; int rowptr[6]={0,3,6,9,10,12}; CompRow_Mat_double R (5,5,12,val,rowptr,colind); return 0; }[/code] Since I use Eclipse, I have added …

Member Avatar for Sandhya212
0
557
Member Avatar for Sandhya212

Hi, I need to make a pairs between array elements. For eg if the sored array I have is [CODE]1 1 1 2 1 4 1 6 2 3 2 5 2 8 2 9 3 7 3 10[/CODE] then I need to pair every element of the 2nd column …

Member Avatar for Sandhya212
0
241
Member Avatar for Sandhya212

Hi, I would need to create unique filenames appended by the iteration number. For eg. [CODE]for( i=0;i<iterations;i++){ ofstream outfile("iterfile"+"i"); // i.e filename should be iterfile0 for 1st iteration. } [/CODE] I need to cast "i" from int to char so I tried [CODE]ofstream outfile("iterfile"+(char)i)[/CODE] but it did not work. How …

Member Avatar for Sandhya212
0
217
Member Avatar for Sandhya212

Hi, I use Fedore Eclipse IDE to run C++ code. I need to use the Scythe Statistical toolbox which implements random number generators from different functions (gamma, beta etc). I have added the toolbox's location to the path of header files in Eclipse and added the [CODE]#include "distribution"[/CODE] (available in …

Member Avatar for Sandhya212
0
156
Member Avatar for Sandhya212

Hi, I have code as follows wherein I pass a 2D array to a function and want to receive this array with its contents tripled. [CODE]#include <iostream> #include <cstdio> using namespace std; int** test2 (int arr2[][4],int mul){ for (int i=0;i<2;i++){ for(int j=0;j<4;j++){ arr2[i][j]=arr2[i][j]*mul; } } return arr2;//sending back the address …

Member Avatar for Sandhya212
0
456
Member Avatar for Sandhya212

Hi, I am very new to Python and thus the question. I have a Python List ready now which I need to send to a C program for further processing. Is this possible? I came across SWIG which does a C to Python but could not find anything that did …

Member Avatar for sab73
0
106