Typedefs | Functions | Variables
num_util Namespace Reference

Typedefs

typedef std::map
< PyArray_TYPES, char > 
KindCharMap
 Mapping from a PyArray_TYPE to its corresponding typeID in char. More...
 
typedef KindCharMap::value_type KindCharMapEntry
 
typedef std::map
< PyArray_TYPES, std::string > 
KindStringMap
 Mapping from a PyArray_TYPE to its corresponding name in string. More...
 
typedef KindStringMap::value_type KindStringMapEntry
 
typedef std::map< char,
PyArray_TYPES > 
KindTypeMap
 Mapping from a typeID to its corresponding PyArray_TYPE. More...
 
typedef KindTypeMap::value_type KindTypeMapEntry
 

Functions

numeric::array astype (boost::python::numeric::array arr, PyArray_TYPES t)
 Returns a clone of this array with a new type. More...
 
PyArray_TYPES char2type (char e_type)
 Coverts a single character typecode to its PyArray_TYPES. More...
 
void check_contiguous (boost::python::numeric::array arr)
 Throws an exception if the array is not contiguous. More...
 
void check_contiguous (numeric::array arr)
 
void check_dim (boost::python::numeric::array arr, int dimnum, intp dimsize)
 Throws an exception if a specific dimension from a numpy array does not match the expected size. More...
 
void check_PyArrayElementType (boost::python::object newo)
 Throws an exception if the element of a numpy array is type cast to PyArray_OBJECT. More...
 
void check_PyArrayElementType (object newo)
 
void check_rank (boost::python::numeric::array arr, int expected_rank)
 Throws an exception if the actual rank is not equal to the expected rank. More...
 
void check_shape (boost::python::numeric::array arr, std::vector< intp > expected_dims)
 Throws an exception if the actual dimensions of the array are not equal to the expected dimensions. More...
 
void check_shape (boost::python::numeric::array arr, std::vector< intptr_t > expected_dims)
 
void check_size (boost::python::numeric::array arr, intp expected_size)
 Throw an exception if the actual total size of the array is not equal to the expected size. More...
 
void check_size_match (std::vector< intp > dims, intp n)
 Throws an exception if the total size computed from a vector of integer does not match with the expected size. More...
 
void check_type (boost::python::numeric::array arr, PyArray_TYPES expected_type)
 Throws an exception if the actual array type is not equal to the expected type. More...
 
boost::python::numeric::array clone (boost::python::numeric::array arr)
 Returns a clone of this array. More...
 
numeric::array clone (numeric::array arr)
 
void copy_data (boost::python::numeric::array arr, char *new_data)
 Copies data into the array. More...
 
void * data (boost::python::numeric::array arr)
 Returns a pointer to the data in the array. More...
 
void * data (numeric::array arr)
 
intp get_dim (boost::python::numeric::array arr, int dimnum)
 Returns the size of a specific dimension. More...
 
template<typename T >
PyArray_TYPES getEnum ()
 Function template returns PyArray_Type for C++ type See num_util.cpp for specializations. More...
 
template<>
PyArray_TYPES getEnum< double > (void)
 
template<>
PyArray_TYPES getEnum< float > (void)
 
template<>
PyArray_TYPES getEnum< int > (void)
 
template<>
PyArray_TYPES getEnum< long > (void)
 
template<>
PyArray_TYPES getEnum< short > (void)
 
template<>
PyArray_TYPES getEnum< signed char > (void)
 
template<>
PyArray_TYPES getEnum< std::complex< double > > (void)
 
template<>
PyArray_TYPES getEnum< std::complex< float > > (void)
 
template<>
PyArray_TYPES getEnum< unsigned char > (void)
 
template<>
PyArray_TYPES getEnum< unsigned int > (void)
 
template<>
PyArray_TYPES getEnum< unsigned short > (void)
 
bool iscontiguous (boost::python::numeric::array arr)
 Returns true if the array is contiguous. More...
 
bool iscontiguous (numeric::array arr)
 
static KindCharMap kindchars (kindCharMapEntries, kindCharMapEntries+numCharEntries)
 
static KindStringMap kindstrings (kindStringMapEntries, kindStringMapEntries+numStringEntries)
 
static KindTypeMap kindtypes (kindTypeMapEntries, kindTypeMapEntries+numTypeEntries)
 
boost::python::numeric::array makeNum (boost::python::object x)
 A free function that extracts a PyArrayObject from any sequential PyObject. More...
 
template<typename T >
boost::python::numeric::array makeNum (T *data, int n=0)
 Function template creates a one-dimensional numpy array of length n containing a copy of data at data*. More...
 
template<typename T >
boost::python::numeric::array makeNum (T *data, std::vector< int > dims)
 Function template creates an n-dimensional numpy array with dimensions dimens containing a copy of values starting at data. More...
 
boost::python::numeric::array makeNum (const boost::python::numeric::array &arr)
 Creates a numpy array from a numpy array, referencing the data. More...
 
numeric::array makeNum (object x)
 
numeric::array makeNum (intp n, PyArray_TYPES t)
 Creates an one-dimensional numpy array of length n and numpy type t. More...
 
numeric::array makeNum (std::vector< int > dimens, PyArray_TYPES t)
 Creates a n-dimensional numpy array with dimensions dimens and numpy type t. More...
 
numeric::array makeNum (const numeric::array &arr)
 
template<>
boost::python::numeric::array makeNum< double > (double *data, std::vector< int > dims)
 
int rank (boost::python::numeric::array arr)
 A free function that retrieves the number of dimensions of a numpy array. More...
 
int rank (numeric::array arr)
 
int refcount (boost::python::numeric::array arr)
 
int refcount (numeric::array arr)
 
std::vector< intptr_t > shape (boost::python::numeric::array arr)
 Returns the dimensions in a vector. More...
 
std::vector< intptr_t > shape (numeric::array arr)
 
intp size (boost::python::numeric::array arr)
 A free function that returns the total size of the array. More...
 
intp size (numeric::array arr)
 
std::vector< intpstrides (boost::python::numeric::array arr)
 Returns the strides array in a vector of integer. More...
 
std::vector< intpstrides (numeric::array arr)
 
PyArray_TYPES type (boost::python::numeric::array arr)
 A free function that retrieves the numpy type of a numpy array. More...
 
PyArray_TYPES type (numeric::array arr)
 
char type2char (PyArray_TYPES t_type)
 Converts a PyArray_TYPE to its single character typecode. More...
 
std::string type2string (PyArray_TYPES t_type)
 Converts a PyArray_TYPE to its name in string. More...
 
template<class T >
std::string vector_str (const std::vector< T > &vec)
 Constructs a string which contains a list of elements extracted from the input vector. More...
 

Variables

KindCharMapEntry kindCharMapEntries []
 
KindStringMapEntry kindStringMapEntries []
 
KindTypeMapEntry kindTypeMapEntries []
 
int numCharEntries = sizeof(kindCharMapEntries)/sizeof(KindCharMapEntry)
 
int numStringEntries = sizeof(kindStringMapEntries)/sizeof(KindStringMapEntry)
 
int numTypeEntries = sizeof(kindTypeMapEntries)/sizeof(KindTypeMapEntry)
 

Typedef Documentation

typedef std::map<PyArray_TYPES, char> KindCharMap

Mapping from a PyArray_TYPE to its corresponding typeID in char.

Definition at line 315 of file num_util.h.

typedef KindCharMap::value_type KindCharMapEntry

Definition at line 163 of file num_util.cpp.

typedef std::map<PyArray_TYPES, std::string> KindStringMap

Mapping from a PyArray_TYPE to its corresponding name in string.

Definition at line 310 of file num_util.h.

typedef KindStringMap::value_type KindStringMapEntry

Definition at line 142 of file num_util.cpp.

typedef std::map<char, PyArray_TYPES> KindTypeMap

Mapping from a typeID to its corresponding PyArray_TYPE.

Definition at line 320 of file num_util.h.

typedef KindTypeMap::value_type KindTypeMapEntry

Definition at line 182 of file num_util.cpp.

Function Documentation

boost::python::numeric::array astype ( boost::python::numeric::array  arr,
PyArray_TYPES  t 
)

Returns a clone of this array with a new type.

Parameters
arra Boost/Python numeric array.
tPyArray_TYPES of the output array.
Returns
a replicate of 'arr' with type set to 't'.

Definition at line 423 of file num_util.cpp.

References type2char().

PyArray_TYPES char2type ( char  e_type)

Coverts a single character typecode to its PyArray_TYPES.

Parameters
e_typea PyArray_TYPES typecode in char.
Returns
its corresponding PyArray_TYPES.

Definition at line 475 of file num_util.cpp.

References kindtypes().

Referenced by type().

void num_util::check_contiguous ( boost::python::numeric::array  arr)

Throws an exception if the array is not contiguous.

Parameters
arra Boost/Python numeric array.
Returns
--—
void num_util::check_contiguous ( numeric::array  arr)

Definition at line 380 of file num_util.cpp.

References iscontiguous().

void check_dim ( boost::python::numeric::array  arr,
int  dimnum,
intp  dimsize 
)

Throws an exception if a specific dimension from a numpy array does not match the expected size.

Parameters
arra Boost/Python numeric array.
dimnuman integer that specifies which dimension of 'arr' to check.
dimsizean expected size of the specified dimension.
Returns
--—

Definition at line 361 of file num_util.cpp.

References shape().

void num_util::check_PyArrayElementType ( boost::python::object  newo)

Throws an exception if the element of a numpy array is type cast to PyArray_OBJECT.

Parameters
newoa Boost/Python object.
Returns
--—
void num_util::check_PyArrayElementType ( object  newo)

Definition at line 449 of file num_util.cpp.

Referenced by makeNum().

void check_rank ( boost::python::numeric::array  arr,
int  expected_rank 
)

Throws an exception if the actual rank is not equal to the expected rank.

Parameters
arra Boost/Python numeric array.
expected_rankan expected rank of the numeric array.
Returns
--—

Definition at line 284 of file num_util.cpp.

References rank().

void num_util::check_shape ( boost::python::numeric::array  arr,
std::vector< intp expected_dims 
)

Throws an exception if the actual dimensions of the array are not equal to the expected dimensions.

Parameters
arra Boost/Python numeric array.
expected_dimsan integer vector of expected dimension.
Returns
--—
void num_util::check_shape ( boost::python::numeric::array  arr,
std::vector< intptr_t >  expected_dims 
)

Definition at line 349 of file num_util.cpp.

References shape(), and vector_str().

void check_size ( boost::python::numeric::array  arr,
intp  expected_size 
)

Throw an exception if the actual total size of the array is not equal to the expected size.

Parameters
arra Boost/Python numeric array.
expected_sizethe expected size of an array.
Returns
--—

Definition at line 305 of file num_util.cpp.

References size().

Referenced by from_python_sequence< ContainerType, ConversionPolicy >::convertible().

void check_size_match ( std::vector< intp dims,
intp  n 
)
inline

Throws an exception if the total size computed from a vector of integer does not match with the expected size.

Parameters
dimsan integer vector of dimensions.
nan expected size.
Returns
--—

Definition at line 492 of file num_util.cpp.

void check_type ( boost::python::numeric::array  arr,
PyArray_TYPES  expected_type 
)

Throws an exception if the actual array type is not equal to the expected type.

Parameters
arra Boost/Python numeric array.
expected_typean expected numpy type.
Returns
--—

Definition at line 257 of file num_util.cpp.

References kindstrings(), and type().

boost::python::numeric::array num_util::clone ( boost::python::numeric::array  arr)

Returns a clone of this array.

Parameters
arra Boost/Python numeric array.
Returns
a replicate of the Boost/Python numeric array.
numeric::array num_util::clone ( numeric::array  arr)

Definition at line 412 of file num_util.cpp.

References makeNum().

void copy_data ( boost::python::numeric::array  arr,
char *  new_data 
)

Copies data into the array.

Parameters
arra Boost/Python numeric array.
new_dataa char pointer referencing the new data.
Returns
--—

Definition at line 402 of file num_util.cpp.

References data(), and i.

void* num_util::data ( boost::python::numeric::array  arr)

Returns a pointer to the data in the array.

Parameters
arra Boost/Python numeric array.
Returns
a char pointer pointing at the first element of the array.
void* num_util::data ( numeric::array  arr)
intp get_dim ( boost::python::numeric::array  arr,
int  dimnum 
)

Returns the size of a specific dimension.

Parameters
arra Boost/Python numeric array.
dimnuman integer that identifies the dimension to retrieve.
Returns
the size of the requested dimension.

Definition at line 335 of file num_util.cpp.

References rank(), and shape().

Referenced by NumArrayTuple::addColumn(), and NumArrayTuple::rows().

PyArray_TYPES num_util::getEnum ( )

Function template returns PyArray_Type for C++ type See num_util.cpp for specializations.

Parameters
TC++ type
Returns
numpy type enum
PyArray_TYPES num_util::getEnum< double > ( void  )

Definition at line 94 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< float > ( void  )

Definition at line 88 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< int > ( void  )

Definition at line 56 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< long > ( void  )

Definition at line 62 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< short > ( void  )

Definition at line 37 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< signed char > ( void  )

Definition at line 27 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< std::complex< double > > ( void  )

Definition at line 114 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< std::complex< float > > ( void  )

Definition at line 107 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< unsigned char > ( void  )

Definition at line 20 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< unsigned int > ( void  )

Definition at line 50 of file num_util.cpp.

PyArray_TYPES num_util::getEnum< unsigned short > ( void  )

Definition at line 43 of file num_util.cpp.

bool num_util::iscontiguous ( boost::python::numeric::array  arr)

Returns true if the array is contiguous.

Parameters
arra Boost/Python numeric array.
Returns
true if the array is contiguous, false otherwise.
bool num_util::iscontiguous ( numeric::array  arr)

Definition at line 374 of file num_util.cpp.

Referenced by check_contiguous(), and PyDataSource::extractVector().

static KindCharMap num_util::kindchars ( kindCharMapEntries  ,
kindCharMapEntries+  numCharEntries 
)
static

Referenced by type2char().

static KindStringMap num_util::kindstrings ( kindStringMapEntries  ,
kindStringMapEntries+  numStringEntries 
)
static

Referenced by check_type(), and type2string().

static KindTypeMap num_util::kindtypes ( kindTypeMapEntries  ,
kindTypeMapEntries+  numTypeEntries 
)
static

Referenced by char2type().

boost::python::numeric::array num_util::makeNum ( boost::python::object  x)

A free function that extracts a PyArrayObject from any sequential PyObject.

Parameters
xa sequential PyObject wrapped in a Boost/Python 'object'.
Returns
a PyArrayObject wrapped in Boost/Python numeric array.
boost::python::numeric::array num_util::makeNum ( T *  data,
int  n = 0 
)

Function template creates a one-dimensional numpy array of length n containing a copy of data at data*.

See num_util.cpp::getEnum<T>() for list of specializations

Parameters
TC type of data
T*data pointer to start of data
nan integer indicates the size of the array.
Returns
a numpy array of size n with elements initialized to data.

Definition at line 107 of file num_util.h.

References hippodraw::Axes::T.

boost::python::numeric::array num_util::makeNum ( T *  data,
std::vector< int >  dims 
)

Function template creates an n-dimensional numpy array with dimensions dimens containing a copy of values starting at data.

See num_util.cpp::getEnum<T>() for list of specializations

Parameters
TC type of data
T*data pointer to start of data
nan integer indicates the size of the array.
Returns
a numpy array of size n with elements initialized to data.

Definition at line 131 of file num_util.h.

References hippodraw::Axes::T.

boost::python::numeric::array num_util::makeNum ( const boost::python::numeric::array &  arr)

Creates a numpy array from a numpy array, referencing the data.

Parameters
arra Boost/Python numeric array.
Returns
a numeric array referencing the input array.
numeric::array num_util::makeNum ( object  x)
boost::python::numeric::array makeNum ( intp  n,
PyArray_TYPES  t 
)

Creates an one-dimensional numpy array of length n and numpy type t.

The elements of the array are initialized to zero.

Parameters
nan integer representing the length of the array.
telements' numpy type. Default is double.
Returns
a numeric array of size n with elements initialized to zero.

Definition at line 231 of file num_util.cpp.

boost::python::numeric::array makeNum ( std::vector< int >  dimens,
PyArray_TYPES  t 
)

Creates a n-dimensional numpy array with dimensions dimens and numpy type t.

The elements of the array are initialized to zero.

Parameters
dimensa vector of interger specifies the dimensions of the array.
telements' numpy type. Default is double.
Returns
a numeric array of shape dimens with elements initialized to zero.

Definition at line 237 of file num_util.cpp.

numeric::array num_util::makeNum ( const numeric::array &  arr)

Definition at line 243 of file num_util.cpp.

boost::python::numeric::array makeNum< double > ( double *  data,
std::vector< int >  dims 
)

Definition at line 127 of file num_util.cpp.

References data().

int num_util::rank ( boost::python::numeric::array  arr)

A free function that retrieves the number of dimensions of a numpy array.

Parameters
arra Boost/Python numeric array.
Returns
an integer that indicates the rank of an array.
int num_util::rank ( numeric::array  arr)
int num_util::refcount ( boost::python::numeric::array  arr)
int num_util::refcount ( numeric::array  arr)

Definition at line 445 of file num_util.cpp.

std::vector<intptr_t> num_util::shape ( boost::python::numeric::array  arr)

Returns the dimensions in a vector.

Parameters
arra Boost/Python numeric array.
Returns
a vector with integer values that indicates the shape of the array.
std::vector<intptr_t> num_util::shape ( numeric::array  arr)
intp num_util::size ( boost::python::numeric::array  arr)

A free function that returns the total size of the array.

Parameters
arra Boost/Python numeric array.
Returns
an integer that indicates the total size of the array.
intp num_util::size ( numeric::array  arr)

Definition at line 296 of file num_util.cpp.

Referenced by NTupleProjector::acceptRow(), NTuple::addColumn(), CutController::addCut(), CutController::addCuts(), NTuple::addRow(), QtCut::addTargets(), CompositeFunctionRep::addToComposite(), EqualEntriesHist1DProjector::adjustNumberOfBins(), AxisModelBase::adjustTicks(), DataSource::append(), PyDataRep::applyCuts(), QtDisplay::applyCuts(), Inspector::availPlotTypesActivated(), MinuitMigrad::calcCovariance(), check_size(), XyPlotter::checkAutoScale(), MinuitMigrad::checkIndex(), Inspector::clear(), CanvasView::contentsMouseMoveEvent(), RTuple::copy(), NTuple::copy(), PyDataSource::copy_direct(), RootNTuple::createBinding(), AxisModelXML::createChildren(), NTupleXML::createChildren2D(), DisplayController::createDifferenceDisplay(), FunctionProjectorXML::createElement(), NTupleProjectorXML::createElement(), BinToColorXML::createElement(), NTupleProjector::createEmptyNTuple(), Bins2DHist::createNTuple(), Bins2DProfile::createNTuple(), Map2Projector::createNTuple(), MeshProjector::createNTuple(), Bins1DProfile::createNTuple(), FitsController::createNTuple(), Bins1DHist::createNTuple(), NTupleController::createNTuple(), FunctionController::createNTuple(), DisplayController::createNTupleDiff(), NTupleController::createNTupleToFile(), PointRepXML::createObject(), QtViewImp::createPen(), CompositePlotter::createPickTuple(), Inspector::cutAddAll(), NTupleProjector::dataRangeWithError(), Inspector::deleteColorModel(), EpsView::draw_Text(), DrawBorder::drawKnob(), QtViewImp::drawMethod(), QtViewImp::drawPolygon(), CompositePlotter::drawProjValues(), QtViewImp::drawViewMethod(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), AxisRepBase::drawYTickLabels(), AxisRepBase::drawYTickLines(), AxisRepColor::drawZTickLabels(), AxisRepColor::drawZTickLines(), FunctionController::ellipse(), ProfileProjector::execute(), DyHist1DProjector::execute(), Profile2DProjector::execute(), DyHist2DProjector::execute(), RootNTuple::expandIfNeeded(), PyDataSource::extractVector(), CutController::fillAcceptedRows(), CompositePlotter::fillCutList(), RootNTuple::fillDataCache(), StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), Inspector::fillFunctionParameters(), QtXmlElement::fillNodeList(), NTupleProjector::fillNTuple(), StripChartProjector::fillProjectedValues(), Map2Projector::fillProjectedValues(), Map3Projector::fillProjectedValues(), MeshProjector::fillProjectedValues(), Map1Projector::fillProjectedValues(), EqualEntriesHist1DProjector::fillProjectedValues(), DataSource::fillRange(), RootNTuple::fillShape(), FunctionController::fillTopLevelFunctionReps(), Inspector::findCutIndex(), XyPlotter::getAspectRatio(), DyHist1DProjector::getAverage(), Map1Projector::getAverage(), MapMatrixProjector::getAverage(), NTupleProjector::getAverage(), Inspector::getAxes(), NTupleProjector::getAxisBindings(), NTuple::getColumn(), DataSource::getColumn(), QtRootNTuple::getColumnAsArray(), DataSourceController::getDataSources(), RootController::getNTupleNames(), NumArrayTuple::getNumArray(), StatedFCN::getNumberFreeParms(), NTupleProjector::getNumberOfEntries(), NTupleXML::getObject(), Fitter::getParameterIndex(), NTupleProjector::getPos(), NTupleProjector::getPosWithError(), ListTuple::getRow(), NumArrayTuple::getRow(), RootNTuple::getRow(), CanvasView::getSelectedPlotters(), ListTuple::getSize(), CompositePlotter::getTarget(), DisplayController::getValueTransformIndex(), Map3Projector::getZValue(), MeshProjector::getZValue(), MapMatrixProjector::getZValue(), CompositePlotter::indexOf(), DataSourceController::indexOfDataSource(), DataSource::indexOfMaxElement(), DataSource::indexOfMinElement(), Inspector::init(), MinuitMigrad::initialize(), LogParabola::initialParameters(), Gaussian::initialParameters(), FigureEditor::initPrinter(), NTupleProjector::inRange(), CanvasView::invalidImageFormatError(), ListTuple::isAcceptable(), DataSource::isValidColumn(), Inspector::loadAllUserModels(), WindowController::moveInspector(), WindowController::newWindow(), NTuple::NTuple(), Inspector::ntupleChanged(), NTuplePearsonFCN::objectiveValue(), WindowController::openAssistant(), RTuple::operator[](), NTuple::operator[](), PickTable::PickTable(), WindowController::positionInspector(), XyPlotter::prepareToDraw(), QtDisplay::QtDisplay(), NTupleController::readAsciiNTuple(), PickTable::refreshItems(), FunctionController::removeFunction(), ListTuple::replaceColumn(), NumArrayTuple::replaceColumn(), RootNTuple::replaceColumn(), NTuple::replaceColumn(), CanvasWindow::resetFontSize(), WindowController::resizeCanvas(), ListTuple::rows(), NumArrayTuple::rows(), NTuple::rows(), RTuple::RTuple(), PyCanvas::saveAs(), CanvasView::saveAs(), NTupleController::saveNTuples(), FunctionProjectorXML::setAttributes(), FontXML::setAttributes(), CutPlotter::setAxisBinding(), DataRepController::setAxisBindings(), NTupleProjector::setAxisBindings(), Bins1DHist::setBinContents(), CutPlotter::setCuts(), NTupleFCN::setDataSource(), CompositeFunctionRep::setFixedFlags(), StatedFCN::setFreeParameters(), MapMatrixProjector::setNTuple(), FunctionProjector::setPrincipleErrors(), PlotterBase::setTicks(), PlotterBase::setTicksOnX(), AxisRepBase::setYFontSize(), DataSource::sum(), Inspector::symbolPointSize_returnPressed(), DataSource::throwIfInvalidRowSize(), Inspector::titleText_returnPressed(), CanvasView::toLower(), PeriodicBinaryTransform::transform(), QtViewWidget::transformAndFill(), QtView::transformAndFill(), QtViewImp::transformAndFill(), DataSourceController::unregisterNTuple(), Inspector::updateColorMapCtrls(), Inspector::updateCutControls(), Inspector::updatePlotTypes(), Inspector::updateSelectedPlotDataSource(), Inspector::updateTupleCuts(), Inspector::updateValueCombo(), ListTuple::valueAt(), NumArrayTuple::valueAt(), FitsFile::writeHDU(), and FitsController::writeNTupleToFile().

std::vector<intp> num_util::strides ( boost::python::numeric::array  arr)

Returns the strides array in a vector of integer.

Parameters
arra Boost/Python numeric array.
Returns
the strides of an array.
std::vector<intp> num_util::strides ( numeric::array  arr)

Definition at line 427 of file num_util.cpp.

References i, and rank().

PyArray_TYPES num_util::type ( boost::python::numeric::array  arr)

A free function that retrieves the numpy type of a numpy array.

Parameters
arra Boost/Python numeric array.
Returns
the numpy type of the array's elements
PyArray_TYPES num_util::type ( numeric::array  arr)
char type2char ( PyArray_TYPES  t_type)

Converts a PyArray_TYPE to its single character typecode.

Parameters
t_typea PyArray_TYPES.
Returns
the corresponding typecode in char.

Definition at line 471 of file num_util.cpp.

References kindchars().

Referenced by astype().

std::string type2string ( PyArray_TYPES  t_type)

Converts a PyArray_TYPE to its name in string.

Parameters
t_typea PyArray_TYPES.
Returns
the corresponding name in string.

Definition at line 467 of file num_util.cpp.

References kindstrings().

Referenced by PyDataSource::extractVector().

std::string vector_str ( const std::vector< T > &  vec)
inline

Constructs a string which contains a list of elements extracted from the input vector.

Parameters
veca vector of any type.
Returns
a string that lists the elements from the input vector.

Definition at line 480 of file num_util.cpp.

References i.

Referenced by check_shape().

Variable Documentation

KindCharMapEntry kindCharMapEntries[]
Initial value:
=
{
KindCharMapEntry(PyArray_UBYTE, 'B'),
KindCharMapEntry(PyArray_SBYTE, 'b'),
KindCharMapEntry(PyArray_SHORT, 'h'),
KindCharMapEntry(PyArray_INT, 'i'),
KindCharMapEntry(PyArray_LONG, 'l'),
KindCharMapEntry(PyArray_FLOAT, 'f'),
KindCharMapEntry(PyArray_DOUBLE, 'd'),
KindCharMapEntry(PyArray_CFLOAT, 'F'),
KindCharMapEntry(PyArray_CDOUBLE,'D'),
}
KindCharMap::value_type KindCharMapEntry
Definition: num_util.cpp:163

Definition at line 164 of file num_util.cpp.

KindStringMapEntry kindStringMapEntries[]
Initial value:
=
{
KindStringMapEntry(PyArray_UBYTE, "PyArray_UBYTE"),
KindStringMapEntry(PyArray_SBYTE, "PyArray_SBYTE"),
KindStringMapEntry(PyArray_SHORT, "PyArray_SHORT"),
KindStringMapEntry(PyArray_INT, "PyArray_INT"),
KindStringMapEntry(PyArray_LONG, "PyArray_LONG"),
KindStringMapEntry(PyArray_FLOAT, "PyArray_FLOAT"),
KindStringMapEntry(PyArray_DOUBLE, "PyArray_DOUBLE"),
KindStringMapEntry(PyArray_CFLOAT, "PyArray_CFLOAT"),
KindStringMapEntry(PyArray_CDOUBLE,"PyArray_CDOUBLE"),
KindStringMapEntry(PyArray_OBJECT, "PyArray_OBJECT"),
KindStringMapEntry(PyArray_NTYPES, "PyArray_NTYPES"),
}
KindStringMap::value_type KindStringMapEntry
Definition: num_util.cpp:142

Definition at line 143 of file num_util.cpp.

KindTypeMapEntry kindTypeMapEntries[]
Initial value:
=
{
KindTypeMapEntry('B',PyArray_UBYTE),
KindTypeMapEntry('b',PyArray_SBYTE),
KindTypeMapEntry('h',PyArray_SHORT),
KindTypeMapEntry('i',PyArray_INT),
KindTypeMapEntry('l',PyArray_LONG),
KindTypeMapEntry('f',PyArray_FLOAT),
KindTypeMapEntry('d',PyArray_DOUBLE),
KindTypeMapEntry('F',PyArray_CFLOAT),
KindTypeMapEntry('D',PyArray_CDOUBLE),
}
KindTypeMap::value_type KindTypeMapEntry
Definition: num_util.cpp:182

Definition at line 183 of file num_util.cpp.

int numCharEntries = sizeof(kindCharMapEntries)/sizeof(KindCharMapEntry)

Definition at line 203 of file num_util.cpp.

int numStringEntries = sizeof(kindStringMapEntries)/sizeof(KindStringMapEntry)

Definition at line 202 of file num_util.cpp.

int numTypeEntries = sizeof(kindTypeMapEntries)/sizeof(KindTypeMapEntry)

Definition at line 204 of file num_util.cpp.


Generated for HippoDraw Class Library by doxygen