Skip to content

Boost:uBLAS

기본 선형 대수학의 행렬, 백터 클래스를 제공한다.

Matrix

The templated class matrix is the base container adaptor for dense matrices. For a (m x n)-dimensional matrix and 0 <= i < m, 0 <= j < n every element mi, j is mapped to the (i x n + j)-th element of the container for row major orientation or the (i + j x m)-th element of the container for column major orientation.

Example

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main () {
    using namespace boost::numeric::ublas;
    matrix<double> m (3, 3);
    for (unsigned i = 0; i < m.size1 (); ++ i)
        for (unsigned j = 0; j < m.size2 (); ++ j)
            m (i, j) = 3 * i + j;
    std::cout << m << std::endl;
}

See also

  • BLAS
  • Boost
  • Bolt - 10배 빠른 매트릭스 & 벡터 연산 알고리듬