Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Matrix< Type > Class Template Reference

Detailed Description

template<typename Type>
class thrill::common::Matrix< Type >

A simple m x n dense matrix for generating statistics.

Definition at line 29 of file matrix.hpp.

#include <matrix.hpp>

Public Member Functions

 Matrix ()=default
 empty matrix constructor More...
 
 Matrix (size_t rows, size_t columns, const Type &initial=Type())
 constructor of m times n matrix. More...
 
 Matrix (size_t rows_columns, const Type &initial=Type())
 constructor of square n times n matrix. More...
 
 Matrix (size_t rows, size_t columns, std::vector< Type > &&data)
 constructor of m times n matrix from appropriate vector More...
 
const Type & at (size_t row, size_t column) const
 return reference to element at cell More...
 
Type & at (size_t row, size_t column)
 return reference to element at cell More...
 
size_t columns () const
 number of columns in matrix More...
 
Type * data () const
 raw data of matrix More...
 
bool operator!= (const Matrix &b) const noexcept
 inequality operator More...
 
const Type & operator() (size_t row, size_t column) const
 return reference to element at cell More...
 
Type & operator() (size_t row, size_t column)
 return reference to element at cell More...
 
Matrixoperator*= (const Type &s)
 multiple matrix with a scalar More...
 
Matrix operator+ (const Matrix &b) const
 add two matrix to this one More...
 
Matrixoperator+= (const Matrix &b)
 add matrix to this one More...
 
bool operator== (const Matrix &b) const noexcept
 equality operator More...
 
size_t rows () const
 number of rows in matrix More...
 
size_t size () const
 size of matrix raw data (rows * columns) More...
 
template<typename Archive >
void ThrillSerialize (Archive &ar) const
 serialization with Thrill's serializer More...
 

Static Public Member Functions

template<typename Archive >
static Matrix ThrillDeserialize (Archive &ar)
 deserialization with Thrill's serializer More...
 

Static Public Attributes

static constexpr size_t thrill_fixed_size = 0
 
static constexpr bool thrill_is_fixed_size = false
 

Private Attributes

size_t columns_ = 0
 number of columns in matrix More...
 
std::vector< Type > data_
 data of matrix. More...
 
size_t rows_ = 0
 number of rows in matrix More...
 

Constructor & Destructor Documentation

Matrix ( )
default

empty matrix constructor

Referenced by Matrix< Type >::ThrillDeserialize().

Matrix ( size_t  rows,
size_t  columns,
const Type &  initial = Type() 
)
inline

constructor of m times n matrix.

Definition at line 36 of file matrix.hpp.

Matrix ( size_t  rows_columns,
const Type &  initial = Type() 
)
inlineexplicit

constructor of square n times n matrix.

Definition at line 41 of file matrix.hpp.

Matrix ( size_t  rows,
size_t  columns,
std::vector< Type > &&  data 
)
inline

constructor of m times n matrix from appropriate vector

Definition at line 45 of file matrix.hpp.

References Matrix< Type >::columns_, Matrix< Type >::data_, and Matrix< Type >::rows_.

Member Function Documentation

const Type& at ( size_t  row,
size_t  column 
) const
inline

return reference to element at cell

Definition at line 64 of file matrix.hpp.

References Matrix< Type >::columns_, Matrix< Type >::data_, and Matrix< Type >::rows_.

Referenced by Matrix< Type >::operator()().

Type& at ( size_t  row,
size_t  column 
)
inline

return reference to element at cell

Definition at line 71 of file matrix.hpp.

References Matrix< Type >::columns_, Matrix< Type >::data_, and Matrix< Type >::rows_.

size_t columns ( ) const
inline
Type* data ( ) const
inline

raw data of matrix

Definition at line 58 of file matrix.hpp.

References Matrix< Type >::data_.

Referenced by Matrix< Type >::ThrillDeserialize().

bool operator!= ( const Matrix< Type > &  b) const
inlinenoexcept

inequality operator

Definition at line 115 of file matrix.hpp.

References Matrix< Type >::operator==().

const Type& operator() ( size_t  row,
size_t  column 
) const
inline

return reference to element at cell

Definition at line 78 of file matrix.hpp.

References Matrix< Type >::at().

Type& operator() ( size_t  row,
size_t  column 
)
inline

return reference to element at cell

Definition at line 83 of file matrix.hpp.

References Matrix< Type >::at().

Matrix& operator*= ( const Type &  s)
inline

multiple matrix with a scalar

Definition at line 103 of file matrix.hpp.

References Matrix< Type >::data_.

Matrix operator+ ( const Matrix< Type > &  b) const
inline

add two matrix to this one

Definition at line 96 of file matrix.hpp.

References Matrix< Type >::columns(), and Matrix< Type >::rows().

Matrix& operator+= ( const Matrix< Type > &  b)
inline

add matrix to this one

Definition at line 88 of file matrix.hpp.

References Matrix< Type >::columns(), Matrix< Type >::data_, and Matrix< Type >::rows().

bool operator== ( const Matrix< Type > &  b) const
inlinenoexcept

equality operator

Definition at line 109 of file matrix.hpp.

References Matrix< Type >::columns(), Matrix< Type >::data_, and Matrix< Type >::rows().

Referenced by Matrix< Type >::operator!=().

size_t rows ( ) const
inline

number of rows in matrix

Definition at line 52 of file matrix.hpp.

References Matrix< Type >::rows_.

Referenced by Matrix< Type >::operator+(), Matrix< Type >::operator+=(), and Matrix< Type >::operator==().

size_t size ( ) const
inline

size of matrix raw data (rows * columns)

Definition at line 61 of file matrix.hpp.

References Matrix< Type >::data_.

static Matrix ThrillDeserialize ( Archive &  ar)
inlinestatic

deserialization with Thrill's serializer

Definition at line 137 of file matrix.hpp.

References Matrix< Type >::columns(), Matrix< Type >::data(), and Matrix< Type >::Matrix().

void ThrillSerialize ( Archive &  ar) const
inline

serialization with Thrill's serializer

Definition at line 126 of file matrix.hpp.

References Matrix< Type >::columns_, Matrix< Type >::data_, and Matrix< Type >::rows_.

Member Data Documentation

size_t columns_ = 0
private

number of columns in matrix

Definition at line 154 of file matrix.hpp.

Referenced by Matrix< Type >::at(), Matrix< Type >::columns(), Matrix< Type >::Matrix(), and Matrix< Type >::ThrillSerialize().

size_t rows_ = 0
private

number of rows in matrix

Definition at line 152 of file matrix.hpp.

Referenced by Matrix< Type >::at(), Matrix< Type >::Matrix(), Matrix< Type >::rows(), and Matrix< Type >::ThrillSerialize().

constexpr size_t thrill_fixed_size = 0
static

Definition at line 122 of file matrix.hpp.

constexpr bool thrill_is_fixed_size = false
static

Definition at line 121 of file matrix.hpp.


The documentation for this class was generated from the following file: