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
2
votes
2 answers

Accessing the indices of non-zero elements in a UBLAS sparse vector

How can I know the index of the first non-zero element in a sparse_vector in ublas and each subsequent nonzero element as well? The function begin() gives me an iterator that can be used to know the first non-zero value stored, not its index in the…
Tarek
  • 1,060
  • 4
  • 17
  • 38
2
votes
2 answers

Applying Boost UBLAS blas-1 to Matrices

How do I apply level 1 blas on a boost::numeric::ublas matrix? For example I want to compute the maximum entry or the sum of all entries. Using norm_1 or norm_inf on a matrix gives no compiler error but returns (as it seems to me) arbitrary…
Andreas Mueller
  • 27,470
  • 8
  • 62
  • 74
2
votes
2 answers

Performing STL operations on Boost::uBLAS vectors

How can I map a function to every element of a vector in uBLAS (like Map[] in Mathematica)? For example; I want to take the sin() of all the elements of a uBLAS vector. Is there an optimized way in Boost, GSL, or any other numerical libraries to do…
Tarek
  • 1,060
  • 4
  • 17
  • 38
2
votes
2 answers

Newbie question regarding submatrix manipulation using BOOST uBLAS

This has been puzzling me for a few hours, so maybe someone here can help. I am trying to translate the following simple Matlab program into C++ using uBLAS: >> R = eye(4); >> R(:,3) = R(:,4); >> R R = 1 0 0 0 0 1 0 …
2
votes
0 answers

Remove a row from uBlas compressed matrix?

I was wondering what was the best way to remove a row from uBlas's compressed matrix? I was wondering if there was some way to get a hold of the compressed column data inside the vector? I am looking at this page…
Mikhail
  • 7,749
  • 11
  • 62
  • 136
2
votes
1 answer

Problem with boost ublas matrix product

I'm trying to use the ublas part of Boost but I'm not able to multiply matrices and assign the result to other matrices for some reason. This works: #include #include using namespace…
Rafael S. Calsaverini
  • 13,582
  • 19
  • 75
  • 132
2
votes
1 answer

C++, boost::numeric::ublas::mapped_matrix - iterating problem when using std::tr1::unordered_map instead of std::map

I'm using the boost library(1.44) and VC++ 2010. I found some problem with below code, using namespace boost::numeric; typedef double value_type; typedef ublas::mapped_matrix StorageMap; typedef ublas::mapped_matrix
bob
  • 21
  • 1
2
votes
1 answer

where is the ublas::vector push_back?

hi may i know where is the ublass::vector push_back or what ever does the same ? p.s (i'm not talking about std::vector)
Ismail Marmoush
  • 13,140
  • 25
  • 80
  • 114
2
votes
4 answers

What is Armadillo+Atlas , Armadillo+OpenBLAS, Armadillo+uBLAS, Armadillo+MKL?

In many website they talk about Armadillo+something else. What do they mean? I use Armadillo library in form of #include in Linux environment. In this website http://nghiaho.com/?p=1726 Armadillo+OpenBLAS is mentioned. What do they…
ar2015
  • 5,558
  • 8
  • 53
  • 110
2
votes
1 answer

boost ublas: rotate 2d vector

Erm. I hope I am seriously overlooking something. I want to rotate a 2d vector (kartesian) v by a certain angle phi. I can't find a function that generates the appropriate matrix or just performs that function. I know how to do this by hand. I am…
AndreasT
  • 9,417
  • 11
  • 46
  • 60
2
votes
1 answer

Square root of all elements of Boost Ublas Matrix

I am trying to compute square root of all elements of a Boost Ublas matrix. So far, I have this, and it works. #include #include "boost\numeric\ublas\matrix.hpp" #include #include #include #include…
The Vivandiere
  • 3,059
  • 3
  • 28
  • 50
2
votes
2 answers

ublas::bounded_vector<> being resized?

Now, seriously... I'll refrain from using bad words here because we're talking about the Boost fellows. It MUST be my mistake to see things this way, but I can't understand why, so I'll ask it here; maybe someone can enlighten me in this matter.…
Gui Prá
  • 5,559
  • 4
  • 34
  • 59
2
votes
2 answers

Operator overloading for a class containing boost::numeric::ublas::matrix

I have a class which contains a few boost::numeric::ublas::matrix's within it. I would like to overload the class's operators (+-*/=) so that I can act on the set of matrices with one statement. However this seems to require temporary instances…
ccook
  • 5,869
  • 6
  • 56
  • 81
2
votes
1 answer

std::generate - How do I use a random number generator?

In my programming I need to create a user-defined number of ublas vectors. I would like to do this with std::generate. However I get compiler errors that make it impossible for me. The code I'm using: for (size_t a_= 0; a_ < p_; a_++) { …
Mark Anderson
  • 2,399
  • 3
  • 15
  • 21
2
votes
1 answer

What are matrix expression and vector expresssion classes in Boost.uBLAS?

I have tried reading Boost Documentation, but I don't understand this expression concept. Matrix class inherits a matrix_expression class, I don't understand what is this class used for. Thank You.
Jignesh
  • 555
  • 1
  • 8
  • 18