yingjerkao / uni10

Official Repo for Uni10
28 stars 9 forks source link

Suggestions #10

Open rezah opened 8 years ago

rezah commented 8 years ago

(1) Suppose T is a matrix. For T.transpose(), it is better to leave T unchanged and return transpose of T. But current version of Uni10 changes matrix T to its transpose.

(2) To do matrix multiplication parallel (or tensor contraction), it's really recommended to add opeblas library (its wrappers) into Uni10, http://www.openblas.net/

(3) T.max() only works for real matrix, but please generalize it to complex matrix (norm of complex values could be considered). Some function only works for real matrices, which should be also generalized to complex ones: ".at(i , j) " is only defined for real matrix, " ( , ) " should be defined for both complex and real matrices.

"all functions should be worked for real and complex matrices"

(4) constructors are not well-defined. It's more convenient to add a flag for complex or real types, instead of initializing them with complex or real values. uni10::Matrix::Matrix ( size_t _Rnum, size_t _Cnum, const std::vector< Complex > & _elem)--------------------------------> uni10::Matrix::Matrix ( size_t _Rnum, size_t _Cnum, cflag or rflag )

(5) Please add more functions to manage matrices more easily:

swap specified rows or columns remove specified rows/columns/slices read/write access to contiguous and non-contiguous submatrices insert matrix at specified row/column/slice convert linear index to subscripts matrix logarithm various norms of vectors and matrices Schur decomposition limited number of eigenvalues & eigenvectors

generate Toeplitz matrix generate object with random values (uniform and normal distributions)

convert between matrix types determinant

add some universal constant pi, inf, NaN, speed of light, timer for measuring number of elapsed seconds

rezah commented 8 years ago

Still believe, after writing different codes with Uni10, that this library requires highly/crucially more functions for matrix operation, such as exponential of a general matrix and also the items listed above. I actually, transform uni10 Matrix into other libraries to manage the matrix multiplication.

yingjerkao commented 8 years ago

@rezah, @Yun-Hsuan
We are redesigning our linear algebra layer and matrix container to make it is easy to integrate existing powerful matrix libraries such as armadillo, arrayfire, etc. Although it is good to have all these functionality built-in, it has become a nightmare to maintain and test these functionalities.