Commit d3302565 authored by TOUZE Francois's avatar TOUZE Francois
Browse files

docker container creation: step 3

parent 53db3b12
......@@ -86,7 +86,7 @@ bool dataManager::executeAll()
particleBeam *computedBeam= NULL;
for(unsigned int k = 0; k < blks.size(); ++k)
{
computingBlock *ptr= blks.at(k);
//computingBlock *ptr= blks.at(k);
abstractSoftware *softw= blks.at(k)->getSoftware();
if( softw == NULL ) {
success= false;
......@@ -607,7 +607,7 @@ bool dataManager::parseJSONFile( string fileName )
cout << "1- ############ Liste du/des secteur(s): ############\n";
sectors_.clear();
for(int i = 0; i < cmap.size(); ++i)
for(unsigned i = 0; i < cmap.size(); ++i)
{
string key= "KEY" + mixedTools::intToString( i );
map<string, vector<json> >::iterator it= cmap.find( key );
......
......@@ -110,13 +110,13 @@ class mixedTools
static void print(const std::vector<smap>& v)
{
for(int i = 0; i < v.size(); i++) {
for(unsigned i = 0; i < v.size(); i++) {
std::cout << "v[" << i << "].size() is " << v[i].size() << '\n';
smap::const_iterator it;
for (it = v[i].begin(); it != v[i].end(); ++it) {
std::cout << "*** m[" << it->first << "] : ";
int nsz= it->second.size();
for(int k = 0; k < nsz; k++) {
unsigned nsz= it->second.size();
for(unsigned k = 0; k < nsz; k++) {
if( k < nsz-1 ) std::cout << it->second.at(k) << ", ";
else std::cout << it->second.at(k) << ";";
}
......@@ -127,10 +127,10 @@ class mixedTools
static void print(const std::vector<psvs>& v)
{
for(int i = 0; i < v.size(); i++) {
for(unsigned i = 0; i < v.size(); i++) {
std::cout << "v[" << v.at(i).first << "] : ";
int nsz= v.at(i).second.size();
for(int k = 0; k < nsz; k++) {
unsigned nsz= v.at(i).second.size();
for(unsigned k = 0; k < nsz; k++) {
std::cout << v.at(i).second.at(k) << "; ";
}
std::cout << std::endl;
......
......@@ -3,4 +3,5 @@ how to wrap C++ with Cython.
Assuming you have Python, Cython, Git and a C++ compiler installed
$ python pspaclass.py build_ext --inplace
$ python pspaplots.py build_ext --inplace
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize("pypspaplot.pyx")
)
#include <iostream>
#include <fstream>
#include <iomanip> // std::setw
#include "pspaplot.h"
#include "pspaplots.h"
// Default constructor
pspaplot::pspaplot() {}
......@@ -225,7 +226,7 @@ json pspaplot::plotSelection(json j)
if (ymap.empty()) continue;
for (auto& y: ymap) {
for(int k = 0; k < y.second.size(); ++k) {
for(unsigned k = 0; k < y.second.size(); ++k) {
Ymaps[ y.first ].push_back( y.second.at(k) );
}
}
......
from libcpp.string cimport string
cdef extern from "pspaplot.cpp":
cdef extern from "pspaplots.cpp":
pass
cdef extern from "pspaplot.h":
cdef extern from "pspaplots.h":
cdef cppclass pspaplot:
pspaplot() except +
pspaplot( string ) except +
......
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
xtension = Extension(
name="pypspaplots",
sources=["pypspaplots.pyx"],
include_dirs=["/usr/local/json/include"]
)
setup(
name="pypspaplots",
ext_modules=cythonize([xtension])
)
# distutils: language = c++
from pspaplots cimport pspaplot
from libcpp.string cimport string
cdef class PyPspaPlot:
cdef pspaplot *ptr
def __cinit__(self):
self.ptr = new pspaplot()
def __cinit__(self, string s):
self.ptr = new pspaplot( s )
def __dealloc__(self):
del self.ptr
def settings(self, string s):
return self.ptr.settings( s )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment