C
Qul::PlatformInterface::GenericMatrix Struct
template <int M, int N, typename T> struct Qul::PlatformInterface::GenericMatrixGenericMatrix クラスは、行列を表すテンプレートクラスです。詳細...
| Header: | #include <platforminterface/genericmatrix.h> |
| Since: | Qt Quick Ultralite (Platform) 1.7 |
| Inherited By: |
パブリック型
| enum | Initialization { Uninitialized, ZeroInitialized, Identity } |
パブリック関数
| GenericMatrix() | |
| GenericMatrix(Qul::PlatformInterface::GenericMatrix<type-parameter-0-2>::Initialization initialization) | |
| GenericMatrix(const T *values) | |
| T * | data() |
| const T * | data() const |
| bool | isIdentity() const |
| void | setToIdentity() |
| bool | operator!=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) const |
| T & | operator()(int row, int column) |
| const T & | operator()(int row, int column) const |
| Qul::PlatformInterface::GenericMatrix<M, N, T> & | operator*=(T factor) |
| Qul::PlatformInterface::GenericMatrix<M, N, T> & | operator*=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) |
| Qul::PlatformInterface::GenericMatrix<M, N, T> & | operator+=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) |
| bool | operator==(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) const |
関連する非メンバ
| Qul::PlatformInterface::GenericMatrix<M, N, T2> | operator*(T1 factor, const Qul::PlatformInterface::GenericMatrix<M, N, T2> &matrix) |
| Qul::PlatformInterface::GenericMatrix<M, N2, T> | operator*(const Qul::PlatformInterface::GenericMatrix<M, N1, T> &m1, const Qul::PlatformInterface::GenericMatrix<N1, N2, T> &m2) |
| Qul::PlatformInterface::GenericMatrix<M, N, T> | operator+(const Qul::PlatformInterface::GenericMatrix<M, N, T> &m1, const Qul::PlatformInterface::GenericMatrix<M, N, T> &m2) |
詳細な説明
GenericMatrix クラスは行列を表すテンプレートクラスです。正方行列の場合、テンプレートの特殊化によっていくつかの追加メソッドが提供されます。
GenericMatrix テンプレートには 3 つのパラメータがあります:
| M | 列数。 |
| N | 行数. |
| T | クラスのユーザーに見える要素タイプ。 |
Tは以下のものでなければなりません:
- コピー可能。
- デフォルトで構成可能。
- 整数構成可能。
例
using Qul::PlatformInterface::GenericMatrix; // Specializes a square matrix. using Matrix5x5 = GenericMatrix<5, 5, float>; Matrix5x5 m(Matrix5x5::Identity); m.isIdentity(); // Specializes a rectangular matrix. using Matrix2x3 = GenericMatrix<2, 3, float>; Matrix2x3 m2(Matrix2x3::Uninitialized);
メンバ型のドキュメント
enum GenericMatrix::Initialization
この列挙型は行列の初期化ポリシーに使用される。
| 定数 | 値 | 説明 |
|---|---|---|
Qul::PlatformInterface::GenericMatrix::Uninitialized | 0 | 内容を初期化せずに行列を構築します。 |
Qul::PlatformInterface::GenericMatrix::ZeroInitialized | 1 | 行列の内容はゼロ初期化されます。 |
Qul::PlatformInterface::GenericMatrix::Identity | 2 | 行列の内容は単位行列に設定されます。この列挙型は、正方行列でのみ使用可能。 |
メンバ関数ドキュメント
GenericMatrix::GenericMatrix()
ゼロ初期化された値で行列を構築します。
[explicit] GenericMatrix::GenericMatrix(Qul::PlatformInterface::GenericMatrix<type-parameter-0-2>::Initialization initialization)
行列を構築し、initialization ポリシーに従って値を設定する。
[explicit] GenericMatrix::GenericMatrix(const T *values)
与えられた M * Nvalues から行列を構築する。values 配列の内容は,行長順であると仮定される.
T *GenericMatrix::data()
この行列の生データへのポインタを返します。
const T *GenericMatrix::data() const
この行列の生データへの定数ポインタを返します。
bool GenericMatrix::isIdentity() const
この行列が恒等行列である場合はtrue を返し、そうでない場合はfalse を返す。
注意: このメソッドは正方行列に対してのみ有効である。
setToIdentity()も参照 。
void GenericMatrix::setToIdentity()
この行列を恒等式に設定します。
注意: このメソッドは正方行列に対してのみ有効である。
isIdentity()も参照 。
bool GenericMatrix::operator!=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) const
この行列がother と同一でない場合はtrue を返し,そうでない場合はfalse を返す.
T &GenericMatrix::operator()(int row, int column)
この行列の位置 (row,column) にある要素への参照を返し、その要素を代入できるようにします。
const T &GenericMatrix::operator()(int row, int column) const
この行列の位置 (row,column) にある要素への定数参照を返します。
Qul::PlatformInterface::GenericMatrix<M, N, T> &GenericMatrix::operator*=(T factor)
この行列のすべての要素にスカラーfactor を乗じる。
Qul::PlatformInterface::GenericMatrix<M, N, T> &GenericMatrix::operator*=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other)
この行列の全要素をother 行列と乗算する.
注意: このメソッドは,正方行列に対してのみ有効である.
Qul::PlatformInterface::GenericMatrix<M, N, T> &GenericMatrix::operator+=(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other)
other の内容をこの行列に追加する。
bool GenericMatrix::operator==(const Qul::PlatformInterface::GenericMatrix<M, N, T> &other) const
この行列がother と同一であればtrue を返し,そうでなければfalse を返す.
関連する非会員
template <int M, int N, typename T1, typename T2> Qul::PlatformInterface::GenericMatrix<M, N, T2> operator*(T1 factor, const Qul::PlatformInterface::GenericMatrix<M, N, T2> &matrix)
matrix の全要素にスカラーfactor を掛けた結果を返す。
template <int M, int N1, int N2, typename T> Qul::PlatformInterface::GenericMatrix<M, N2, T> operator*(const Qul::PlatformInterface::GenericMatrix<M, N1, T> &m1, const Qul::PlatformInterface::GenericMatrix<N1, N2, T> &m2)
m1 とm2 の全要素を乗算した結果を返す。
template <int M, int N, typename T> Qul::PlatformInterface::GenericMatrix<M, N, T> operator+(const Qul::PlatformInterface::GenericMatrix<M, N, T> &m1, const Qul::PlatformInterface::GenericMatrix<M, N, T> &m2)
m1 とm2 の合計を返します。
特定の Qt ライセンスの下で利用可能です。
詳細はこちら。