File: vectorSpace.hpp

package info (click to toggle)
mldemos 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,224 kB
  • ctags: 46,525
  • sloc: cpp: 306,887; ansic: 167,718; ml: 126; sh: 109; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Represents a vector space as a sparse matrix
 *
 */
#ifndef VECTOR_SPACE_H
#define VECTOR_SPACE_H
#include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <vector>

namespace AG
{
	namespace Data{

		using namespace boost::numeric::ublas;

		typedef coordinate_vector<double> Vect;
		typedef std::vector< Vect > ArrayOfVectors;
		typedef ArrayOfVectors VectorSpace;

		void random_init_vector_space(VectorSpace & vs, unsigned int num_vectors, unsigned int dimensions, double max_value);

		std::ostream& operator << (std::ostream& os,  Vect & vs);
		std::ostream& operator << (std::ostream& os,  VectorSpace & vs);

	}; // namespace Data

};

#endif