NABLA
Nabla Ain't Basic Linear Algebra
|
Contains matrix
and vector
template classes and related stuff.
More...
Namespaces | |
namespace | dummy |
Contains dummy entities. | |
namespace | op |
Contains scalar operations. | |
namespace | orientation |
Contains definitions for vector orientation types. | |
namespace | tag |
Contains expression tags. |
Classes | |
struct | access_error |
Access error. More... | |
struct | base_column_iterator |
Base type for column iterators. More... | |
struct | base_matrix_expression |
Base matrix expression template class. More... | |
struct | base_matrix_expression< value_t, expr_t, tag, rectangular > |
Base matrix expression template class partial specialization. More... | |
struct | base_row_iterator |
Base type for row iterators. More... | |
struct | base_vector_iterator |
Base type for vector iterators. More... | |
class | binary |
Binary expression template class. More... | |
class | binary< vector_expression< value_t, expr1, tag1 >, vector_expression< value_t, expr2, tag2 >, op > |
Binary expression template class specialization. More... | |
struct | column_const_iterator |
Iterator type for iterating over a column of a matrix. More... | |
struct | column_iterator |
Iterator type for iterating over a column of a matrix. More... | |
class | column_wrapper |
Column vector wrapper template class. More... | |
struct | const_iterator |
Iterator type for iterating over a vector. More... | |
struct | const_iterator< vector_ref< expression_type, tag, orientation::column > > |
Iterator type for iterating over a row of a matrix. More... | |
struct | const_iterator< vector_ref< expression_type, tag, orientation::row > > |
Iterator type for iterating over a row of a matrix. More... | |
struct | constrained_index |
Constrained index. More... | |
class | expr_traits |
Expression traits template class. More... | |
struct | expr_traits< matrix_expression< value_t, expr_t, tag_t > > |
Expression traits template class partial specialization. More... | |
struct | expr_traits< shaped_expression< value_t, expr_t, tag_t, shape_t > > |
Expression traits template class partial specialization. More... | |
struct | expr_traits< vector_expression< value_t, expr_t, tag_t, orientation_t > > |
Expression traits template class partial specialization. More... | |
struct | iterator |
Iterator type for iterating over a vector. More... | |
struct | iterator< vector_ref< expression_type, tag, orientation::column > > |
Iterator type for iterating over a row of a matrix. More... | |
struct | iterator< vector_ref< expression_type, tag, orientation::row > > |
Iterator type for iterating over a row of a matrix. More... | |
struct | lower_triangular |
Lower triangle shape of matrix. More... | |
class | matrix |
Square matrix template class. More... | |
class | matrix< value_t, rectangular > |
General matrix template class. More... | |
struct | matrix_expression |
Matrix expression template class. More... | |
class | product |
Matrix product template class. More... | |
class | product< expression1, vector_expression< value_t, expr2, tag2 > > |
Matrix product template class partial specialization. More... | |
struct | rectangular |
General shape of matrix. More... | |
struct | reshape_constraint |
Constraints for reshape operation template class. More... | |
struct | reshape_constraint< rectangular > |
Constraints for reshape operation template class specialization. More... | |
struct | reshape_error |
Reshape exception class. More... | |
class | reshaped |
Reshaped matrix expression template class. More... | |
class | reshaped< matrix_expression< value_t, expr_t, tag_t >, target_shape, lower_triangular > |
Partial specialization of reshaped . More... | |
class | reshaped< matrix_expression< value_t, expr_t, tag_t >, target_shape, upper_triangular > |
Partial specialization of reshaped . More... | |
struct | row_const_iterator |
Iterator type for iterating over a row of a matrix. More... | |
struct | row_iterator |
Iterator type for iterating over a row of a matrix. More... | |
class | row_wrapper |
Row vector wrapper template class. More... | |
struct | rvalue |
Represents an "rvalue". More... | |
class | scaled |
Scaled expression template class. More... | |
class | scaled< vector_expression< value_t, expr_t, tag_t > > |
Scaled expression template class partial specialization. More... | |
struct | shaped_expression |
Shaped matrix expression template class. More... | |
struct | size_error |
Argument size error. More... | |
struct | symmetric |
Symmetric shape of matrix. More... | |
class | temporary |
Temporary object template class. More... | |
class | traits |
Type traits class. More... | |
class | transposed |
Transposition expression template class. More... | |
class | unary |
Unary expression template class. More... | |
class | unary< vector_expression< value_t, expr_t, tag_t >, op > |
Unary expression template class specialization. More... | |
struct | upper_triangular |
Upper triangle shape of matrix. More... | |
class | vector |
Vector template class. More... | |
struct | vector_expression |
Vector expression template class. More... | |
class | vector_expression< value_t, expr_t, tag, orientation::column > |
Vector expression template class specialization. More... | |
class | vector_expression< value_t, expr_t, tag, orientation::row > |
Vector expression template class specialization. More... | |
class | vector_ref< expression_type, tag::expression< complexity >, orientation::column > |
Constant column reference template class partial specialization. More... | |
class | vector_ref< expression_type, tag::expression< complexity >, orientation::row > |
Constant row reference template class partial specialization. More... | |
class | vector_ref< expression_type, tag::reference, orientation::column > |
Column reference template class partial specialization. More... | |
class | vector_ref< expression_type, tag::reference, orientation::row > |
Row reference template class partial specialization. More... |
Typedefs | |
typedef lower_triangular | lower_tr |
Convenient alias for lower_triangular matrix shape. | |
typedef upper_triangular | upper_tr |
Convenient alias for upper_triangular matrix shape. |
Functions | |
template<typename value_t , typename expr_t , typename tag > | |
iterator< expr_t >::type | begin (vector_expression< value_t, expr_t, tag > &v, size_t i=0) |
Returns iterator. | |
template<typename value_t , typename expr_t , typename tag > | |
const_iterator< expr_t >::type | begin (const vector_expression< value_t, expr_t, tag > &v, size_t i=0) |
Returns iterator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
op::mul< value_t, value_t > ::result_type | sum_of_products (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b) |
Returns sum of products of corresponding elements. | |
Implementation details | |
template<typename expr_t > | |
util::non_zero_in_row < rectangular >::first_type | first_non_zero_in_row (const expr_t &m, size_t row) |
Returns index of the first non zero element in row row. | |
template<typename expr_t > | |
util::non_zero_in_row < rectangular >::last_type | last_non_zero_in_row (const expr_t &m, size_t row) |
Returns index of the last non zero element in row row. | |
template<typename expr_t > | |
util::non_zero_in_column < rectangular >::first_type | first_non_zero_in_column (const expr_t &m, size_t column) |
Returns index of the first non zero element in column column. | |
template<typename expr_t > | |
util::non_zero_in_column < rectangular >::last_type | last_non_zero_in_column (const expr_t &m, size_t column) |
Returns index of the last non zero element in column column. | |
template<typename expr_t > | |
orientation::undefined | orientation_type (expr_t *) |
Defines orientation type for arbitrary vector. | |
template<typename type > | |
rvalue< type > & | to_rvalue_ref (type &a) |
Turns a reference into a "reference to rvalue". | |
template<typename expression_type , typename tag > | |
util::non_zero_in_row < typename expr_traits < expression_type >::shape > ::first_type | first_non_zero (const vector_ref< expression_type, tag, orientation::row > &v) |
Returns index of the first non zero element in row reference. | |
template<typename expression_type , typename tag > | |
util::non_zero_in_row < typename expr_traits < expression_type >::shape > ::last_type | last_non_zero (const vector_ref< expression_type, tag, orientation::row > &v) |
Returns index of the last non zero element in row reference. | |
template<typename expression_type , typename tag > | |
util::non_zero_in_column < typename expr_traits < expression_type >::shape > ::first_type | first_non_zero (const vector_ref< expression_type, tag, orientation::column > &v) |
Returns index of the first non zero element in row reference. | |
template<typename expression_type , typename tag > | |
util::non_zero_in_column < typename expr_traits < expression_type >::shape > ::last_type | last_non_zero (const vector_ref< expression_type, tag, orientation::column > &v) |
Returns index of the last non zero element in row reference. | |
template<typename expr_t > | |
size_t | first_non_zero (const expr_t &) |
Returns index of the first non zero element in vector v. | |
template<typename expr_t > | |
size_t | last_non_zero (const expr_t &v) |
Returns index of the first non zero element in row row. | |
template<typename expr1 , typename expr2 > | |
size_t | first_non_zero (const expr1 &a, const expr2 &b) |
Returns index of the first non zero element in both vectors. | |
template<typename expr1 , typename expr2 > | |
size_t | last_non_zero (const expr1 &a, const expr2 &b) |
Returns index of the last non zero element in both vectors. | |
Miscellaneous | |
template<typename value_t , typename expr_t , typename tag > | |
expr_t & | get_matrix (matrix_expression< value_t, expr_t, tag > &a) |
Returns underlying matrix expression. | |
template<typename value_t , typename expr_t , typename tag > | |
const expr_t & | get_matrix (const matrix_expression< value_t, expr_t, tag > &a) |
Returns underlying matrix expression. | |
template<typename value_t , typename expr_t , typename tag > | |
expr_t & | get_vector (vector_expression< value_t, expr_t, tag > &a) |
Returns underlying vector expression. | |
template<typename value_t , typename expr_t , typename tag > | |
const expr_t & | get_vector (const vector_expression< value_t, expr_t, tag > &a) |
Returns underlying vector expression. | |
template<typename value_t , typename expr_t > | |
void | swap (matrix_expression< value_t, expr_t, tag::storage > &a, matrix_expression< value_t, expr_t, tag::storage > &b) |
Swaps contents of two matrices. | |
template<typename value_t , typename expr_t , typename shape > | |
void | swap (shaped_expression< value_t, expr_t, tag::storage, shape > &a, shaped_expression< value_t, expr_t, tag::storage, shape > &b) |
Swaps contents of two matrices. | |
template<typename target_shape , typename value_t , typename expr_t , typename tag > | |
util::reshape_return < matrix_expression< value_t, expr_t, tag >, target_shape > ::type | reshape (const matrix_expression< value_t, expr_t, tag > &a) |
Reshapes a matrix expression. | |
template<typename target_shape , typename side , typename value_t , typename expr_t , typename tag > | |
util::reshape_return < matrix_expression< value_t, expr_t, tag >, target_shape, side >::type | reshape (const matrix_expression< value_t, expr_t, tag > &a) |
Returns underlying matrix expression. | |
template<typename value_t , typename expr_t , typename tag > | |
util::row_ref < matrix_expression< value_t, expr_t, tag > >::type | row (matrix_expression< value_t, expr_t, tag > &a, size_t r) |
Returns reference to a matrix row. | |
template<typename value_t , typename expr_t , typename tag_t > | |
util::const_row_ref < matrix_expression< value_t, expr_t, tag_t > >::type | row (const matrix_expression< value_t, expr_t, tag_t > &a, size_t r) |
Returns reference to a matrix row. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
util::row_ref < shaped_expression< value_t, expr_t, tag, shape > >::type | row (shaped_expression< value_t, expr_t, tag, shape > &a, size_t r) |
Returns reference to a matrix row. | |
template<typename value_t , typename expr_t , typename tag_t , typename shape > | |
util::const_row_ref < shaped_expression< value_t, expr_t, tag_t, shape > >::type | row (const shaped_expression< value_t, expr_t, tag_t, shape > &a, size_t r) |
Returns reference to a matrix row. | |
template<typename value_t , typename expr_t , typename tag > | |
util::column_ref < matrix_expression< value_t, expr_t, tag > >::type | column (matrix_expression< value_t, expr_t, tag > &a, size_t c) |
Returns reference to a matrix column. | |
template<typename value_t , typename expr_t , typename tag_t > | |
util::const_column_ref < matrix_expression< value_t, expr_t, tag_t > >::type | column (const matrix_expression< value_t, expr_t, tag_t > &a, size_t c) |
Returns reference to a matrix column. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
util::column_ref < shaped_expression< value_t, expr_t, tag, shape > >::type | column (shaped_expression< value_t, expr_t, tag, shape > &a, size_t c) |
Returns reference to a matrix column. | |
template<typename value_t , typename expr_t , typename tag_t , typename shape > | |
util::const_column_ref < shaped_expression< value_t, expr_t, tag_t, shape > >::type | column (const shaped_expression< value_t, expr_t, tag_t, shape > &a, size_t c) |
Returns reference to a matrix column. | |
template<typename value_t , typename expr_t > | |
void | swap (vector_expression< value_t, expr_t, tag::storage > &a, vector_expression< value_t, expr_t, tag::storage > &b) |
Swaps contents of two vectors. | |
template<typename value_t , typename expr1 , typename expr2 > | |
void | swap (vector_expression< value_t, expr1, tag::storage > &a, vector_expression< value_t, expr2, tag::storage > &b) |
Swaps contents of two vector expressions. | |
template<typename value_t , typename expr1 , typename expr2 , typename orientation > | |
void | swap (vector_expression< value_t, expr1, tag::storage > &a, vector_ref< expr2, tag::reference, orientation > b) |
Swaps contents of two vector expressions. | |
template<typename expr1 , typename orientation , typename value_t , typename expr2 > | |
void | swap (vector_ref< expr1, tag::reference, orientation > a, vector_expression< value_t, expr2, tag::storage > &b) |
Swaps contents of two vector expressions. | |
template<typename expr1 , typename orientation1 , typename expr2 , typename orientation2 > | |
void | swap (vector_ref< expr1, tag::reference, orientation1 > a, vector_ref< expr2, tag::reference, orientation2 > b) |
Swaps contents of two vector expressions. | |
Matrix operations | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< matrix_expression < value_t, expr_t, tag > , op::plus > | operator+ (const matrix_expression< value_t, expr_t, tag > &a) |
Unary plus operator. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const unary< shaped_expression < value_t, expr_t, tag, shape > , op::plus > | operator+ (const shaped_expression< value_t, expr_t, tag, shape > &a) |
Unary plus operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< matrix_expression < value_t, expr_t, tag > , op::minus > | operator- (const matrix_expression< value_t, expr_t, tag > &a) |
Unary minus operator. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const unary< shaped_expression < value_t, expr_t, tag, shape > , op::minus > | operator- (const shaped_expression< value_t, expr_t, tag, shape > &a) |
Unary minus operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< matrix_expression < value_t, expr_t, tag > , op::conj > | conj (const matrix_expression< value_t, expr_t, tag > &a) |
Returns conjugated matrix. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const unary< shaped_expression < value_t, expr_t, tag, shape > , op::conj > | conj (const shaped_expression< value_t, expr_t, tag, shape > &a) |
Returns conjugated matrix. | |
template<typename value_t , typename expr_t , typename tag > | |
const transposed < matrix_expression< value_t, expr_t, tag > > | transpose (const matrix_expression< value_t, expr_t, tag > &a) |
Returns transposed matrix. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const transposed < shaped_expression< value_t, expr_t, tag, shape > > | transpose (const shaped_expression< value_t, expr_t, tag, shape > &a) |
Returns transposed matrix. | |
template<typename value_t , typename expr_t , typename tag > | |
const expr_t & | transpose (const shaped_expression< value_t, expr_t, tag, symmetric > &a) |
Returns transposed matrix. | |
template<typename value_t , typename expr_t , typename tag > | |
const reshaped < shaped_expression< value_t, expr_t, tag, lower_triangular > , upper_triangular, lower_triangular > | transpose (const shaped_expression< value_t, expr_t, tag, lower_triangular > &a) |
Returns transposed matrix. | |
template<typename value_t , typename expr_t , typename tag > | |
const reshaped < shaped_expression< value_t, expr_t, tag, upper_triangular > , lower_triangular, upper_triangular > | transpose (const shaped_expression< value_t, expr_t, tag, upper_triangular > &a) |
Returns transposed matrix. | |
template<typename value_t , typename expr_t , typename tag > | |
const scaled < matrix_expression< value_t, expr_t, tag > > | operator* (const matrix_expression< value_t, expr_t, tag > &a, const typename expr_t::value_type &s) |
Binary multiplication operator. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const scaled < shaped_expression< value_t, expr_t, tag, shape > > | operator* (const shaped_expression< value_t, expr_t, tag, shape > &a, const typename expr_t::value_type &s) |
Binary multiplication operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const scaled < matrix_expression< value_t, expr_t, tag > > | operator* (const typename expr_t::value_type &s, const matrix_expression< value_t, expr_t, tag > &a) |
Binary multiplication operator. | |
template<typename value_t , typename expr_t , typename tag , typename shape > | |
const scaled < shaped_expression< value_t, expr_t, tag, shape > > | operator* (const typename expr_t::value_type &s, const shaped_expression< value_t, expr_t, tag, shape > &a) |
Binary multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < matrix_expression< value_t, expr1, tag1 > , matrix_expression< value_t, expr2, tag2 >, op::add > | operator+ (const matrix_expression< value_t, expr1, tag1 > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Binary addition operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape1 , typename expr2 , typename tag2 , typename shape2 > | |
const binary < shaped_expression< value_t, expr1, tag1, shape1 > , shaped_expression< value_t, expr2, tag2, shape1 >, op::add > | operator+ (const shaped_expression< value_t, expr1, tag1, shape1 > &left, const shaped_expression< value_t, expr2, tag2, shape2 > &right) |
Binary addition operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < matrix_expression< value_t, expr1, tag1 > , matrix_expression< value_t, expr2, tag2 >, op::sub > | operator- (const matrix_expression< value_t, expr1, tag1 > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Binary subtraction operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape1 , typename expr2 , typename tag2 , typename shape2 > | |
const binary < shaped_expression< value_t, expr1, tag1, shape1 > , shaped_expression< value_t, expr2, tag2, shape2 >, op::sub > | operator- (const shaped_expression< value_t, expr1, tag1, shape1 > &left, const shaped_expression< value_t, expr2, tag2, shape2 > &right) |
Binary subtraction operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < matrix_expression< value_t, expr1, tag1 > , matrix_expression< value_t, expr2, tag2 >, op::mul > | mul (const matrix_expression< value_t, expr1, tag1 > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Binary element-wise multiplication operation. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape1 , typename expr2 , typename tag2 , typename shape2 > | |
const binary < shaped_expression< value_t, expr1, tag1, shape1 > , shaped_expression< value_t, expr2, tag2, shape2 >, op::mul > | mul (const shaped_expression< value_t, expr1, tag1, shape1 > &left, const shaped_expression< value_t, expr2, tag2, shape2 > &right) |
Binary element-wise multiplication operation. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < matrix_expression< value_t, expr1, tag1 > , matrix_expression< value_t, expr2, tag2 >, op::div > | div (const matrix_expression< value_t, expr1, tag1 > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Binary element-wise multiplication operation. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape1 , typename expr2 , typename tag2 , typename shape2 > | |
const binary < shaped_expression< value_t, expr1, tag1, shape1 > , shaped_expression< value_t, expr2, tag2, shape2 >, op::div > | div (const shaped_expression< value_t, expr1, tag1, shape1 > &left, const shaped_expression< value_t, expr2, tag2, shape2 > &right) |
Binary element-wise multiplication operation. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
product< matrix_expression < value_t, expr1, tag1 > , matrix_expression< value_t, expr2, tag2 > > | operator* (const matrix_expression< value_t, expr1, tag1 > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Binary matrix multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape1 , typename expr2 , typename tag2 , typename shape2 > | |
product< shaped_expression < value_t, expr1, tag1, shape1 > , shaped_expression< value_t, expr2, tag2, shape2 > > | operator* (const shaped_expression< value_t, expr1, tag1, shape1 > &left, const shaped_expression< value_t, expr2, tag2, shape2 > &right) |
Binary matrix multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
product< matrix_expression < value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 > > | operator* (const matrix_expression< value_t, expr1, tag1 > &left, const vector_expression< value_t, expr2, tag2, orientation::column > &right) |
Binary matrix-vector multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape , typename expr2 , typename tag2 > | |
product< shaped_expression < value_t, expr1, tag1, shape > , vector_expression< value_t, expr2, tag2 > > | operator* (const shaped_expression< value_t, expr1, tag1, shape > &left, const vector_expression< value_t, expr2, tag2, orientation::column > &right) |
Binary matrix-vector multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
product< matrix_expression < value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 > > | map (const matrix_expression< value_t, expr1, tag1 > &linear_map, const vector_expression< value_t, expr2, tag2 > &v) |
Transforms a vector using provided transformation map. | |
template<typename value_t , typename expr1 , typename tag1 , typename shape , typename expr2 , typename tag2 > | |
product< shaped_expression < value_t, expr1, tag1, shape > , vector_expression< value_t, expr2, tag2 > > | map (const shaped_expression< value_t, expr1, tag1, shape > &linear_map, const vector_expression< value_t, expr2, tag2 > &v) |
Transforms a vector using provided transformation map. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator+= (matrix_expression< value_t, expr1, tag::storage > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Matrix addition assignment operator. | |
template<typename value_t , typename expr1 , typename shape , typename expr2 , typename tag2 > | |
expr1 & | operator+= (shaped_expression< value_t, expr1, tag::storage, shape > &left, const shaped_expression< value_t, expr2, tag2, shape > &right) |
Matrix addition assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator-= (matrix_expression< value_t, expr1, tag::storage > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Matrix subtraction assignment operator. | |
template<typename value_t , typename expr1 , typename shape , typename expr2 , typename tag2 > | |
expr1 & | operator-= (shaped_expression< value_t, expr1, tag::storage, shape > &left, const shaped_expression< value_t, expr2, tag2, shape > &right) |
Matrix subtraction assignment operator. | |
template<typename value_t , typename expr_t > | |
expr_t & | operator*= (matrix_expression< value_t, expr_t, tag::storage > &left, const value_t &right) |
Matrix multiplication assignment operator. | |
template<typename value_t , typename expr_t , typename shape > | |
expr_t & | operator*= (shaped_expression< value_t, expr_t, tag::storage, shape > &left, const value_t &right) |
Matrix multiplication assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator*= (matrix_expression< value_t, expr1, tag::storage > &left, const matrix_expression< value_t, expr2, tag2 > &right) |
Matrix multiplication assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator*= (shaped_expression< value_t, expr1, tag::storage, lower_triangular > &left, const shaped_expression< value_t, expr2, tag2, lower_triangular > &right) |
Matrix multiplication assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator*= (shaped_expression< value_t, expr1, tag::storage, upper_triangular > &left, const shaped_expression< value_t, expr2, tag2, upper_triangular > &right) |
Matrix multiplication assignment operator. | |
Vector operations | |
template<template< typename, typename > class op, typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
op< value_t, value_t >::result_type | accumulate (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b) |
Accumulates combined values of two vectors. | |
template<template< typename, typename > class op_t, typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
op_t< value_t, value_t > ::result_type | accumulate_skip_zeros (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b) |
Accumulates combined values of two vectors. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
util::mul_conj< value_t, value_t >::result_type | dot_product (const vector_expression< value_t, expr1, tag1 > &v1, const vector_expression< value_t, expr2, tag2 > &v2) |
Dot product is a sum of products of corresponding elements of first vector and conjugated elements of the second one: | |
template<template< typename > class op, typename value_t , typename expr_t , typename tag > | |
op< value_t >::result_type | accumulate (const vector_expression< value_t, expr_t, tag > &a) |
Accumulates modified values of a vector. | |
template<template< typename > class op_t, typename value_t , typename expr_t , typename tag > | |
op_t< value_t >::result_type | accumulate_skip_zeros (const vector_expression< value_t, expr_t, tag > &a) |
Accumulates combined values of two vectors. | |
template<typename value_t , typename expr_t , typename tag > | |
value_t | sqrnorm (const vector_expression< value_t, expr_t, tag > &v) |
Returns squared Euclidean norm of a vector. | |
template<typename value_t , typename expr_t , typename tag > | |
value_t | norm (const vector_expression< value_t, expr_t, tag > &v) |
Returns Euclidean norm of a vector. | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< vector_expression < value_t, expr_t, tag > , op::plus > | operator+ (const vector_expression< value_t, expr_t, tag > &a) |
Unary plus operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< vector_expression < value_t, expr_t, tag > , op::minus > | operator- (const vector_expression< value_t, expr_t, tag > &a) |
Unary minus operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const unary< vector_expression < value_t, expr_t, tag > , op::conj > | conj (const vector_expression< value_t, expr_t, tag > &a) |
Returns conjugated vector. | |
template<typename value_t , typename expr_t , typename tag > | |
const scaled < vector_expression< value_t, expr_t, tag > > | operator* (const vector_expression< value_t, expr_t, tag > &a, const typename expr_t::value_type &s) |
Binary multiplication operator. | |
template<typename value_t , typename expr_t , typename tag > | |
const scaled < vector_expression< value_t, expr_t, tag > > | operator* (const typename expr_t::value_type &s, const vector_expression< value_t, expr_t, tag > &a) |
Binary multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < vector_expression< value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 >, op::add > | operator+ (const vector_expression< value_t, expr1, tag1 > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Binary addition operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < vector_expression< value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 >, op::sub > | operator- (const vector_expression< value_t, expr1, tag1 > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Binary subtraction operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < vector_expression< value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 >, op::mul > | mul (const vector_expression< value_t, expr1, tag1 > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Binary element-wise multiplication operator. | |
template<typename value_t , typename expr1 , typename tag1 , typename expr2 , typename tag2 > | |
const binary < vector_expression< value_t, expr1, tag1 > , vector_expression< value_t, expr2, tag2 >, op::div > | div (const vector_expression< value_t, expr1, tag1 > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Binary element-wise division operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator+= (vector_expression< value_t, expr1, tag::storage > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Vector addition assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator+= (vector_expression< value_t, expr1, tag::reference > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Vector addition assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator-= (vector_expression< value_t, expr1, tag::storage > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Vector subtraction assignment operator. | |
template<typename value_t , typename expr1 , typename expr2 , typename tag2 > | |
expr1 & | operator-= (vector_expression< value_t, expr1, tag::reference > &left, const vector_expression< value_t, expr2, tag2 > &right) |
Vector subtraction assignment operator. | |
template<typename value_t , typename expr_t > | |
expr_t & | operator*= (vector_expression< value_t, expr_t, tag::storage > &left, const value_t &right) |
Vector multiplication assignment operator. | |
template<typename value_t , typename expr_t > | |
expr_t & | operator*= (vector_expression< value_t, expr_t, tag::reference > &left, const value_t &right) |
Vector multiplication assignment operator. |
|
inline |
Accumulates combined values of two vectors.
This is a helper function provided as implementation detail. In terms of this function some library operations are defined.
For example to compute sum of products of corresponding elements of vectors v1
and v2
one can write:
Here op::mul
is a template containing needed operation.
traits<value_t>::zero
. Definition at line 4618 of file matrix.h.
References begin(), and get_vector().
|
inline |
Accumulates modified values of a vector.
This is a helper function provided as implementation detail. In terms of this function some library operations are defined.
The usage is as follows: For example to compute sum of conjugated elements of vector v
one can write:
Here op::conj
is a template containing needed operation.
traits<value_t>::zero
. Definition at line 5290 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Accumulates combined values of two vectors.
This is a helper function provided as implementation detail. In terms of this function some library operations are defined.
For example to compute sum of products of corresponding elements of vectors v1
and v2
one can write:
Here op::mul
is a template containing needed operation.
traits<value_t>::zero
. Definition at line 4638 of file matrix.h.
References begin(), first_non_zero(), get_vector(), and last_non_zero().
|
inline |
Accumulates combined values of two vectors.
This is a helper function provided as implementation detail. In terms of this function some library operations are defined.
For example to compute sum of products of corresponding elements of vectors v1
and v2
one can write:
Here op::mul
is a template containing needed operation.
traits<value_t>::zero
. Definition at line 5302 of file matrix.h.
References begin(), first_non_zero(), vector_expression< value_t, expr_t, tag, orientation >::get_vector(), and last_non_zero().
|
inline |
Returns iterator.
This is an internal helper function.
Definition at line 1823 of file matrix.h.
References get_vector().
|
inline |
Returns iterator.
This is an internal helper function.
Definition at line 1828 of file matrix.h.
References get_vector().
|
inline |
Returns reference to a matrix column.
Definition at line 4525 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix column.
Definition at line 4535 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix column.
Definition at line 4545 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix column.
Definition at line 4555 of file matrix.h.
References get_matrix().
|
inline |
Returns conjugated matrix.
This function returns an expression which represents conjugated matrix, i.e. a matrix with conjugated corresponding elements.
For real valued matrices it just returns a constant reference to the argument, i.e. it actually does nothing.
For some important details check out Using complex types.
conj(m)
: algorithmic complexity of this operation is constant (i.e. O(1)).By convention the resulting expression has complexity of its subexpression.
Definition at line 3921 of file matrix.h.
References get_matrix().
|
inline |
Returns conjugated matrix.
This is an overload for shaped matrix expressions.
Definition at line 3929 of file matrix.h.
References get_matrix().
|
inline |
Returns conjugated vector.
This function returns an expression which represents conjugated vector, i.e. a vector with conjugated corresponding elements.
For real valued vectors it just returns a constant reference to the argument, i.e. it actually does nothing.
For some important details check out Using complex types.
conj(v)
: algorithmic complexity of this operation is constant (i.e. O(1)).By convention the resulting expression has complexity of its subexpression.
Definition at line 5466 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary element-wise multiplication operation.
This operation produces a matrix containing quotients of corresponding elements of argument matrices:
m(i, j) = left(i, j)/right(i, j)
for each i
and j
.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
mul(m, m)
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4295 of file matrix.h.
References get_matrix().
|
inline |
Binary element-wise multiplication operation.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4308 of file matrix.h.
References get_matrix().
|
inline |
Binary element-wise division operator.
Sizes of argument vectors must be equal. Otherwise an exception (size_error
) is thrown.
div(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5646 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Dot product is a sum of products of corresponding elements of first vector and conjugated elements of the second one:
It may be referred to as "scalar product" in other sources.
size_error | thrown if argument vectors have different sizes. |
Sizes of argument vectors must be equal. Otherwise an exception is thrown.
For some important details check out Using complex types.
traits<value_t>::zero
. dot_product(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)).
|
inline |
Returns underlying matrix expression.
This template function deduces the actual type of the underlying matrix expression and returns a reference to it. This scheme is called Curiously Recurring Template Pattern.
|
inline |
Returns underlying matrix expression.
This template function deduces the actual type of the underlying matrix expression and returns a reference to it. This scheme is called Curiously Recurring Template Pattern.
|
inline |
Returns underlying vector expression.
This template function deduces the actual type of the underlying vector expression and returns a reference to it. This scheme is called Curiously Recurring Template Pattern.
|
inline |
Returns underlying vector expression.
This template function deduces the actual type of the underlying vector expression and returns a reference to it. This scheme is called Curiously Recurring Template Pattern.
|
inline |
Transforms a vector using provided transformation map.
Number of columns of the matrix linear_map and size of the vector v must be equal. Otherwise an exception (size_error
) is thrown.
The vector is mapped the following way:
That is, the number of rows of the matrix representing linear map is the dimension of space the resulting vector (mapped
) belongs to.
This function preserves vector orientation, that is the orientation of the resulting vector expression is the same as that of the source vector.
This operation is analogous to matrix-vector multiplication.
map(m, v)
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4965 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix(), and vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Transforms a vector using provided transformation map.
This is an overload for shaped matrix expressions.
Number of columns of the matrix linear_map and size of the vector v must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4978 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix(), and vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary element-wise multiplication operation.
This operation produces a matrix containing products of corresponding elements of argument matrices:
m(i, j) = left(i, j)*right(i, j)
for each i
and j
.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
mul(m, m)
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4265 of file matrix.h.
References get_matrix().
|
inline |
Binary element-wise multiplication operation.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4278 of file matrix.h.
References get_matrix().
|
inline |
Binary element-wise multiplication operator.
Sizes of argument vectors must be equal. Otherwise an exception (size_error
) is thrown.
mul(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5633 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Returns Euclidean norm of a vector.
Euclidean norm of a vector is a square root of the sum of products of corresponding elements and their conjugates:
It is equivalent to the square root of dot product of a vector and itself
For some important details check out Using complex types.
By the way this entity uses sqrt()
function to find the square root. It must be defined for the value_t
type in order to use this operation.
traits<value_t>::zero
. norm(v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5389 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::sqrnorm().
|
inline |
Binary multiplication operator.
m*s
: algorithmic complexity of this operation is square (i.e.O(n2)).
Definition at line 4081 of file matrix.h.
References get_matrix().
|
inline |
Binary multiplication operator.
This is an overload for shaped matrix expressions.
Definition at line 4089 of file matrix.h.
References get_matrix().
|
inline |
Binary multiplication operator.
s*m
: algorithmic complexity of this operation is square (i.e.O(n2)).
Definition at line 4098 of file matrix.h.
References get_matrix().
|
inline |
Binary multiplication operator.
This is an overload for shaped matrix expressions.
Definition at line 4106 of file matrix.h.
References get_matrix().
|
inline |
Binary matrix multiplication operator.
Number of columns of the first matrix left and number of rows of the second matrix right must be equal. Otherwise an exception (size_error
) is thrown.
m*m
: algorithmic complexity of this operation is cubic (i.e. O(n3)). Definition at line 4833 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Binary matrix multiplication operator.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
Note that a product of two upper or lower triangular matrices has respective shape. Any other combination of shapes produces rectangular matrix, including a product of two symmetric matrices.
Definition at line 4850 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Binary matrix-vector multiplication operator.
Number of columns of the matrix left and size of the vector right must be equal. Otherwise an exception (size_error
) is thrown.
This operation is analogous to map()
.
m*v
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4925 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix(), and vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary matrix-vector multiplication operator.
This is an overload for shaped matrix expressions.
Number of columns of the matrix left and size of the vector right must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4938 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix(), and vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary multiplication operator.
v*s
: algorithmic complexity of this operation is linear (i.e.O(n)).
Definition at line 5514 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary multiplication operator.
s*v
: algorithmic complexity of this operation is linear (i.e.O(n)).
Definition at line 5523 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Matrix multiplication assignment operator.
m *= s
: algorithmic complexity of this operation is square (i.e.O(n2)).
Definition at line 5048 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix multiplication assignment operator.
This is an overload for shaped matrix expressions.
Definition at line 5066 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix multiplication assignment operator.
Number of columns of the first matrix and number of rows of the second matrix must be equal. Otherwise an exception is thrown.
m *= m
: algorithmic complexity of this operation is cubic (i.e. O(n3)). Definition at line 5082 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix multiplication assignment operator.
This is an overload for lower triangular matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
Definition at line 5097 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix multiplication assignment operator.
This is an overload for upper triangular matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
Definition at line 5112 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Vector multiplication assignment operator.
v *= s
: algorithmic complexity of this operation is linear (i.e.O(n)).
Definition at line 5751 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Vector multiplication assignment operator.
This function is provided for convenience.
This function performs multiplication assignment element by element in a cycle.
v *= s
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5764 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Unary plus operator.
+m
: algorithmic complexity of this operation is constant (i.e.O(1)).
By convention the resulting expression has complexity of its subexpression.
Definition at line 3876 of file matrix.h.
References get_matrix().
|
inline |
Unary plus operator.
This overload is for shaped matrix expressions.
Definition at line 3884 of file matrix.h.
References get_matrix().
|
inline |
Binary addition operator.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
m + m
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4209 of file matrix.h.
References get_matrix().
|
inline |
Binary addition operator.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4222 of file matrix.h.
References get_matrix().
|
inline |
Unary plus operator.
+v
: algorithmic complexity of this operation is constant (i.e.O(1)).
By convention the resulting expression has complexity of its subexpression.
Definition at line 5437 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary addition operator.
Sizes of argument vectors must be equal. Otherwise an exception (size_error
) is thrown.
v + v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5607 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Matrix addition assignment operator.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
m += m
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4989 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix addition assignment operator.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
Definition at line 5004 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Vector addition assignment operator.
Sizes of argument vectors must be equal. Otherwise an exception is thrown.
v += v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5657 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Vector addition assignment operator.
This function is provided for convenience.
This function performs addition assignment element by element in a cycle.
For efficiency reasons this function does not check sizes of argument vectors for equality and does not throw an exception in case sizes are different. It only makes an assertion in debug configuration.
v += v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5678 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Unary minus operator.
-m
: algorithmic complexity of this operation is constant (i.e.O(1)).
By convention the resulting expression has complexity of its subexpression.
Definition at line 3895 of file matrix.h.
References get_matrix().
|
inline |
Unary minus operator.
This overload is for shaped matrix expressions.
Definition at line 3903 of file matrix.h.
References get_matrix().
|
inline |
Binary subtraction operator.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
m - m
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 4235 of file matrix.h.
References get_matrix().
|
inline |
Binary subtraction operator.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception (size_error
) is thrown.
Definition at line 4248 of file matrix.h.
References get_matrix().
|
inline |
Unary minus operator.
-v
: algorithmic complexity of this operation is constant (i.e.O(1)).
By convention the resulting expression has complexity of its subexpression.
Definition at line 5448 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Binary subtraction operator.
Sizes of argument vectors must be equal. Otherwise an exception (size_error
) is thrown.
v - v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5620 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Matrix subtraction assignment operator.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
m -= m
: algorithmic complexity of this operation is square (i.e. O(n2)). Definition at line 5019 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Matrix subtraction assignment operator.
This is an overload for shaped matrix expressions.
Sizes of argument matrices must be equal. Otherwise an exception is thrown.
Definition at line 5034 of file matrix.h.
References matrix_expression< value_t, expr_t, tag >::get_matrix().
|
inline |
Vector subtraction assignment operator.
Sizes of argument vectors must be equal. Otherwise an exception is thrown.
v -= v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5697 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Vector subtraction assignment operator.
This function is provided for convenience.
This function performs subtraction assignment element by element in a cycle.
For efficiency reasons this function does not check sizes of argument vectors for equality and does not throw an exception in case sizes are different. It only makes an assertion in debug configuration.
v -= v
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5718 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
orientation::undefined nabla::orientation_type | ( | expr_t * | ) |
|
inline |
Reshapes a matrix expression.
This function returns an expression (of type reshaped
) with specified shape. The returned expression refers to a the way if it were an expression of specified shape.
Like standard C++ dynamic_cast
this cast operation performs runtime check (see documentation for reshape_constraint
) and, if requirements of the target shape are not met, raises an exception (of type reshape_error
).
Initially reshape
makes sense only for predefined (by the library) shapes. To make it work with user shapes one need to specialize reshaped
template class.
reshape<rectangular>(a)
does not reshape an expression, it has the same effect as
For target shapes other than rectangular
the upper triangle (super diagonal) part is taken into account by default. This means that if you reshape a matrix to, say, a symmetric matrix, then resulting matrix consists of mirrored upper triangle part of the original matrix.
While the default is to use upper triangle part of the matrix, one may want to use the counter part. You can choose what side of the original matrix to use in resulting matrix using reshape<shape, side>()
form. For example:
reshape<shape_id>(m)
: algorithmic complexity of this operation is constant (i.e. O(1)). Definition at line 3718 of file matrix.h.
References get_matrix(), and reshape_constraint< target_shape >::test().
|
inline |
Returns underlying matrix expression.
This template function deduces the actual type of the underlying matrix expression and returns a reference to it. This scheme is called Curiously Recurring Template Pattern.
Definition at line 3727 of file matrix.h.
References get_matrix(), and reshape_constraint< target_shape >::test().
|
inline |
Returns reference to a matrix row.
Definition at line 4485 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix row.
Definition at line 4495 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix row.
Definition at line 4505 of file matrix.h.
References get_matrix().
|
inline |
Returns reference to a matrix row.
Definition at line 4515 of file matrix.h.
References get_matrix().
|
inline |
Returns squared Euclidean norm of a vector.
Euclidean norm of a vector is a square root of the sum of products of corresponding elements and their conjugates. This function performs:
Note that this function returns squared Euclidean norm, that is |v|2.
It is equivalent to the dot product of a vector and itself
For some important details check out Using complex types.
traits<value_t>::zero
. sqrnorm(v)
: algorithmic complexity of this operation is linear (i.e. O(n)).
|
inline |
Returns sum of products of corresponding elements.
This function performs a convenient operation – it computes a sum of products of corresponding elements of two vectors:
For efficiency reasons this function does not check sizes of argument vectors for equality and does not throw an exception in case sizes are different. It only makes an assertion in debug configuration.
traits<value_t>::zero
. sum_of_products(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)).
|
inline |
Swaps contents of two matrices.
This template function handles all matrix expressions with storage
tag. Such expressions are meant to be storage types and by definition provide efficient swap operation.
The actual effect of this function is
This function is not meant to throw any exceptions.
Definition at line 3263 of file matrix.h.
References get_matrix().
|
inline |
Swaps contents of two matrices.
This template function handles all shaped matrix expressions with storage
tag. Such expressions are meant to be storage types and by definition provide efficient swap operation.
The actual effect of this function is
This function is not meant to throw any exceptions.
Definition at line 3278 of file matrix.h.
References get_matrix().
|
inline |
Swaps contents of two vectors.
This template function handles all vector expressions with storage
tag. Such expressions are meant to be storage types and by definition provide efficient swap operation.
The actual effect of this function is
This function is not meant to throw any exceptions.
Definition at line 5135 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Swaps contents of two vector expressions.
This function is provided for convenience.
This function swaps contents of two vector expressions with storage
tag. Such expressions are meant to be storage types.
This function does not actually swaps objects' storages or the like. Rather it swaps contents in the following manner:
temp
and assignment operation involved this function may throw an exception. swap(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5158 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector(), and matrix_expression< value_t, expr_t, tag >::swap().
|
inline |
Swaps contents of two vector expressions.
This function is provided for convenience.
This function swaps contents of two vector expressions element by element in a cycle.
This function does not actually swaps objects' storages or the like. Rather it swaps contents element by element in a cycle like this:
min(a.size(), b.size())
elements.Thus this function is not meant to throw any exceptions.
swap(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5205 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Swaps contents of two vector expressions.
This function is provided for convenience.This function swaps contents of two vector expressions element by element in a cycle.This function does not actually swaps objects' storages or the like. Rather it swaps contents element by element in a cycle like this:
min(a.size(), b.size())
elements.Thus this function is not meant to throw any exceptions.
swap(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). Definition at line 5216 of file matrix.h.
References vector_expression< value_t, expr_t, tag, orientation >::get_vector().
|
inline |
Swaps contents of two vector expressions.
This function is provided for convenience.This function swaps contents of two vector expressions element by element in a cycle.This function does not actually swaps objects' storages or the like. Rather it swaps contents element by element in a cycle like this:
min(a.size(), b.size())
elements.Thus this function is not meant to throw any exceptions.
swap(v, v)
: algorithmic complexity of this operation is linear (i.e. O(n)). rvalue<type>& nabla::to_rvalue_ref | ( | type & | a | ) |
|
inline |
Returns transposed matrix.
transpose(m)
: algorithmic complexity of this operation is constant (i.e.O(1)).
By convention the resulting expression has complexity of its subexpression.
Definition at line 3982 of file matrix.h.
References get_matrix().
|
inline |
Returns transposed matrix.
This is an overload for shaped matrix expressions.
Definition at line 3990 of file matrix.h.
References get_matrix().
|
inline |
Returns transposed matrix.
This is an overload for symmetric matrix expressions.
Since a transposed symmetric matrix is itself (A==AT) this function returns a reference to the argument. The equivalent effect is
Definition at line 4002 of file matrix.h.
References get_matrix().
|
inline |
Returns transposed matrix.
This is an overload for lower triangular matrix expressions.
Since a transposed lower triangular matrix is an upper triangular one this function returnes reshaped
expression. The equivalent effect is
Definition at line 4015 of file matrix.h.
References get_matrix().
|
inline |
Returns transposed matrix.
This is an overload for upper triangular matrix expressions.
Since a transposed upper triangular matrix is a lower triangular one this function returnes reshaped
expression. The equivalent effect is
Definition at line 4028 of file matrix.h.
References get_matrix().