Skip to content

Commit

Permalink
Fix some int -> npy_intp forgotten in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Bell committed Feb 11, 2009
1 parent 4af21db commit 443ceeb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion brad/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#! /bin/bash
if [ "$1" != "omhelp" ] && [ "$1" != "sdist" ] && [ "$1" != "all" ]
if [ "$1" != "omhelp" ] && \
[ "$1" != "sdist" ] && \
[ "$1" != "all" ] && \
[ "$1" != "final" ]
then
echo "build.sh option, where option is one of the following"
echo "omhelp: stop when the help is done"
echo "sdist: stop when the done building the source distribution"
echo "all: go all the way"
echo "final: go all the way and include download of cppad"
exit 1
fi
option="$1"
Expand All @@ -15,6 +19,10 @@ yyyymmdd=`date +%G%m%d` # todays year, month, and day
# Note for Sebastian: this choice forces cppad to be dowloanded each time.
# I like to use $HOME/install to speed up testing.
cppad_parent_dir="$HOME/install" # directory for cppad tarball etc
if [ "$option" == "final" ]
then
cppad_parent_dir="."
fi
# ---------------------------------------------------------------------
omhelp_location=`which omhelp`
if [ "$omhelp_location" = "" ]
Expand Down
8 changes: 4 additions & 4 deletions brad/pycppad/vec2array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ array vec2array(double_vec& vec)
}
array vec2array(AD_double_vec& vec)
{
int n = static_cast<int>( vec.size() );
npy_intp n = static_cast<npy_intp>( vec.size() );
PYCPPAD_ASSERT( n >= 0 , "");

object obj(handle<>( PyArray_FromDims(1, &n, PyArray_OBJECT) ));
object obj(handle<>( PyArray_SimpleNew(1, &n, PyArray_OBJECT) ));
for(size_t i = 0; i < vec.size(); i++){
obj[i] = vec[i];
}
return static_cast<array>( obj );
}
array vec2array(AD_AD_double_vec& vec)
{ int n = static_cast<int>( vec.size() );
{ npy_intp n = static_cast<npy_intp>( vec.size() );
PYCPPAD_ASSERT( n >= 0 , "");

object obj(handle<>( PyArray_FromDims(1, &n, PyArray_OBJECT) ));
object obj(handle<>( PyArray_SimpleNew(1, &n, PyArray_OBJECT) ));
for(size_t i = 0; i < vec.size(); i++){
obj[i] = vec[i];
}
Expand Down

0 comments on commit 443ceeb

Please sign in to comment.