Changeset 596
 Timestamp:
 Aug 28, 2006, 1:20:52 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/c++_tools/classifier/MatrixLookupWeighted.h
r595 r596 15 15 16 16 /// 17 /// MatrixLookups can be used to create lookups/views into matrices 18 /// in a more general way than the views supported in the matrix 19 /// class. The object does not contain any data, but only a pointer 20 /// to a matrix and row and columns incices defining which 21 /// submatrix to look into. Each row and each column corresponds 22 /// to a row and a column in the Kernel, respectively. This design 23 /// allow for fast creation of submatrices, which is a common 24 /// operation in most traning/validation procedures. 17 /// A MatrixLookupWeighted is very similar to a MatrixLookup, but 18 /// contains a pointer to a weight matrix as well meeaning each data 19 /// element is associated to weight. 25 20 /// 26 21 /// A MatrixLookupWeighted can be created directly from a matrix or from an … … 29 24 /// avoid multiple lookups. 30 25 /// 31 /// There is a possibility to set the MatrixLookupWeighted as owner of the 32 /// underlying matrix. In that case the underlying matrix will be 33 /// destroyed in the destructor. Consequently, the underlying matrix 34 /// must have been dynamically allocated and no other MatrixLookupWeighted 35 /// can own the Kernel. 26 /// There is a possibility to set the MatrixLookupWeighted as owner 27 /// of the underlying matrices (data and weight). In that case the 28 /// underlying matrix will be destroyed in the 29 /// destructor. Consequently, the underlying matricis must have been 30 /// dynamically allocated and no other MatrixLookupWeighted can own 31 /// the matrices. 36 32 /// 37 33 /// @todo add on weight part … … 45 41 /// Constructor creating a lookup into the entire @a matrix. 46 42 /// 47 /// @note If @a matrix goes out of scope or is deleted, the48 /// MatrixLookupWeighted becomes invalid and the result of further use is49 /// undefined.43 /// @note If @a matrix or @a weights goes out of scope or is 44 /// deleted, the MatrixLookupWeighted becomes invalid and the 45 /// result of further use is undefined. 50 46 /// 51 47 MatrixLookupWeighted(const gslapi::matrix& matrix, … … 55 51 /// Constructor creating a lookup into a submatrix of @a matrix. 56 52 /// The @a row and @a column define what submatrix to look into, 57 /// in other words, the created MatrixLookupWeighted will fullfill the 58 /// following: \f$ MatrixLookupWeighted(i,j)=matrix(row[i],column[j]) 59 /// \f$. This also means that number of rows in created 60 /// MatrixLookupWeighted is equal to size of vector @a row, and number of 61 /// columns is equal to size of vector @a column. 62 /// 63 /// @note If @a matrix goes out of scope or is deleted, the 64 /// MatrixLookupWeighted becomes invalid and the result of further use is 65 /// undefined. 66 /// 67 MatrixLookupWeighted(const gslapi::matrix& matrix, const gslapi::matrix& weights, 68 const std::vector<size_t>& row, 69 const std::vector<size_t>& column); 53 /// in other words, the created MatrixLookupWeighted will fullfill 54 /// the following: \f$ 55 /// MatrixLookupWeighted(i,j)=matrix(row[i],column[j]) 56 /// weights(row[i],column[j])\f$. This also means that number of 57 /// rows in created MatrixLookupWeighted is equal to size of 58 /// vector @a row, and number of columns is equal to size of 59 /// vector @a column. 60 /// 61 /// @note If @a matrix or @a weights goes out of scope or is deleted, the 62 /// MatrixLookupWeighted becomes invalid and the result of further use is 63 /// undefined. 64 /// 65 MatrixLookupWeighted(const gslapi::matrix& matrix, 66 const gslapi::matrix& weights, 67 const std::vector<size_t>& row, 68 const std::vector<size_t>& column); 70 69 71 70 /// 72 71 /// Constructor creating a lookup into a submatrix of @matrix. 73 72 /// 74 /// If @a row_vectors is true the new MatrixLookupWeighted will be consist 75 /// of the row vectors defined by @a index. This means that the 76 /// created MatrixLookupWeighted will fullfill: 77 /// \f$ MatrixLookupWeighted(i,j)=matrix(i,index[j]) \f$ 73 /// If @a row_vectors is true the new MatrixLookupWeighted will be 74 /// consist of the row vectors defined by @a index. This means 75 /// that the created MatrixLookupWeighted will fullfill: \f$ 76 /// MatrixLookupWeighted(i,j)=matrix(i,index[j])*weights(i,index[j]) 77 /// \f$ 78 78 /// 79 79 /// If @a row_vectors is false the new MatrixLookupWeighted will be consist … … 82 82 /// \f$ MatrixLookupWeighted(i,j)=matrix(index[i],j) \f$ 83 83 /// 84 /// @note If @a matrix goes out of scope or is deleted, the85 /// MatrixLookupWeighted becomes invalid and the result of further use is86 /// undefined.84 /// @note If @a matrix or @a weights goes out of scope or is 85 /// deleted, the MatrixLookupWeighted becomes invalid and the 86 /// result of further use is undefined. 87 87 /// 88 88 MatrixLookupWeighted(const gslapi::matrix& matrix,
Note: See TracChangeset
for help on using the changeset viewer.