Questions tagged [ublas]

uBLAS is a C++ template class library that provides BLAS level 1, 2, 3 functionality for dense, packed and sparse matrices.

uBLAS is a C++ template class library that provides BLAS level 1, 2, 3 functionality for dense, packed and sparse matrices. The design and implementation unify mathematical notation via operator overloading and efficient code generation via expression templates.

http://www.boost.org/doc/libs/release/libs/numeric

99 questions
0
votes
1 answer

Why compiler choose the const method instead of non-const?

I'm trying to implement a three dimensional tensor using uBlas matrix from boost as a backend. One of the function is getting a reference to a slice and enables an easy assignment of matrix. Below is a fragment of tensor class: template
przemkovv
  • 1
  • 1
  • 1
0
votes
0 answers

How to read 2 dimensional data in the ublas::vector?

I have a 2 dimensional data(row x col), which was reading in a boost::multi_array container. I also need to know if I can read this data into ublas::vector, e.g., data has three rows and read them into three vectors v1, v2, v3: I am not very…
Mahesh
  • 556
  • 1
  • 3
  • 16
0
votes
2 answers

Getting PyUblas sample working in Ubuntu

I would like to call C++ functions in python which return uBLAS vector/matrices. There is a package to do this called PyUblas, but am having trouble getting this to work in Ubuntu. Can anyone walk me through the steps to get this sample to…
al0
  • 308
  • 1
  • 2
  • 13
0
votes
3 answers

uBLAS Slow Matrix-SparseVector Multiplication

I'm converting some of my own vector algebra code to use the optimized boost uBLAS library. However, when I tried to do a SymmetricMatrix-SparseVector multiplication I found it to be about 4x slower than my own implementation. The vector size is…
Projectile Fish
  • 935
  • 3
  • 9
  • 26
0
votes
4 answers

Segfault when I'm adding object to

I wrote pieces of code two different ways: using 2-dimensional array as matrix, and using boost::ublas::matrix. When I'm adding this object to in the first case it is working, but in the second I'm getting a segmentation fault. I want to use the…
kodziek
  • 41
  • 1
  • 7
0
votes
0 answers

Why does cout not work when using uBLAS io?

I am using cygwin and I have boost 1.62.0 installed. I have compiled the following code using g++ and it functions as expected printing "Hi!" to the screen. #include int main(){ std::cout << "Hi!" << std::endl; } When I try to…
Derek Bond
  • 13
  • 4
0
votes
1 answer

Creating boost::numeric::ublas vector from another subvector or submatrix

I am trying to create a vector from another submatrix or subvector. I have tried following but get this error error: no match for ‘operator=’ int m_size = 10; boost::numeric::ublas::matrix u_a(m_size, m_size); …
asdfkjasdfjk
  • 3,784
  • 18
  • 64
  • 104
0
votes
1 answer

boost ublas multiprecision template resolution fails with std::max

I have a very simple piece of code that treats matrices. Here's a short excerpt: typedef boost::multiprecision::cpp_dec_float_100 SuperFloat; typedef boost::numeric::ublas::matrix Matrix; int function(Matrix& matrix){ …
carsten
  • 1,315
  • 2
  • 13
  • 27
0
votes
0 answers

how to use boost::numeric::ublas::matrix_vector_range with boost::numeric::ublas::basic_range correctly

I construct boost::numeric::ublas::compressed_matrix,boost::numeric::ublas::row_major,0,boost::numeric::ublas::unbounded_array> and then extract the diagonal part via boost::numeric::ublas::matrix_vector_range. The…
ken
  • 318
  • 1
  • 11
0
votes
2 answers

how to set base index in ublas matrix?

I have searched the web but could not find an answer. how do I have set base index in the matrix, such that indexes start from values other than zero? for example: A(-3:1) // Matlab/fortran equivalent A.reindex(-3); // boost multi-array…
Anycorn
  • 50,217
  • 42
  • 167
  • 261
0
votes
1 answer

boost: Using matrix_row in place of a vector

I have a function taking a vector and modifying it. How can I pass a matrix_row instance to this function? I don't want to do any copy operations #include #include #include…
bennihepp
  • 262
  • 1
  • 11
0
votes
1 answer

Conversion from std::vector to ublas::compressed_matrix in ViennaCL

I'm looking to do some calculations and pass the resultant Jacobian NxN matrix and a right hand side vector(n) to boost's ublas and eventually ViennaCL. The vector was no issue using copy(), however, the matrix is proving to be difficult. Any help…
matusi143
  • 113
  • 1
  • 7
0
votes
0 answers

Want to write a C++ wrapper for ublas' project function

Minimal code example: #include namespace bnu = boost::numeric::ublas; template bnu::matrix_indirect project (bnu::matrix_indirect &data, int row1, int row2, int col1, int…
Johannes
  • 2,901
  • 5
  • 30
  • 50
0
votes
1 answer

Dynamic allocation of sparse matrix using uBLAS

I'm starting to use uBLAS for my sparse matrices. For static allocation, I do the following: compressed_matrix m (10,10,10); However, I need dynamic allocation. Here, they suggest the following for dynamic allocation of uBLAS…
Lisa
  • 3,365
  • 3
  • 19
  • 30
0
votes
1 answer

Read ublas vectors from binary file or init it with array[]

Why I cannot read ublas vectors from a binary file in a way like (instead of reading by one element at a time): boost::numeric::ublas::vector floatVector(10); myFile.read( (char *)&vector, 10 * sizeof(double)); Is there a way to initialize…
Alexander
  • 847
  • 1
  • 9
  • 18