5 六月 2025
5 六月 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矩阵乘法(向量 x 矩阵)
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 );