31 T
const* matUtl_data = matUtl.
GetData();
32 T* matSpams_data = matSpams.
rawX();
35 for (
int j = 0; j < matUtl.
Columns(); j += 1 )
36 cblas_copy<T>(matUtl.
Rows(), (T*)matUtl_data+j, matUtl.
Columns(), matSpams_data+j*matUtl.
Rows(),1);
40 for (
int i = 0; i < matUtl.
Rows(); i += 1 )
41 cblas_copy<T>(matUtl.
Columns(), (T*)matUtl_data+i*matUtl.
Columns(), 1, matSpams_data+i,matUtl.
Rows());
49 matUtl.
ReSize(matSpams.
m(), matSpams.
n());
50 T* matUtl_data = matUtl.
GetData();
51 const T * matSpams_data = matSpams.
X();
54 for (
int j = 0; j < matUtl.
Columns(); j += 1 )
55 cblas_copy<T>(matUtl.
Rows(), (T*)matSpams_data+j*matUtl.
Rows(),1, matUtl_data+j, matUtl.
Columns());
59 for (
int i = 0; i < matUtl.
Rows(); i += 1 )
60 cblas_copy<T>(matUtl.
Columns(), (T*)matSpams_data+i,matUtl.
Rows(), matUtl_data+i*matUtl.
Columns(), 1);
89 for (
int i = 0; i < mat.
n(); i += 1 )
90 for (
int j = pB[i]; j<pE[i]; ++j)
91 result(r[j], i) = mat.
v(j);
NDArray<T,1> is a vector class which uses blas mkl.
int pB(const int i) const
returns pB[i]
void VectorToUtlVector(const Vector< T > &v, utl::NDArray< T, 1 > &vec)
int * pE() const
Direct access to _pE.
T * rawX() const
returns a modifiable reference of the data, DANGEROUS
NDArray<T,2> is a row-major matrix.
int n() const
returns the size of the vector
T v(const int i) const
returns v[i]
void Fill(const T &value)
int m() const
returns the number of columns
int n() const
Number of columns.
void MatrixToUtlMatrix(const Matrix< T > &matSpams, utl::NDArray< T, 2 > &matUtl)
void resize(const int n)
resize the vector
int r(const int i) const
returns r[i]
void SpMatrixToUtlMatrix(const SpMatrix< T > &mat, utl::NDArray< T, 2 > &result)
void UtlVectorToVector(const utl::NDArray< T, 1 > &v, Vector< T > &vec)
void UtlMatrixToMatrix(const utl::NDArray< T, 2 > &matUtl, Matrix< T > &matSpams)
int n() const
returns the number of rows
bool ReSize(const SizeType rows, const SizeType cols)
void resize(int m, int n)
Resize the matrix.
const T * X() const
return a non-modifiable reference to the data
bool ReSize(const SizeType size)
T * rawX() const
reference a modifiable reference to the data, DANGEROUS