5 6月 2025
5 6月 2025
matrix A(2, 3); matrix B(3, 2); matrix C = A @ B; // Result: Matrix C of size [2,2]行列の乗算(行列×ベクトル)
matrix M(2, 3); vector V(3); vector R = M @ V; // Result: Vector R of 2 elements行列の乗算(ベクトル×行列)
matrix M(2, 3); vector V(1, 2); vector R = V @ M; // Result: Vector R of 3 elementsスカラー乗算(ベクトル×ベクトル)
vector V1(1, 3), V2(1, 3); double r = V1 @ V2; // Result: Scalar
static vector vector::Random( const ulong size, // vector length const double min=0.0, // min value const double max=1.0 // max value ); static matrix matrix::Random( const ulong rows, // number of rows const ulong cols // number of columns const float min=0.0, // min value const float max=1.0 // max value );