I am trying to create a very large 3D array. I am currently using a psuedo-3D array with a 1D array. Here is what I have so far: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #include <vector> #include <numeric> using namespace std; const int depth … |
|
I am trying to create a 3D vector and then populate it with values. Firstly I want to create a 3D vector of size 100 with all initial values set to zero. I know that to do this in the 1D case the code would read as follows: [CODE]vector<float> vec … |
|
I'm not really sure what the correct way to initialize a 3d array is. [CODE]float array3D[100][100][100] = {0};[/CODE] Is this correct? When I try to compile I get problems. |
|
I am having problems using the accumulate to find the sum of all elements in a vector. Here is what I have: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #include <vector> #include <numeric> using namespace std; int main() { vector<float> energy; for(int i = 0; … |
|
Here is what I have so far: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> #include <istream> #include <string> #include <vector> using namespace std; class dm_energy_vec { public: vector<float> m_energy_dep; }; int main() { const int phantom_size = 50; int energy_index; vector<float> xpos; vector<float> energy; vector<float> energy_dep (0, phantom_size); vector<dm_energy_vec> … |
|
I have a large data base that looks like the following: Energy position 5.639792 1.36 4.844813 1.89 4.809105 2.33 3.954150 2.69 2.924234 3.42 1.532669 4.50 0.000000 5.63 The actual data contains thousands of rows. The first column of the data is the particle energy and second column is the particle … |
|
I have created a program that reads data from a file and stores it into a vector. The data looks something like the following: 48.698635 -0.000000 0.000019 1.000000 -0.004386 0.002192 // Step 1 48.583797 0.114838 0.100000 1.099997 -0.005061 0.001945 //Step 2 48.457909 0.125888 0.100000 1.199994 -0.005854 0.001883 //Step 3 ect... … |
|
I am trying to write a program in c++. I have a file that contains thousands of numeric entries sorted into four columns. The structure of the data looks something like the following: 3 0.2 0.5 6.2 4 0.1 0.6 6.2 //Track 1 2 0.8 0.5 0.6 2 0.6 0.5 … |
Joined
Last Seen
0 Reputation Points
0 Endorsements
Ranked #18.7K