Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 316549 | Differences between
and this patch

Collapse All | Expand All

(-)a/.hgignore (+1 lines)
Lines 29-34 Link Here
29
^CMakeCache\.txt$
29
^CMakeCache\.txt$
30
^private$
30
^private$
31
^vigranumpy/private$
31
^vigranumpy/private$
32
^vigranumpy/lib/__version__.py$
32
CMakeFiles/
33
CMakeFiles/
33
\.cmake$
34
\.cmake$
34
35
(-)a/CMakeLists.txt (-1 / +1 lines)
Lines 1-4 Link Here
1
cmake_minimum_required(VERSION 2.6)
1
cmake_minimum_required(VERSION 2.8)
2
2
3
##################################################
3
##################################################
4
#
4
#
(-)a/docsrc/CMakeLists.txt (-2 / +5 lines)
Lines 31-38 Link Here
31
			${DOCDIR}/vigra/documents/tutorial_reference.pdf
31
			${DOCDIR}/vigra/documents/tutorial_reference.pdf
32
		COMMENT "Postprocessing html files")
32
		COMMENT "Postprocessing html files")
33
33
34
	INSTALL(DIRECTORY ${DOCDIR}/
34
	INSTALL(
35
		DESTINATION ${DOCINSTALL}/)
35
		DIRECTORY ${DOCDIR}/
36
		DESTINATION ${DOCINSTALL}/
37
		OPTIONAL
38
	)
36
39
37
ELSE()
40
ELSE()
38
	ADD_CUSTOM_TARGET (doc_cpp 
41
	ADD_CUSTOM_TARGET (doc_cpp 
(-)a/include/vigra/colorconversions.hxx (-4 / +4 lines)
Lines 832-845 Link Here
832
            The maximum value for each RGB component defaults to 255.
832
            The maximum value for each RGB component defaults to 255.
833
        */
833
        */
834
    RGBPrime2XYZFunctor()
834
    RGBPrime2XYZFunctor()
835
    : max_(component_type(255.0)), gamma_(1.0/ 0.45)
835
	: gamma_(1.0/ 0.45), max_(component_type(255.0))
836
    {}
836
    {}
837
    
837
    
838
        /** constructor
838
        /** constructor
839
            \arg max - the maximum value for each RGB component
839
            \arg max - the maximum value for each RGB component
840
        */
840
        */
841
    RGBPrime2XYZFunctor(component_type max)
841
    RGBPrime2XYZFunctor(component_type max)
842
    : max_(max), gamma_(1.0/ 0.45)
842
	: gamma_(1.0/ 0.45), max_(max)
843
    {}
843
    {}
844
    
844
    
845
        /** apply the transformation
845
        /** apply the transformation
Lines 998-1011 Link Here
998
            The maximum value for each RGB component defaults to 255.
998
            The maximum value for each RGB component defaults to 255.
999
        */
999
        */
1000
    XYZ2RGBPrimeFunctor()
1000
    XYZ2RGBPrimeFunctor()
1001
    : max_(component_type(255.0)), gamma_(0.45)
1001
	: gamma_(0.45), max_(component_type(255.0))
1002
    {}
1002
    {}
1003
    
1003
    
1004
        /** constructor
1004
        /** constructor
1005
            \arg max - the maximum value for each RGB component
1005
            \arg max - the maximum value for each RGB component
1006
        */
1006
        */
1007
    XYZ2RGBPrimeFunctor(component_type max)
1007
    XYZ2RGBPrimeFunctor(component_type max)
1008
    : max_(max), gamma_(0.45)
1008
	: gamma_(0.45), max_(max)
1009
    {}
1009
    {}
1010
    
1010
    
1011
        /** apply the transformation
1011
        /** apply the transformation
(-)a/include/vigra/numpy_array.hxx (-1 / +1 lines)
Lines 36-41 Link Here
36
#ifndef VIGRA_NUMPY_ARRAY_HXX
36
#ifndef VIGRA_NUMPY_ARRAY_HXX
37
#define VIGRA_NUMPY_ARRAY_HXX
37
#define VIGRA_NUMPY_ARRAY_HXX
38
38
39
#include <Python.h>
39
#include <iostream>
40
#include <iostream>
40
#include <algorithm>
41
#include <algorithm>
41
#include <complex>
42
#include <complex>
Lines 46-52 Link Here
46
#include <vigra/array_vector.hxx>
47
#include <vigra/array_vector.hxx>
47
#include <vigra/sized_int.hxx>
48
#include <vigra/sized_int.hxx>
48
#include <vigra/python_utility.hxx>
49
#include <vigra/python_utility.hxx>
49
#include <Python.h>
50
#include <numpy/arrayobject.h>
50
#include <numpy/arrayobject.h>
51
51
52
int _import_array();
52
int _import_array();
(-)a/include/vigra/python_utility.hxx (-1 / +1 lines)
Lines 36-43 Link Here
36
#ifndef VIGRA_PYTHON_UTILITY_HXX
36
#ifndef VIGRA_PYTHON_UTILITY_HXX
37
#define VIGRA_PYTHON_UTILITY_HXX
37
#define VIGRA_PYTHON_UTILITY_HXX
38
38
39
#include <Python.h>
39
#include <algorithm>
40
#include <algorithm>
40
#include <Python.h>
41
#include "vigra/error.hxx"
41
#include "vigra/error.hxx"
42
#include "vigra/tinyvector.hxx"
42
#include "vigra/tinyvector.hxx"
43
43
(-)a/vigranumpy/src/core/CMakeLists.txt (+4 lines)
Lines 1-3 Link Here
1
IF(HDF5_FOUND)
2
  ADD_DEFINITIONS(-DHasHDF5 ${HDF5_CPPFLAGS})
3
  INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIR})
4
ENDIF(HDF5_FOUND)
1
5
2
# note special treatment of target vigranumpy_core: 
6
# note special treatment of target vigranumpy_core: 
3
# module name is automatically changed into vigranumpycore
7
# module name is automatically changed into vigranumpycore
(-)a/vigranumpy/src/core/impex.cxx (-3 / +3 lines)
Lines 36-49 Link Here
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpyimpex_PyArray_API
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpyimpex_PyArray_API
37
//#define NO_IMPORT_ARRAY
37
//#define NO_IMPORT_ARRAY
38
38
39
#include <iostream>
40
#include <cstring>
41
#include <cstdio>
42
#include "vigra/numpy_array.hxx"
39
#include "vigra/numpy_array.hxx"
43
#include "vigra/impex.hxx"
40
#include "vigra/impex.hxx"
44
#include "vigra/multi_impex.hxx"
41
#include "vigra/multi_impex.hxx"
45
#include <vigra/numpy_array_converters.hxx>
42
#include <vigra/numpy_array_converters.hxx>
46
#include "vigra/hdf5impex.hxx"
43
#include "vigra/hdf5impex.hxx"
44
#include <iostream>
45
#include <cstring>
46
#include <cstdio>
47
47
48
namespace python = boost::python;
48
namespace python = boost::python;
49
49
(-)a/vigranumpy/src/core/kernel.cxx (-1 / +1 lines)
Lines 36-43 Link Here
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpyfilters_PyArray_API
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpyfilters_PyArray_API
37
#define NO_IMPORT_ARRAY
37
#define NO_IMPORT_ARRAY
38
38
39
#include <Python.h>
39
#include <iostream>
40
#include <iostream>
40
#include <Python.h>
41
#include <boost/python.hpp>
41
#include <boost/python.hpp>
42
#include <vigra/numpy_array.hxx>
42
#include <vigra/numpy_array.hxx>
43
#include <vigra/numpy_array_converters.hxx>
43
#include <vigra/numpy_array_converters.hxx>
(-)a/vigranumpy/src/core/random_forest.cxx (-1 / +9 lines)
Lines 39-45 Link Here
39
#include <vigra/numpy_array.hxx>
39
#include <vigra/numpy_array.hxx>
40
#include <vigra/numpy_array_converters.hxx>
40
#include <vigra/numpy_array_converters.hxx>
41
#include <vigra/random_forest.hxx>
41
#include <vigra/random_forest.hxx>
42
#ifdef HasHDF5
42
#include <vigra/random_forest_hdf5_impex.hxx>
43
#include <vigra/random_forest_hdf5_impex.hxx>
44
#endif
43
#include <set>
45
#include <set>
44
#include <cmath>
46
#include <cmath>
45
#include <memory>
47
#include <memory>
Lines 85-90 Link Here
85
    return rf;
87
    return rf;
86
}
88
}
87
89
90
#ifdef HasHDF5
88
template<class LabelType>
91
template<class LabelType>
89
RandomForest<LabelType> * 
92
RandomForest<LabelType> * 
90
pythonImportRandomForestFromHDF5(std::string filename, 
93
pythonImportRandomForestFromHDF5(std::string filename, 
Lines 96-102 Link Here
96
           "RandomForest(): Unable to load from HDF5 file.");
99
           "RandomForest(): Unable to load from HDF5 file.");
97
           
100
           
98
    return rf.release();
101
    return rf.release();
99
}					
102
}
103
#endif
100
104
101
template<class LabelType, class FeatureType>
105
template<class LabelType, class FeatureType>
102
python::tuple
106
python::tuple
Lines 248-259 Link Here
248
             "'treeCount' controls the number of trees that are created.\n\n"
252
             "'treeCount' controls the number of trees that are created.\n\n"
249
             "See RandomForest_ and RandomForestOptions_ in the C++ documentation "
253
             "See RandomForest_ and RandomForestOptions_ in the C++ documentation "
250
             "for the meaning of the other parameters.\n")
254
             "for the meaning of the other parameters.\n")
255
#ifdef HasHDF5
251
        .def("__init__",python::make_constructor(&pythonImportRandomForestFromHDF5<UInt32>,
256
        .def("__init__",python::make_constructor(&pythonImportRandomForestFromHDF5<UInt32>,
252
                                                 boost::python::default_call_policies(),
257
                                                 boost::python::default_call_policies(),
253
                                                 ( arg("filename"),
258
                                                 ( arg("filename"),
254
                                                   arg("pathInFile")="")),
259
                                                   arg("pathInFile")="")),
255
             "Load from HDF5 file::\n\n"
260
             "Load from HDF5 file::\n\n"
256
             "  RandomForest(filename, pathInFile)\n\n")
261
             "  RandomForest(filename, pathInFile)\n\n")
262
#endif
257
        .def("featureCount",
263
        .def("featureCount",
258
            &RandomForest<UInt32>::column_count,
264
            &RandomForest<UInt32>::column_count,
259
             "Returns the number of features the RandomForest works with.\n")
265
             "Returns the number of features the RandomForest works with.\n")
Lines 299-309 Link Here
299
             "Learn online.\n\n"
305
             "Learn online.\n\n"
300
             "Works only if forest has been created with prepare_online_learning=true. "
306
             "Works only if forest has been created with prepare_online_learning=true. "
301
             "Needs the old training data and the new appened, starting at startIndex.\n\n")
307
             "Needs the old training data and the new appened, starting at startIndex.\n\n")
308
#ifdef HasHDF5
302
        .def("writeHDF5", &rf_export_HDF5<UInt32>,
309
        .def("writeHDF5", &rf_export_HDF5<UInt32>,
303
             (arg("filename"), arg("pathInFile")="", arg("overwriteflag")=false),
310
             (arg("filename"), arg("pathInFile")="", arg("overwriteflag")=false),
304
             "Store the random forest in the given HDF5 file 'filname' under the internal\n"
311
             "Store the random forest in the given HDF5 file 'filname' under the internal\n"
305
             "path 'pathInFile'. If a dataset already exists, 'overwriteflag' determines\n"
312
             "path 'pathInFile'. If a dataset already exists, 'overwriteflag' determines\n"
306
             "if the old data are overwritten.\n")
313
             "if the old data are overwritten.\n")
314
#endif
307
        ;
315
        ;
308
}
316
}
309
317
(-)a/vigranumpy/src/core/vigranumpycore.cxx (-1 / +1 lines)
Lines 35-42 Link Here
35
35
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpycore_PyArray_API
36
#define PY_ARRAY_UNIQUE_SYMBOL vigranumpycore_PyArray_API
37
37
38
#include <Python.h>
38
#include <iostream>
39
#include <iostream>
39
#include <Python.h>
40
#include <boost/python.hpp>
40
#include <boost/python.hpp>
41
#include <vigra/numpy_array.hxx>
41
#include <vigra/numpy_array.hxx>
42
#include <vigra/numpy_array_converters.hxx>
42
#include <vigra/numpy_array_converters.hxx>

Return to bug 316549