データ構造 | Public 型 | Public メソッド | Static Public メソッド
クラス テンプレート mist::matrix< T, Allocator >

行と列の要素数が可変の行列 [詳細]

#include <matrix.h>

+ mist::matrix< T, Allocator >に対する継承グラフ

データ構造

struct  rebind
 データ型の変換を行う [詳細]

Public 型

typedef Allocator allocator_type
 MISTコンテナが利用するアロケータ型
typedef Allocator::reference reference
 MISTのコンテナ内に格納するデータ型の参照.mist::matrix< data > の場合,data & となる
typedef Allocator::const_reference const_reference
 MISTのコンテナ内に格納するデータ型の const 参照.mist::matrix< data > の場合,const data & となる
typedef Allocator::value_type value_type
 MISTのコンテナ内に格納するデータ型.mist::matrix< data > の data と同じ
typedef Allocator::size_type size_type
 符号なしの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には size_t 型と同じ
typedef Allocator::difference_type difference_type
 符号付きの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には ptrdiff_t 型と同じ
typedef Allocator::pointer pointer
 MISTのコンテナ内に格納するデータ型のポインター型.mist::matrix< data > の場合,data * となる
typedef Allocator::const_pointer const_pointer
 MISTのコンテナ内に格納するデータ型の const ポインター型.mist::matrix< data > の場合,const data * となる
typedef mist_iterator1< T,
ptrdiff_t, pointer, reference
iterator
 MISTのコンテナ内を操作する,STLで言う順方向のランダムアクセスイテレータ
typedef mist_iterator1< T,
ptrdiff_t, const_pointer,
const_reference
const_iterator
 MISTのコンテナ内を操作する,順方向のランダムアクセスイテレータのコンスト版
typedef mist_reverse_iterator
< mist_iterator1< T, ptrdiff_t,
pointer, reference > > 
reverse_iterator
 MISTのコンテナ内を操作する,逆方向のランダムアクセスイテレータ
typedef mist_reverse_iterator
< mist_iterator1< T, ptrdiff_t,
const_pointer, const_reference > > 
const_reverse_iterator
 MISTのコンテナ内を操作する,逆方向のランダムアクセスイテレータのコンスト版
- Public 型 inherited from mist::array< T, Allocator >
typedef Allocator allocator_type
 MISTコンテナが利用するアロケータ型
typedef Allocator::reference reference
 MISTのコンテナ内に格納するデータ型の参照.mist::array< data > の場合,data & となる
typedef Allocator::const_reference const_reference
 MISTのコンテナ内に格納するデータ型の const 参照.mist::array< data > の場合,const data & となる
typedef Allocator::value_type value_type
 MISTのコンテナ内に格納するデータ型.mist::array< data > の data と同じ
typedef Allocator::size_type size_type
 符号なしの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には size_t 型と同じ
typedef Allocator::difference_type difference_type
 符号付きの整数を表す型.コンテナ内の要素数や,各要素を指定するときなどに利用し,内部的には ptrdiff_t 型と同じ
typedef Allocator::pointer pointer
 MISTのコンテナ内に格納するデータ型のポインター型.mist::array< data > の場合,data * となる
typedef Allocator::const_pointer const_pointer
 MISTのコンテナ内に格納するデータ型の const ポインター型.mist::array< data > の場合,const data * となる
typedef mist_iterator1< T,
ptrdiff_t, pointer, reference
iterator
 MISTのコンテナ内を操作する,STLで言う順方向のランダムアクセスイテレータ
typedef mist_iterator1< T,
ptrdiff_t, const_pointer,
const_reference
const_iterator
 MISTのコンテナ内を操作する,順方向のランダムアクセスイテレータのコンスト版
typedef mist_reverse_iterator
< mist_iterator1< T, ptrdiff_t,
pointer, reference > > 
reverse_iterator
 MISTのコンテナ内を操作する,逆方向のランダムアクセスイテレータ
typedef mist_reverse_iterator
< mist_iterator1< T, ptrdiff_t,
const_pointer, const_reference > > 
const_reverse_iterator
 MISTのコンテナ内を操作する,逆方向のランダムアクセスイテレータのコンスト版

Public メソッド

bool resize (size_type num)
 行列のサイズを num 行 1 列に変更する
bool resize (size_type nrows, size_type ncols)
 行列のサイズを num1 行 num2 列に変更する
bool resize (size_type nrows, size_type ncols, const T &val)
 行列のサイズを num1 行 num2 列に変更する
bool trim (matrix &out, size_type row, size_type col, difference_type nrows=-1, difference_type ncols=-1) const
 コンテナ内の要素をトリミングする
bool trim (size_type row, size_type col, difference_type nrows=-1, difference_type ncols=-1)
 コンテナ内の要素をトリミングする
bool swap (matrix &m)
 行列内の全ての内容を入れ替える.
void clear ()
 行列の要素を空にする
size_type size1 () const
 行数を返す
size_type size2 () const
 列数を返す
size_type rows () const
 行数を返す
size_type cols () const
 列数を返す
iterator row_begin (size_type r)
 行方向を操作する順方向ランダムアクセスイテレータを返す
const_iterator row_begin (size_type r) const
 行方向を操作するコンスト型の順方向ランダムアクセスイテレータを返す
iterator row_end (size_type r)
 行方向を操作する順方向ランダムアクセスイテレータを返す
const_iterator row_end (size_type r) const
 行方向を操作するコンスト型の順方向ランダムアクセスイテレータを返す
reverse_iterator row_rbegin (size_type r)
 行方向を操作する逆方向ランダムアクセスイテレータを返す
const_reverse_iterator row_rbegin (size_type r) const
 行方向を操作するコンスト型の逆方向ランダムアクセスイテレータを返す
reverse_iterator row_rend (size_type r)
 行方向を操作する逆方向ランダムアクセスイテレータを返す
const_reverse_iterator row_rend (size_type r) const
 行方向を操作するコンスト型の逆方向ランダムアクセスイテレータを返す
iterator col_begin (size_type c)
 列方向を操作する順方向ランダムアクセスイテレータを返す
const_iterator col_begin (size_type c) const
 列方向を操作するコンスト型の順方向ランダムアクセスイテレータを返す
iterator col_end (size_type c)
 列方向を操作する順方向ランダムアクセスイテレータを返す
const_iterator col_end (size_type c) const
 列方向を操作するコンスト型の順方向ランダムアクセスイテレータを返す
reverse_iterator col_rbegin (size_type c)
 列方向を操作する逆方向ランダムアクセスイテレータを返す
const_reverse_iterator col_rbegin (size_type c) const
 列方向を操作するコンスト型の逆方向ランダムアクセスイテレータを返す
reverse_iterator col_rend (size_type c)
 列方向を操作する逆方向ランダムアクセスイテレータを返す
const_reverse_iterator col_rend (size_type c) const
 列方向を操作するコンスト型の逆方向ランダムアクセスイテレータを返す
matrix operator- () const
 符号反転した行列を返す
matrix t () const
 転置行列を返す
matrix dagger () const
 共役転置行列を返す
template<class TT , class AAlocator >
const matrixoperator+= (const matrix< TT, AAlocator > &m2)
 行列の足し算
template<class TT , class AAlocator >
const matrixoperator-= (const matrix< TT, AAlocator > &m2)
 行列の引き算
template<class TT , class AAlocator >
const matrixoperator*= (const matrix< TT, AAlocator > &m2)
 行列の掛け算
const matrixoperator+= (typename type_trait< T >::value_type val)
 行列への定数(単位行列の定数倍)の足し算
const matrixoperator-= (typename type_trait< T >::value_type val)
 行列への定数(単位行列の定数倍)の引き算
const matrixoperator*= (typename type_trait< T >::value_type val)
 行列への定数(単位行列の定数倍)の掛け算
const matrixoperator/= (typename type_trait< T >::value_type val)
 行列への定数(単位行列の定数倍)の割り算
bool is_equal (const matrix &a, const double delta)
 2つの行列が等しい(全要素の差が delta 未満)かどうかを判定する
bool operator== (const matrix &a) const
 2つの行列が等しい(全要素が同じ値を持つ)かどうかを判定する
bool operator!= (const matrix &a) const
 2つの行列が等しくない(どれか1つでも異なる要素を持つ)かどうかを判定する
template<class TT , class AAlocator >
const matrixoperator= (const matrix< TT, AAlocator > &o)
 要素の型が異なる行列を代入する
const matrix< T, Allocator > & operator= (const matrix< T, Allocator > &o)
 要素の型が同じ行列を代入する
reference at (size_type r, size_type c)
 r 行 c 列 で示される位置の要素の参照を返す
const_reference at (size_type r, size_type c) const
 r 行 c 列 で示される位置の要素の const 参照を返す
reference operator() (size_type r, size_type c)
 r 行 c 列 で示される位置の要素の参照を返す
const_reference operator() (size_type r, size_type c) const
 r 行 c 列 で示される位置の要素の const 参照を返す
 matrix ()
 ディフォルトコンストラクタ.0 行 0 列 の行列を作成する
 matrix (const Allocator &a)
 アロケータ a のコピーを利用し,0 行 0 列 の行列を作成する
 matrix (size_type rnum, size_type cnum)
 要素数 rnum 行 cnum 列 の行列を作成し,デフォルト値で要素を初期化する
 matrix (size_type rnum, size_type cnum, const Allocator &a)
 要素数 rnum 行 cnum 列 でアロケータ a のコピーを利用した行列を作成し,デフォルト値で要素を初期化する
 matrix (size_type rnum, size_type cnum, const T &val)
 要素数 rnum 行 cnum 列 の行列を作成し,全要素を値 val で要素を初期化する
 matrix (size_type rnum, size_type cnum, const T &val, const Allocator &a)
 要素数 rnum 行 cnum 列 でアロケータ a のコピーを利用した行列を作成し,全要素を値 val で要素を初期化する
 matrix (size_type rnum, size_type cnum, pointer ptr, size_type mem_available)
 ptr が指すメモリ領域に,要素数 rnum 行 cnum 列 の行列を作成する(ptr が指す先の利用可能なメモリ量は mem_available )
 matrix (size_type rnum, size_type cnum, const T &val, pointer ptr, size_type mem_available)
 ptr が指すメモリ領域に,要素数 rnum 行 cnum 列 の行列を作成し,全要素を値 val で要素を初期化する(ptr が指す先の利用可能なメモリ量は mem_available )
template<class TT , class AAlocator >
 matrix (const matrix< TT, AAlocator > &o)
 他の行列で要素の型が異なるものから同じサイズの行列を作成する
 matrix (const matrix< T, Allocator > &o)
 他の行列で同じ要素型のものを用いて初期化する
- Public メソッド inherited from mist::array< T, Allocator >
bool resize (size_type num, size_type=0, size_type=0)
 コンテナ内の要素数を変更する
bool trim (array &out, size_type index, difference_type num=-1) const
 コンテナ内の要素をトリミングする
bool trim (size_type index, difference_type num=-1)
 コンテナ内の要素をトリミングする
bool swap (array &a)
 コンテナ内の全ての内容を入れ替える.
void fill ()
 コンテナ内のデータ要素をデフォルト値で初期化する
void fill (const value_type &val)
 コンテナ内のデータ要素を指定された値で初期化する
bool empty () const
 コンテナが空かどうかを判定
size_type size () const
 コンテナに格納されているデータ数を返す
size_type size3 () const
 Z軸方向のコンテナに格納されているデータ数を返す(常に1を返す)
size_type width () const
 X軸方向のコンテナに格納されているデータ数を返す
size_type height () const
 Y軸方向のコンテナに格納されているデータ数を返す(常に1を返す)
size_type depth () const
 Z軸方向のコンテナに格納されているデータ数を返す(常に1を返す)
double reso1 (double)
 X軸方向の解像度を返す
double reso1 () const
 X軸方向の解像度を設定する
double reso2 (double)
 Y軸方向の解像度を返す
double reso2 () const
 Y軸方向の解像度を設定する
double reso3 (double)
 Z軸方向の解像度を返す
double reso3 () const
 Z軸方向の解像度を設定する)
size_type byte () const
 コンテナ内の要素が占めるデータ量をバイト単位で返す
bool is_memory_shared () const
 外部で割り当てられたメモリ領域を使用しているかどうか
iterator begin ()
 コンテナの先頭を指すランダムアクセスイテレータを返す
const_iterator begin () const
 コンテナの先頭を指すコンスト型のコンテナを操作するランダムアクセスイテレータを返す
iterator end ()
 コンテナの末尾を指すランダムアクセスイテレータを返す
const_iterator end () const
 コンテナの末尾を指すコンスト型のコンテナを操作するランダムアクセスイテレータを返す
reverse_iterator rbegin ()
 コンテナの末尾を指す逆方向ランダムアクセスイテレータを返す
const_reverse_iterator rbegin () const
 コンテナの末尾を指すコンスト型のコンテナを操作する逆方向ランダムアクセスイテレータを返す
reverse_iterator rend ()
 コンテナの先頭を指す逆方向ランダムアクセスイテレータを返す
const_reverse_iterator rend () const
 コンテナの先頭を指すコンスト型のコンテナを操作する逆方向ランダムアクセスイテレータを返す
size_type max_size () const
 使用しているアロケータが確保可能なメモリの最大値を返す
template<class TT , class AAlocator >
const arrayoperator= (const array< TT, AAlocator > &o)
 要素の型が異なるコンテナを代入する
const arrayoperator= (const array &o)
 要素の型が異なるコンテナを代入する
reference at (size_type index, size_type dmy1=0, size_type dmy2=0)
 index で示される位置の要素の参照を返す
const_reference at (size_type index, size_type dmy1=0, size_type dmy2=0) const
 index で示される位置の要素の const 参照を返す
reference operator() (size_type index, size_type dmy1=0, size_type dmy2=0)
 index で示される位置の要素の参照を返す
const_reference operator() (size_type index, size_type dmy1=0, size_type dmy2=0) const
 index で示される位置の要素の const 参照を返す
reference operator[] (size_type index)
 index で示される位置の要素の参照を返す
const_reference operator[] (size_type index) const
 index で示される位置の要素の const 参照を返す
 array ()
 ディフォルトコンストラクタ.要素数 0 のコンテナを作成する
 array (const Allocator &a)
 アロケータ a のコピーを利用する
 array (size_type num)
 要素数 num 個のコンテナを作成し,デフォルト値で要素を初期化する
 array (size_type num, const Allocator &a)
 要素数 num 個のコンテナを作成し,アロケータ a のコピーを利用する
 array (size_type num, const value_type &val)
 要素数 num 個のコンテナを作成し,値 val で初期化する
 array (size_type num, const value_type &val, const Allocator &a)
 要素数 num 個のコンテナを作成し,値 val で初期化し,アロケータ a のコピーを利用する
 array (const_iterator s, const_iterator e)
 イテレータ s と e の範囲の値を用いて,配列を初期化する
 array (const_iterator s, const_iterator e, const Allocator &a)
 イテレータ s と e の範囲の値を用いて,配列を初期化し,アロケータ a のコピーを利用する
 array (size_type num, pointer ptr, size_type mem_available)
 ptr が指すメモリ領域に,要素数 num 個のコンテナを作成する(ptr が指す先の利用可能なメモリ量は mem_available )
 array (size_type num, const value_type &val, pointer ptr, size_type mem_available)
 ptr が指すメモリ領域に,要素数 num 個のコンテナを作成し値 val で初期化する(ptr が指す先の利用可能なメモリ量は mem_available )
template<class TT , class AAlocator >
 array (const array< TT, AAlocator > &o)
 他の array 配列で要素の型が異なるものから同じ要素数の配列を作成する
 array (const array< T, Allocator > &o)
 他の array 配列で同じ要素型のものを用いて初期化する
 ~array ()
 コンテナが利用しているリソースを全て開放する

Static Public メソッド

static const matrix diag (const value_type &s1, const value_type &s2, const value_type &s3)
 3×3 の対角行列を計算する
static const matrix _44 (const value_type &a00, const value_type &a01, const value_type &a02, const value_type &a03, const value_type &a10, const value_type &a11, const value_type &a12, const value_type &a13, const value_type &a20, const value_type &a21, const value_type &a22, const value_type &a23, const value_type &a30, const value_type &a31, const value_type &a32, const value_type &a33)
 入力データを用いて4×4の行列を返す
static const matrix _34 (const value_type &a00, const value_type &a01, const value_type &a02, const value_type &a03, const value_type &a10, const value_type &a11, const value_type &a12, const value_type &a13, const value_type &a20, const value_type &a21, const value_type &a22, const value_type &a23)
 入力データを用いて3×4の行列を返す
static const matrix _43 (const value_type &a00, const value_type &a01, const value_type &a02, const value_type &a10, const value_type &a11, const value_type &a12, const value_type &a20, const value_type &a21, const value_type &a22, const value_type &a30, const value_type &a31, const value_type &a32)
 入力データを用いて4×3の行列を返す
static const matrix _41 (const value_type &a0, const value_type &a1, const value_type &a2, const value_type &a3)
 入力データを用いて4×1の行列を返す
static const matrix _33 (const value_type &a00, const value_type &a01, const value_type &a02, const value_type &a10, const value_type &a11, const value_type &a12, const value_type &a20, const value_type &a21, const value_type &a22)
 入力データを用いて3×3の行列を返す
static const matrix _31 (const value_type &a0, const value_type &a1, const value_type &a2)
 入力データを用いて3×1の行列を返す
static const matrix _22 (const value_type &a00, const value_type &a01, const value_type &a10, const value_type &a11)
 入力データを用いて2×2の行列を返す
static const matrix _21 (const value_type &a0, const value_type &a1)
 入力データを用いて3×1の行列を返す
static const matrix identity (size_type rows, size_type cols)
 任意サイズの単位行列を返す
static const matrix zero (size_type rows, size_type cols)
 任意サイズのゼロ行列を返す

Additional Inherited Members

- Protected メソッド inherited from mist::array< T, Allocator >
pointer paccess (size_type index)
 index で示される位置の要素のポインタを返す
const_pointer paccess (size_type index) const
 index で示される位置の要素の const ポインタを返す
- Protected 変数 inherited from mist::array< T, Allocator >
mist_allocator< T, Allocator > allocator_
 各コンテナで利用するアロケータオブジェクト
T * data_
 コンテナで扱うデータの先頭を表すポインタ

説明

template<class T, class Allocator = ::std::allocator< T >>
class mist::matrix< T, Allocator >

行と列の要素数が可変の行列

引数
T… 行列内に格納するデータ型
Allocator… MISTコンテナが利用するアロケータ型.省略した場合は,STLのデフォルトアロケータを使用する

コンストラクタとデストラクタ

template<class T, class Allocator = ::std::allocator< T >>
template<class TT , class AAlocator >
mist::matrix< T, Allocator >::matrix ( const matrix< TT, AAlocator > &  o)
inline

他の行列で要素の型が異なるものから同じサイズの行列を作成する

注意
異なる要素型間でデータの変換が可能でなくてはならない

関数

template<class T, class Allocator = ::std::allocator< T >>
reference mist::matrix< T, Allocator >::at ( size_type  r,
size_type  c 
)
inline

r 行 c 列 で示される位置の要素の参照を返す

DEBUG マクロを有効にした(NDEBUGマクロを定義しない)場合は,指定された r 行 c 列 が有効な範囲内にあるかをチェックする

引数
[in]r… 行位置
[in]c… 列位置
戻り値
指定された要素を示す参照
template<class T, class Allocator = ::std::allocator< T >>
const_reference mist::matrix< T, Allocator >::at ( size_type  r,
size_type  c 
) const
inline

r 行 c 列 で示される位置の要素の const 参照を返す

DEBUG マクロを有効にした(NDEBUGマクロを定義しない)場合は,指定された r 行 c 列 が有効な範囲内にあるかをチェックする

引数
[in]r… 行位置
[in]c… 列位置
戻り値
指定された要素を示す const 参照
template<class T, class Allocator = ::std::allocator< T >>
void mist::matrix< T, Allocator >::clear ( )
inline

行列の要素を空にする

行列に格納されているデータを全て削除し,行列を空(0行0列)にする

mist::array< T, Allocator >を再定義しています。

template<class T, class Allocator = ::std::allocator< T >>
iterator mist::matrix< T, Allocator >::col_begin ( size_type  c)
inline

列方向を操作する順方向ランダムアクセスイテレータを返す

   @code 列方向を操作する順方向ランダムアクセスイテレータの使用例

std::cout << "順方向ランダムアクセスイテレータ" << std::endl; mist::array< int >::iterator ite1 = a.row_begin( 1 ); for( ; ite1 != a.row_end( 1 ) ; ite1++ ) { std::cout << *ite1 << " "; } std::cout << std::endl << std::endl;

template<class T, class Allocator = ::std::allocator< T >>
reverse_iterator mist::matrix< T, Allocator >::col_rbegin ( size_type  c)
inline

列方向を操作する逆方向ランダムアクセスイテレータを返す

   @code 列方向を操作する逆方向ランダムアクセスイテレータの使用例

std::cout << "逆方向ランダムアクセスイテレータ" << std::endl; mist::array< int >::iterator ite1 = a.row_rbegin( 1 ); for( ; ite1 != a.row_rend( 1 ) ; ite1++ ) { std::cout << *ite1 << " "; } std::cout << std::endl << std::endl;

template<class T, class Allocator = ::std::allocator< T >>
static const matrix mist::matrix< T, Allocator >::diag ( const value_type s1,
const value_type s2,
const value_type s3 
)
inlinestatic

3×3 の対角行列を計算する

3つの入力成分の大きいものから順番に並べ替えて,対角行列を作成する

\[ \left( \begin{array}{ccc} \sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & \sigma_3 \end{array} \right) \]

ただし, $ \sigma_1 \ge \sigma_2 \ge \sigma_3 $

引数
[in]s1… 成分1
[in]s2… 成分2
[in]s3… 成分3
戻り値
対角行列
template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::is_equal ( const matrix< T, Allocator > &  a,
const double  delta 
)
inline

2つの行列が等しい(全要素の差が delta 未満)かどうかを判定する

引数
[in]a… 比較対象の行列
[in]delta… 許容誤差
戻り値
true… 2つの行列が等しい場合
false… 2つの行列が異なる場合
template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::operator!= ( const matrix< T, Allocator > &  a) const
inline

2つの行列が等しくない(どれか1つでも異なる要素を持つ)かどうかを判定する

引数
[in]a… 右辺値
戻り値
true… 2つの行列が異なる場合
false… 2つの行列が等しい場合
template<class T, class Allocator = ::std::allocator< T >>
reference mist::matrix< T, Allocator >::operator() ( size_type  r,
size_type  c 
)
inline

r 行 c 列 で示される位置の要素の参照を返す

DEBUG マクロを有効にした(NDEBUGマクロを定義しない)場合は,指定された r 行 c 列 が有効な範囲内にあるかをチェックする

引数
[in]r… 行位置
[in]c… 列位置
戻り値
指定された要素を示す参照
template<class T, class Allocator = ::std::allocator< T >>
const_reference mist::matrix< T, Allocator >::operator() ( size_type  r,
size_type  c 
) const
inline

r 行 c 列 で示される位置の要素の const 参照を返す

DEBUG マクロを有効にした(NDEBUGマクロを定義しない)場合は,指定された r 行 c 列 が有効な範囲内にあるかをチェックする

引数
[in]r… 行位置
[in]c… 列位置
戻り値
指定された要素を示す const 参照
template<class T, class Allocator = ::std::allocator< T >>
template<class TT , class AAlocator >
const matrix& mist::matrix< T, Allocator >::operator*= ( const matrix< TT, AAlocator > &  m2)
inline

行列の掛け算

\[ {\bf A} = {\bf A} * {\bf B} \]

引数
[in]m2… 右から掛ける行列
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
const matrix& mist::matrix< T, Allocator >::operator*= ( typename type_trait< T >::value_type  val)
inline

行列への定数(単位行列の定数倍)の掛け算

\[ {\bf A} = {\bf A} * val \]

引数
[in]val… 行列を定数倍する数
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
template<class TT , class AAlocator >
const matrix& mist::matrix< T, Allocator >::operator+= ( const matrix< TT, AAlocator > &  m2)
inline

行列の足し算

\[ {\bf A} = {\bf A} + {\bf B} \]

引数
[in]m2… 足し算を行う行列
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
const matrix& mist::matrix< T, Allocator >::operator+= ( typename type_trait< T >::value_type  val)
inline

行列への定数(単位行列の定数倍)の足し算

\[ {\bf A} = {\bf A} + val * {\bf I} \]

引数
[in]val… 単位行列の定数倍を表す数
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
template<class TT , class AAlocator >
const matrix& mist::matrix< T, Allocator >::operator-= ( const matrix< TT, AAlocator > &  m2)
inline

行列の引き算

\[ {\bf A} = {\bf A} - {\bf B} \]

引数
[in]m2… 引き算を行う行列
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
const matrix& mist::matrix< T, Allocator >::operator-= ( typename type_trait< T >::value_type  val)
inline

行列への定数(単位行列の定数倍)の引き算

\[ {\bf A} = {\bf A} - val * {\bf I} \]

引数
[in]val… 単位行列の定数倍を表す数
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
const matrix& mist::matrix< T, Allocator >::operator/= ( typename type_trait< T >::value_type  val)
inline

行列への定数(単位行列の定数倍)の割り算

\[ {\bf A} = {\bf A} / val \]

引数
[in]val… 行列を割る定数
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
template<class TT , class AAlocator >
const matrix& mist::matrix< T, Allocator >::operator= ( const matrix< TT, AAlocator > &  o)
inline

要素の型が異なる行列を代入する

コピー元である行列 o と全く同じ行列を作成する. コピー先(ここでは自分自身)の要素数が o と異なる場合は,自動的にサイズを調整する. コピー元とコピー先でデータ型(array< data > の data)が異なる場合の代入を行う.

引数
[in]o… コピー元の行列
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
const matrix< T, Allocator >& mist::matrix< T, Allocator >::operator= ( const matrix< T, Allocator > &  o)
inline

要素の型が同じ行列を代入する

コピー元である行列 o と全く同じ行列を作成する. コピー先(ここでは自分自身)の要素数が o と異なる場合は,自動的にサイズを調整する.

引数
[in]o… コピー元の行列
戻り値
自分自身
template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::operator== ( const matrix< T, Allocator > &  a) const
inline

2つの行列が等しい(全要素が同じ値を持つ)かどうかを判定する

引数
[in]a… 右辺値
戻り値
true… 2つの行列が等しい場合
false… 2つの行列が異なる場合
template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::resize ( size_type  num)
inline

行列のサイズを num 行 1 列に変更する

元の行列と異なる場合は,自動的にサイズを調整する. 全ての要素の値はデフォルトコンストラクタで初期化される. また,組み込み型(int や double など)の場合は,全ての要素を0で初期化する.

引数
[in]num… リサイズ後の行列の行数
戻り値
true… 正常にリサイズが終了
false… リサイズ後のメモリを確保できなかった場合

参照元 compute_fundamental_matrices(), mist::homography_matrix(), mist::lu_factorization(), mist::multiply(), mist::permutation_matrix(), mist::read_csv(), trifocal_tensor_to_camera_matrices(), trifocal_tensor_to_epipoles(), と mist::matrix< difference_type >::trim().

template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::resize ( size_type  nrows,
size_type  ncols 
)
inline

行列のサイズを num1 行 num2 列に変更する

元の行列サイズと異なる場合は,自動的にサイズを調整する. 全ての要素の値はデフォルトコンストラクタで初期化される. また,組み込み型(int や double など)の場合は,全ての要素を0で初期化する.

引数
[in]nrows… リサイズ後の行列の行数
[in]ncols… リサイズ後の行列の列数
戻り値
true… 正常にリサイズが終了
false… リサイズ後のメモリを確保できなかった場合
template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::resize ( size_type  nrows,
size_type  ncols,
const T &  val 
)
inline

行列のサイズを num1 行 num2 列に変更する

行列サイズを num1 行 num2 列に変更し,全ての要素を値 val で初期化する.

引数
[in]nrows… リサイズ後の行列の行数
[in]ncols… リサイズ後の行列の列数
[in]val… リサイズ後に各要素を初期化する値
戻り値
true… 正常にリサイズが終了
false… リサイズ後のメモリを確保できなかった場合
template<class T, class Allocator = ::std::allocator< T >>
iterator mist::matrix< T, Allocator >::row_begin ( size_type  r)
inline

行方向を操作する順方向ランダムアクセスイテレータを返す

   @code 行方向を操作する順方向ランダムアクセスイテレータの使用例

std::cout << "順方向ランダムアクセスイテレータ" << std::endl; mist::array< int >::iterator ite1 = a.row_begin( 1 ); for( ; ite1 != a.row_end( 1 ) ; ite1++ ) { std::cout << *ite1 << " "; } std::cout << std::endl << std::endl;

template<class T, class Allocator = ::std::allocator< T >>
reverse_iterator mist::matrix< T, Allocator >::row_rbegin ( size_type  r)
inline

行方向を操作する逆方向ランダムアクセスイテレータを返す

   @code 行方向を操作する逆方向ランダムアクセスイテレータの使用例

std::cout << "逆方向ランダムアクセスイテレータ" << std::endl; mist::array< int >::iterator ite1 = a.row_rbegin( 1 ); for( ; ite1 != a.row_rend( 1 ) ; ite1++ ) { std::cout << *ite1 << " "; } std::cout << std::endl << std::endl;

template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::swap ( matrix< T, Allocator > &  m)
inline

行列内の全ての内容を入れ替える.

入れ替え元の行列 m の中身と全て入れ替える

引数
[in]m… 内容を入れ替える対象
戻り値
true… データのスワップに成功
false… データのスワップに失敗

参照元 mist::vector< T, Allocator >::operator*=(), と mist::matrix< difference_type >::operator*=().

template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::trim ( matrix< T, Allocator > &  out,
size_type  row,
size_type  col,
difference_type  nrows = -1,
difference_type  ncols = -1 
) const
inline

コンテナ内の要素をトリミングする

引数
[out]out… トリミング結果の行列を格納するオブジェクト(行列のサイズは自動で変更されます)
[in]row… トリミングの行方向の開始位置(ゼロから始まるインデックス)
[in]col… トリミングの列方向の開始位置(ゼロから始まるインデックス)
[in]nrows… トリミング後の行数(-1の場合は,最後までをコピーする)
[in]ncols… トリミング後の列数(-1の場合は,最後までをコピーする)
戻り値
true… トリミングに成功した場合(元とサイズが変わらない場合も含む)
false… 不正なトリミングを行おうとした場合

参照元 mist::matrix< difference_type >::trim().

template<class T, class Allocator = ::std::allocator< T >>
bool mist::matrix< T, Allocator >::trim ( size_type  row,
size_type  col,
difference_type  nrows = -1,
difference_type  ncols = -1 
)
inline

コンテナ内の要素をトリミングする

引数
[in]row… トリミングの行方向の開始位置(ゼロから始まるインデックス)
[in]col… トリミングの列方向の開始位置(ゼロから始まるインデックス)
[in]nrows… トリミング後の行数(-1の場合は,最後までをコピーする)
[in]ncols… トリミング後の列数(-1の場合は,最後までをコピーする)
戻り値
true… トリミングに成功した場合(元とサイズが変わらない場合も含む)
false… 不正なトリミングを行おうとした場合

このクラスの説明は次のファイルから生成されました:

Generated on Wed Nov 12 2014 19:44:29 for MIST by doxygen 1.8.1.2