Closed NAThompson closed 4 years ago
@NAThompson , thanks for your interest in uBLAS. This will be supported soon! We are making a transition from 2D to ND and also major changes to comply with C++11 and newer standards, see example.
Awesome! Looks like y'all are doing really cool stuff.
Thanks.
@bassoy This does not seem to work on Fedora 38 (which uses version 1.78.0 of boost). See https://bugzilla.redhat.com/show_bug.cgi?id=2223035
Would you please try the shell script below (boost_vector.sh) to see if the corresponding test works for you:
#! /usr/bin/env bash
set -u -e
if [ $# != 1 ]
then
echo 'usage: ./boost_vector.sh (std|boost)'
exit 1
fi
if [ "$1" == 'std' ]
then
vector_type="std::vector<double>"
else
vector_type="boost::numeric::ublas::vector<double>"
fi
cat << EOF > boost_vector.cpp
# include <vector>
# include <boost/numeric/ublas/vector.hpp>
int main(void)
{ $vector_type v = { 1.0, 2.0 };
if( v.size() == 2 && v[0] == 1.0 && v[1] == 2.0 )
return 0;
return 1;
}
EOF
g++ boost_vector.cpp -o boost_vector
if ! ./boost_vector
then
echo 'boost_vector: Error'
exit 1
fi
#
echo 'boost_vector: OK'
exit 0
Initializer list constructors are not supported for ublas vector (error message from g++ 8):
It would be a convenient enhancement, and presumably easy to implement.