Note that there are some explanatory texts on larger screens.

plurals
  1. POC/C++ for Python programmer
    primarykey
    data
    text
    <p>I have to switch from Python to C/C++. <br/> Do you know a quick "reference tutorial" or something like that to have a reference to how to start? For example something like the Numpy and Scipy tutorials.<br/> I have read a lot of "documentation", for example</p> <ul> <li>C++ for dummies</li> <li>the K&R C Programming Language</li> <li>a lot of blog and online documentation such as: http://eli.thegreenplace.net/2010/01/11/pointers-to-arrays-in-c/, </li> <li>http://newdata.box.sk/bx/c/</li> <li>tons of Q&A here on StackOverflow</li> <li>...</li> </ul> <p>but it's still not clear to me even how to do start porting to C/C++ something like:</p> <pre><code>#!/usr/bin/env python import time import numpy as np import tables as tb """Retrieve 3D positions form 1000 files and store them in one single HDF5 file. """ t = time.time() # Empty array sample = np.array([]) sample.shape = (0,3) # Loop over the files for i in range(0, 1000): filename = "mill2sort-"+str(i)+"-extracted.h5" print "Doing ", filename # Open data file h5f = tb.openFile(filename, 'r') # Stack new data under previous data sample = np.vstack((sample, h5f.root.data.read())) h5f.close() # Create the new file h5 = tb.openFile("mill2sort-extracted-all", 'w') # Save the array h5.createArray(h5.root, 'data', sample, title='mill_2_sub_sample_all') h5.flush() h5.close() print "Done in ", time.time()-t, " seconds." </code></pre> <p>in C or C++. In this example I was not even able to understand how to pass a 3D array to a function that find it's dimensions, something like</p> <pre><code>int getArrayDimensions(int* array, int *dimensions){ *dimensions = sizeof(*array)/sizeof(array[0]); return 0; } </code></pre> <p>With array being </p> <pre><code>int array[3][3][3] = ... </code></pre> <p>Thank you for any suggestion!:)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload