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
1 answer

Efficient recalculation of weighted least squares regression when weights change

I am performing weighted least squares regression as described on wiki: WLS I need to solve this equation: $B= (t(X)WX)^{-1}*t(X)Wy$ I use SVD to find: $(t(X)WX)^{-1}$ and store it in a matrix. In addition I store the matrix $H= (t(X)WX)^{-1}*t(X)W$…
Atlas
  • 153
  • 3
  • 12
2
votes
1 answer

insert data in boost ublas matrix matlab style

I would like to insert data in a ublas::matrix but in one line the same as Matlab just like this (or something similar): model = [ 0.0685 0.6383 0.4558 0.7411 -0.7219 0.7081 0.7061 0.2887 -0.9521 -0.2553 0.4636 …
Poka Yoke
  • 373
  • 3
  • 8
  • 27
1
vote
1 answer

Compile Error - boost::numeric::ublas::coordinate_matrix

For general information I use boost 1.46. There have been no changes in ublas lib since this version. I use gcc version 4.6 to compile. So now my problem. I have a very basic class which is supposed to fit the boost matrix class to a self defined…
Thorsten
  • 333
  • 1
  • 5
  • 20
1
vote
2 answers

How to copy a boost::numeric::ublas::vector to a matrix?

What am I doing wrong here? // file main.cpp #include #include #include #include namespace ublas = boost::numeric::ublas; int…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
1
vote
2 answers

ublas: Wrap ublas::vector as ublas::matrix_expression

I'm a very noob at Boost::uBLAS. I have a function which take a ublas::matrix_expression as input: namespace ublas = boost::numeric::ublas; void Func(const ublas::matrix_expression& in, …
niboshi
  • 1,448
  • 3
  • 12
  • 20
1
vote
1 answer

boost::numeric::ublas::vector internal data storage pointer

I am using boost::numeric::ublas::vector (http://www.boost.org/doc/libs/1_41_0/libs/numeric/ublas/doc/vector.htm). How can I get an internal data pointer to the double? I need the internal pointer because I want to copy the vector to CUDA…
user988098
  • 261
  • 1
  • 3
  • 11
1
vote
1 answer

How do I fill matrices created in c++ using boost uBLAS?

Im new to C++ in general. I have an assignment where I need to create a 5x5 matrix with set constant values using the boost uBLAS library. I then have to multiply those matrices using boost uBLAS. So far I have: #include…
1
vote
1 answer

API that handles boost ublas sparse OR dense matrices

I am a bit perplexed by the Boost ublas documentation. It does not seem clear to me that the sparse and dense matrix classes share a common parent class---which I believe is by design. But then how can I design an API that can accept either sparse…
David Alexander
  • 358
  • 1
  • 12
1
vote
0 answers

From Boost::ublas to ATLAS,

I have written a program using Boost::ublas that uses extensive sparse matrix vector multiplication. I am not satisfied at all with its speed and I want to try ATLAS. Is there a clear procedure to transform the code? I am attaching below a very…
Tarek
  • 1,060
  • 4
  • 17
  • 38
1
vote
2 answers

Linking dynamically to Boost's library instead of header-only

I am new to using Boost, and I have understood how to deal with that by dint of including headers files I am interested in. For some reasons, I have to work with dynamic libraries. I have installed that one, but I'm not able to see the most…
1
vote
1 answer

How can matrix assignment in boost library work with parenthesis?

From this sample code from Boost official site: #include #include int main () { using namespace boost::numeric::ublas; matrix m (3, 3); for (unsigned i = 0; i <…
pah8J
  • 807
  • 9
  • 15
1
vote
1 answer

How Boost::uBLAS mapped_matrix works?

There are lots of references about Boost::uBLAS compressed_matrix and coordinate_matrix. But I found no explanation about mapped_matrix. How is it implemented? Which strategy of sparse storage does it use? Plus: can someone provide me some reference…
1
vote
0 answers

Reinterpret pointer as ublas::vector

I'm trying to write a C++ function which is called from Fortran. Fortran is therefore passing all arguments (vectors) by reference to the C++ function. In order to omit copying of the data I want to create a data structure which interprets the…
don
  • 11
  • 2
1
vote
0 answers

How to load CSR matrix directly into boost compressed_matrix?

I want to transfer a matrix from application A (using matrix in LDU format) to application B (using the boost ublas compressed_matrix, CSR format). I have a function converting the LDU format to CSR format. The ldu2csr function provides me with the…
Klausb
  • 83
  • 4
1
vote
1 answer

Why do I get a numeric::ublas::bad_index error when iterating on the elements of a sparse matrix?

I am using the Boost library, version 1.44.0 and c++ with gcc 4.0. I have created a ublas::compressed_matrix and I have filled it using the method insert_element(index1, index2, value). Thereafter I am iterating through the elements of the…
Guido Zuccon
  • 21
  • 1
  • 5